summaryrefslogtreecommitdiff
path: root/php/inline.php
blob: a6cf5102679cc349398f03692365b01e8328c7f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
  // This file is in the public domain.

  include 'contract.php';

  $order_id = rand(1,90000); // simplified, do not do this!
  $order = make_order($order_id, new DateTime('now'));

  $response = post_to_backend("/proposal", $order);
  $ret = $response["body"];

  if (200 != $response["status_code"]) {
    $ret =  build_error($response,
                        "Failed to generate contract",
                        $response['status_code']);
  }

  http_response_code(402); // Payment required
  header ("X-Taler-Proposal: $ret"); // Inline proposal
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Select payment method</title>
  </head>
  <body>
    Here you should put the HTML for the non-Taler (credit card) payment.
  </body>
</html>