-
Notifications
You must be signed in to change notification settings - Fork 1
/
paymentOnDeliveryPaymentRequest.php
35 lines (26 loc) · 1.28 KB
/
paymentOnDeliveryPaymentRequest.php
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
30
31
32
33
34
35
<?php
/*This file generates the payment request and sends it to the Sips server.
For more information on this use case, please refer to the following documentation:
https://documentation.sips.worldline.com/en/WLSIPS.004-GD-Functionality-set-up-guide.html#Payment-upon-shipping */
session_start();
include('Common/paymentRequest.php');
//PAYMENT REQUEST
//You can change the values in session according to your needs and architecture
$_SESSION['secretKey'] = "002001000000002_KEY1";
$_SESSION['sealAlgorithm'] = "HMAC-SHA-256";
$_SESSION['normalReturnUrl'] = "http://localhost/sips-paypage-json-php/Common/paymentResponse.php";
$_SESSION["urlForPaymentInitialisation"] = "https://payment-webinit.simu.sips-services.com/rs-services/v2/paymentInit/";
$requestData = array(
"normalReturnUrl" => $_SESSION['normalReturnUrl'],
"merchantId" => "002001000000002",
"transactionReference" => "",
"amount" => "2000", //Note that the amount entered in the "amount" field is in cents
"orderChannel" => "INTERNET",
"currencyCode" => "978",
"interfaceVersion" => "IR_WS_2.20",
"captureMode" => "VALIDATION",
"captureDay" => "3",
);
$requestTable = generate_the_payment_request($requestData);
send_payment_request($requestTable, $_SESSION["urlForPaymentInitialisation"]);
?>