merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit d46b7f5566f736ddc0263fe3969e0b56b25976ad
parent 6b5aa6dd2515c8e51aee07fa2c54bddfb19d4427
Author: Florian Dold <florian.dold@gmail.com>
Date:   Mon, 25 Jan 2016 15:41:34 +0100

save contract information

Diffstat:
Msrc/frontend/checkout.php | 1-
Msrc/frontend/fulfillment.php | 6+++---
Msrc/frontend/generate_taler_contract.php | 11++++++++---
3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/frontend/checkout.php b/src/frontend/checkout.php @@ -56,7 +56,6 @@ // create PHP session and store donation information in session $donation_fraction = (float) ("0." . $donation_fraction); session_start(); - session_unset(); $_SESSION['receiver'] = $donation_receiver; $_SESSION['amount_value'] = (int) $donation_amount; $_SESSION['amount_fraction'] = (int) ($donation_fraction * 1000000); diff --git a/src/frontend/fulfillment.php b/src/frontend/fulfillment.php @@ -37,7 +37,9 @@ You should have received a copy of the GNU Lesser General Public License along with TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> -*/ + */ + +include '../frontend_lib/util.php'; function generate_msg ($link){ $msg = "<p>Thanks for donating to " . $_SESSION['receiver'] . ".</p>"; @@ -46,8 +48,6 @@ function generate_msg ($link){ return $msg; } - -include '../frontend_lib/util.php'; $hc = get($_GET["uuid"]); if (empty($hc)) diff --git a/src/frontend/generate_taler_contract.php b/src/frontend/generate_taler_contract.php @@ -15,7 +15,7 @@ TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> */ -include 'util.php'; +include '../frontend_lib/util.php'; session_start(); @@ -26,7 +26,6 @@ if (!isset($_SESSION['receiver'])) } $receiver = $_SESSION['receiver']; -$receiver = $_SESSION['receiver']; $amount_value = intval($_SESSION['amount_value']); $amount_fraction = intval($_SESSION['amount_fraction']); $currency = $_SESSION['currency']; @@ -143,7 +142,13 @@ if ($status_code != 200) else { $got_json = json_decode($resp->body->toString(), true); - $_SESSION['H_contract'] = $got_json["H_contract"]; + $hc = $got_json["H_contract"]; + $payments = get($_SESSION['payments'], array()); + $payments[$hc] = array( + 'receiver' => $receiver, + ); + $_SESSION['payments'] = $payments; + echo json_encode ($got_json, JSON_PRETTY_PRINT); } ?>