-
Notifications
You must be signed in to change notification settings - Fork 1
/
frictionlessPaymentRequest.php
50 lines (41 loc) · 1.75 KB
/
frictionlessPaymentRequest.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?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.344-UG-3-D-Secure.html */
session_start();
include('Common/paymentRequest.php');
//PAYMENT REQUEST
//You can change the values in session according to your needs and architecture
$_SESSION['secretKey'] = "p64ifeYBVIaRcjaWoahCiw9L8wokNLqG2_YOj_POD4g";
$_SESSION['sealAlgorithm'] = "HMAC-SHA-256";
$_SESSION['normalReturnUrl'] = "http://localhost/sips-paypage-json-php/Common/paymentResponse.php";
$_SESSION["urlForPaymentInitialisation"] = "https://payment-webinit.test.sips-services.com/rs-services/v2/paymentInit";
$requestData = array(
"normalReturnUrl" => $_SESSION['normalReturnUrl'],
"merchantId" => "201000076690001",
"transactionReference" => "r735",
"amount" => "2000", //Note that the amount entered in the "amount" field is in cents
"orderChannel" => "INTERNET",
"currencyCode" => "978",
"interfaceVersion" => "IR_WS_2.20",
"billingAddress" => array(
"city" => "Nantes",
"country" => "FRA",
"addressAdditional1" => "route de l'atlantique, 5990",
"addressAdditional2" => "rue Pompidou, 8900",
"addressAdditional3" => "avenue Jean Jaures, 4900",
"zipCode" => "44000",
"state" => "France",
),
"holderContact" => array(
"lastname" => "Doe",
"email" => "jane.doe@example.org",
),
"fraudData" => array(
"merchantCustomerAuthentMethod" => "NOAUTHENT",
"challengeMode3DS" => "NO_CHALLENGE",
),
);
$requestTable = generate_the_payment_request($requestData);
send_payment_request($requestTable, $_SESSION["urlForPaymentInitialisation"]);
?>