Ejemplo n.º 1
0
<?php

require 'conf.php';
$co = new Paydunya_Onsite_Invoice();
// Passer l'identifiant du client en paramètre à la fonction create
if ($co->charge($_POST["opr_token"], $_POST["confirmation_code"])) {
    echo $co->response_text;
    echo "<br/> Lien du reçu de paiement <a href=\"" . $co->getReceiptUrl() . "\">Télécharger</a>";
} else {
    echo $co->response_text;
}
?>
<br/>
<br/>
<a href="index2.php?reset=ok" title="">Retour au site</a>

<?php

session_start();
require 'conf.php';
$co = new Paydunya_Onsite_Invoice();
$total_amount = 0;
foreach ($_SESSION["cart"] as $product) {
    $co->addItem($product['name'], $product['quantity'], $product['unit_price'], $product['total_price']);
    $total_amount += $product['total_price'];
}
$co->setTotalAmount($total_amount);
// Passer l'identifiant du client en paramètre à la fonction create
if ($co->create($_POST["account_alias"])) {
    // header("Location: ".$co->getInvoiceUrl());
} else {
    exit($co->response_text);
}
?>
<html>
<head>
  <title>Requête de paiement PSR</title>
  <style type="text/css">
    body{
      background-color: #272727;
      font-family: Arial;
      font-size: 14px;
    }
    h1{
      font-weight: 500;
    }
    .container{