merchant-frontend-examples

ZZZ: Inactive/Deprecated
Log | Files | Refs

commit 9319c5693ac2017b3d713c76810c4b0eb16ccf23
parent e1ad41d04b4351421f2274f52ae06fb5396cdcc4
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 19 Nov 2016 19:39:39 +0100

nicer PHP formatting, make fit within page boundaries

Diffstat:
Mphp/contract.php | 100+++++++++++++++++++++++++++++++++++++++++++------------------------------------
Mphp/doc/Makefile | 2+-
2 files changed, 56 insertions(+), 46 deletions(-)

diff --git a/php/contract.php b/php/contract.php @@ -5,42 +5,58 @@ include_once 'helpers.php'; function make_contract($transaction_id, $now){ - $contract = array ('amount' => - array ('value' => 1, - 'fraction' => 0, - 'currency' => $GLOBALS['CURRENCY']), - 'max_fee' => - array ('value' => 0, - 'fraction' => 50000, - 'currency' => $GLOBALS['CURRENCY']), - 'transaction_id' => $transaction_id, - 'products' => array ( - array ('description' => "Donation to charity program", - 'quantity' => 1, - 'price' => - array ('value' => 1, - 'fraction' => 0, - 'currency' => $GLOBALS['CURRENCY']), - 'product_id' => 0, - 'taxes' => array(), - 'delivery_date' => "/Date(" . $now->getTimestamp() . ")/", - 'delivery_location' => 'LNAME1')), - 'summary' => "Personal donation to charity program", - 'timestamp' => "/Date(" . $now->getTimestamp() . ")/", - 'fulfillment_url' => url_rel("/fulfillment.php?" - . "transaction_id=$transaction_id&timestamp=" - . $now->getTimestamp()), - 'repurchase_correlation_id' => '', - 'pay_deadline' => - "/Date(" . $now->add(new DateInterval('P2W'))->getTimestamp() . ")/", - 'refund_deadline' => - "/Date(" . $now->add(new DateInterval('P3M'))->getTimestamp() . ")/", - 'merchant' => - array ('address' => 'LNAME2', - 'name' => "Charity donation shop", - 'jurisdiction' => 'LNAME3'), - 'locations' => - array ('LNAME1' => + $contract + = array( + 'amount' => + array('value' => 1, + 'fraction' => 0, + 'currency' => $GLOBALS['CURRENCY']), + 'max_fee' => + array('value' => 0, + 'fraction' => 50000, + 'currency' => $GLOBALS['CURRENCY']), + 'transaction_id' => + $transaction_id, + 'products' => + array(array('description' => + "Donation to charity program", + 'quantity' => 1, + 'price' => + array ('value' => 1, + 'fraction' => 0, + 'currency' => $GLOBALS['CURRENCY']), + 'product_id' => 0, + 'taxes' => + array(), + 'delivery_date' => + "/Date(" . $now->getTimestamp() . ")/", + 'delivery_location' => + 'LNAME1' + ) + ), + 'summary' => + "Personal donation to charity program", + 'timestamp' => + "/Date(" . $now->getTimestamp() . ")/", + 'fulfillment_url' => + url_rel("/fulfillment.php?" + . "transaction_id=$transaction_id&timestamp=" + . $now->getTimestamp()), + 'repurchase_correlation_id' => + '', + 'pay_deadline' => + "/Date(" . $now->add(new DateInterval('P2W'))->getTimestamp() . ")/", + 'refund_deadline' => + "/Date(" . $now->add(new DateInterval('P3M'))->getTimestamp() . ")/", + 'merchant' => + array('address' => + 'LNAME2', + 'name' => + "Charity donation shop", + 'jurisdiction' => + 'LNAME2'), + 'locations' => + array ('LNAME1' => array ('country' => 'Test Country 1', 'city' => 'Test City 1', 'state' => 'Test State 1', @@ -49,7 +65,7 @@ 'ZIP code' => 49081, 'street' => 'test street 1', 'street number' => 201), - 'LNAME2' => + 'LNAME2' => array ('country' => 'Test Country 2', 'city' => 'Test City 2', 'state' => 'Test State 2', @@ -57,14 +73,8 @@ 'province' => 'Test Province 2', 'ZIP code' => 49082, 'street' => 'test street 2', - 'street number' => 202), - 'LNAME3' => - array ('country' => 'Test Country 3', - 'city' => 'Test City 3', - 'state' => 'Test State 3', - 'region' => 'Test Region 3', - 'province' => 'Test Province 3', - 'ZIP code' => 49083))); + 'street number' => 202) + )); return array ('contract' => $contract); } ?> diff --git a/php/doc/Makefile b/php/doc/Makefile @@ -13,5 +13,5 @@ clean: rm -f arch.jpg arch.pdf tutorial.html tutorial.pdf -info_TEXINFOS = manual.texi +info_TEXINFOS = tutorial.texi manual_TEXINFOS = version.texi