merchant-frontend-examples

ZZZ: Inactive/Deprecated
Log | Files | Refs

order.php (2622B)


      1 <?php
      2   // This file is in the public domain.
      3 
      4   include_once 'config.php';
      5   include_once 'helpers.php';
      6 
      7   function make_order($nonce,
      8                       $order_id,
      9                       $now){
     10     $order
     11       = array(
     12         'nonce' => $nonce,
     13         'amount' =>
     14           array('value' => 0,
     15     	        'fraction' => 10000000,
     16                 'currency' => $GLOBALS['CURRENCY']),
     17     	'max_fee' =>
     18   	  array('value' => 0,
     19     	        'fraction' => 5000000,
     20     	        'currency' => $GLOBALS['CURRENCY']),
     21         'products' =>
     22           array(array('description' =>
     23                          "Donation to charity program",
     24     		      'quantity' => 1,
     25     		      'price' =>
     26   		         array ('value' => 0,
     27     			        'fraction' => 10000000,
     28                                 'currency' => $GLOBALS['CURRENCY']),
     29     		      'product_id' => 0,
     30     		      'taxes' =>
     31                          array(),
     32     		      'delivery_date' =>
     33                          "/Date(" . $now->getTimestamp() . ")/",
     34     		      'delivery_location' =>
     35                          'LNAME1'
     36                      )
     37                ),
     38         'summary' =>
     39           "Personal donation to charity program",
     40         'order_id' => $order_id,
     41     	'timestamp' =>
     42           "/Date(" . $now->getTimestamp() . ")/",
     43   	'fulfillment_url' =>
     44           url_rel("/fulfillment.php?order_id=$order_id"),
     45   	'pay_url' =>
     46           url_rel("/pay.php"),
     47     	'refund_deadline' =>
     48   	  "/Date(" . $now->getTimestamp() . ")/",
     49     	'pay_deadline' =>
     50           "/Date(" . $now->add(new DateInterval('P2W'))->getTimestamp() . ")/",
     51     	'merchant' =>
     52   	  array('address' =>
     53                    'LNAME2',
     54                 'instance' => "tutorial",
     55     		'name' =>
     56                     "Charity donation shop",
     57     		'jurisdiction' =>
     58                     'LNAME2'),
     59         'locations' =>
     60   	  array ('LNAME1' =>
     61   		    array ('country' => 'Test Country 1',
     62     			   'city' => 'Test City 1',
     63     			   'state' => 'Test State 1',
     64     			   'region' => 'Test Region 1',
     65     			   'province' => 'Test Province 1',
     66     			   'ZIP code' => 49081,
     67     			   'street' => 'test street 1',
     68     			   'street number' => 201),
     69     		 'LNAME2' =>
     70   		    array ('country' => 'Test Country 2',
     71     		           'city' => 'Test City 2',
     72     		           'state' => 'Test State 2',
     73     		           'region' => 'Test Region 2',
     74     		           'province' => 'Test Province 2',
     75     		           'ZIP code' => 49082,
     76     		           'street' => 'test street 2',
     77     		           'street number' => 202)
     78                 ));
     79     return array ('order' => $order);
     80   }
     81 ?>