summaryrefslogtreecommitdiff
path: root/src/frontend/checkout.php
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2015-11-09 18:04:07 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2015-11-09 18:04:07 +0100
commitcfcc84dac9410d60026062e9542de709b8f89294 (patch)
tree63f4f3d4a651865822a6a0473c32b1a37102b3a6 /src/frontend/checkout.php
parent6a419ca7dfff4a504522a3ae947395d21aba3023 (diff)
downloadmerchant-cfcc84dac9410d60026062e9542de709b8f89294.tar.gz
merchant-cfcc84dac9410d60026062e9542de709b8f89294.tar.bz2
merchant-cfcc84dac9410d60026062e9542de709b8f89294.zip
- adding fractional offers to demonstrator
- adding some definition to make the /deposit handler call the context event loop
Diffstat (limited to 'src/frontend/checkout.php')
-rw-r--r--src/frontend/checkout.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/frontend/checkout.php b/src/frontend/checkout.php
index 15f0e356..abb0a6e3 100644
--- a/src/frontend/checkout.php
+++ b/src/frontend/checkout.php
@@ -49,10 +49,14 @@
$donation_amount = $_POST['donation_amount'];
$donation_currency = $_POST['donation_currency'];
+ // get frational part
+ list ($donation_value, $donation_fraction) = split ("\.", $donation_amount, 2);
// create PHP session and store donation information in session
+ $donation_fraction = (float) ("0." . $donation_fraction);
session_start();
$_SESSION['receiver'] = $donation_receiver;
- $_SESSION['amount'] = $donation_amount;
+ $_SESSION['amount_value'] = (int) $donation_amount;
+ $_SESSION['amount_fraction'] = (int) ($donation_fraction * 1000000);
$_SESSION['currency'] = $donation_currency;
?>