-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomerAccountStatementGetSingle.php
More file actions
66 lines (52 loc) · 1.93 KB
/
CustomerAccountStatementGetSingle.php
File metadata and controls
66 lines (52 loc) · 1.93 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?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");
$params = array(
"request" => array(
"ServiceCallerIdentity" => array(
"LoginId" => $config->username,
"Password" => $config->password,
"ServiceCallerId" => $config->callerId
)
)
);
// Get the UserID from CustomerSettings
$response = $soapClient->UserSettingsGetSingle($params);
printf("--------------------------\nWinstantPay WS Response\n--------------------------\n");
$userId = $response->UserSettingsGetSingleResult->UserSettings->UserId;
printf("User ID is %s\n",$userId);
$params = array(
"request" => array(
"ServiceCallerIdentity" => array(
"LoginId" => $config->username,
"Password" => $config->password,
"ServiceCallerId" => $config->callerId
),
"UserId" => $userId
)
);
// Get the AccountId from the balances
$response = $soapClient->CustomerAccountBalancesGet($params);
printf("--------------------------\nWinstantPay WS Response\n--------------------------\n");
// Let's in this example just take the first account to get a statement
// This is actually bad programming but for the sake of clarity there are no range checks here
$accountId = $response->CustomerAccountBalancesGetResult->Balances->CustomerBalanceData[0]->AccountId;
printf("Acount ID is %s\n",$accountId);
$params = array(
"request" => array(
"ServiceCallerIdentity" => array(
"LoginId" => $config->username,
"Password" => $config->password,
"ServiceCallerId" => $config->callerId
),
"AccountId" => $accountId,
"StartDate" => "2018-01-01",
"EndDate" => "2018-12-01"
)
);
// get the account statement
$response = $soapClient->CustomerAccountStatementGetSingle($params);
printf("--------------------------\nWinstantPay WS Response\n--------------------------\n");
var_dump($response);