-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstantPaymentPost.php
More file actions
46 lines (40 loc) · 1.3 KB
/
InstantPaymentPost.php
File metadata and controls
46 lines (40 loc) · 1.3 KB
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
<?php
define('BASE_DIR', dirname(__FILE__));
$config = include(BASE_DIR . '/config.php');
//Create the soapClient object
$soapClient = new SoapClient("https://www.bizcurrency1.com/GPWebServiceBeta/IGPWebService1.svc?singleWsdl");
// Create a payment
$params = array(
"request" => array(
"ServiceCallerIdentity" => array(
"LoginId" => $config->username,
"Password" => $config->password,
"ServiceCallerId" => $config->callerId
),
"FromCustomer" => "RALF",
"ToCustomer" => "HERVE",
"Amount" => 10.000,
"CurrencyCode" => "THB",
"ValueDate" => "",
"ReasonForPayment" =>"",
"ExternalReference" => "",
"Memo" =>""
)
);
$response = $soapClient->InstantPaymentCreate($params);
$paymentId = $response->InstantPaymentCreateResult->PaymentInformation->PaymentId;
printf("Payment id is %s\n",$paymentId);
// Post (transact) the payment created above
$params = array(
"request" => array(
"ServiceCallerIdentity" => array(
"LoginId" => $config->username,
"Password" => $config->password,
"ServiceCallerId" => $config->callerId
),
"InstantPaymentId" => $paymentId
)
);
$response = $soapClient->InstantPaymentPost($params);
printf("--------------------------\nWinstantPay WS Response\n--------------------------\n");
var_dump($response);