merchant-frontend-examples

ZZZ: Inactive/Deprecated
Log | Files | Refs

inline.php (755B)


      1 <?php
      2   // This file is in the public domain.
      3 
      4   include "order.php";
      5 
      6   $order_id = rand(1,90000); // simplified, do not do this!
      7   $order = make_order($order_id, new DateTime("now"));
      8 
      9   $response = post_to_backend("/proposal", $order);
     10   $ret = $response["body"];
     11 
     12   if (200 != $response["status_code"]) {
     13     $ret =  build_error($response,
     14                         "Failed to generate proposal",
     15                         $response["status_code"]);
     16   }
     17 
     18   http_response_code(402); // Payment required
     19   header ("X-Taler-Proposal: $ret"); // Inline proposal
     20 ?>
     21 <!DOCTYPE html>
     22 <html lang="en">
     23   <head>
     24     <title>Select payment method</title>
     25   </head>
     26   <body>
     27     Here you should put the HTML for the non-Taler (credit card) payment.
     28   </body>
     29 </html>