Skip to content

Commit bc4b846

Browse files
author
Abhishek Kumar
committed
Amazon Pay API SDK PHP 2.6.7
1 parent 72fd366 commit bc4b846

7 files changed

Lines changed: 156 additions & 160 deletions

File tree

Amazon/Pay/API/AccountManagementClientInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface AccountManagementClientInterface
1313
* Provide merchant info through this API to create loginable account for your merchant partners. Client should expect either a success message or a detailed error message based on data validation and fulfillment.
1414
*
1515
* @param payload - [String in JSON format] or [array]
16-
* @param headers - [array] - requires x-amz-pay-Idempotency-Key header
16+
* @param headers - [indexed array of string key-value pairs]
1717
*/
1818
public function createMerchantAccount($payload, $headers);
1919

Amazon/Pay/API/Client.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111

1212
class Client implements ClientInterface, ReportingClientInterface, MerchantOnboardingClientInterface, AccountManagementClientInterface
1313
{
14-
const SDK_VERSION = '2.6.6';
14+
const SDK_VERSION = '2.6.7';
1515
const SDK_LANGUAGE = 'PHP';
1616
const HASH_ALGORITHM = 'sha256';
1717
const API_VERSION = 'v2';
1818
const ACCOUNT_MANAGEMENT = '/merchantAccounts';
1919
const CLAIM = '/claim';
20+
const DISBURSEMENTS = '/disbursements';
2021

2122
private $config = array();
2223

@@ -742,6 +743,11 @@ public function cancelReportSchedule($reportScheduleId, $headers = null)
742743
return $this->apiCall('DELETE', self::API_VERSION . '/report-schedules/' . $reportScheduleId, null, $headers);
743744
}
744745

746+
public function getDisbursements($queryParameters, $headers = null)
747+
{
748+
return $this->apiCall('GET', self::API_VERSION . self::DISBURSEMENTS, null, $headers, $queryParameters);
749+
}
750+
745751
/*
746752
* FinalizeCheckoutSession API which enables Pay to validate payment critical attributes and also update book-keeping attributes present in merchantMetadata
747753
*/

Amazon/Pay/API/HttpCurl.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class HttpCurl
1111

1212
private $curlResponseInfo = null;
1313
private $requestId = null;
14+
private $location = null;
1415
private $proxyConfig;
1516

1617
/**
@@ -31,6 +32,9 @@ private function header_callback($ch, $header_line)
3132
if ($key === 'x-amz-pay-request-id') {
3233
$this->requestId = trim($middle[1]);
3334
}
35+
if ($key === 'location') {
36+
$this->location = trim($middle[1]);
37+
}
3438
}
3539
}
3640

@@ -109,6 +113,7 @@ public function invokeCurl($method, $url, $payload, $postSignedHeaders)
109113
$response = array(
110114
'status' => $statusCode,
111115
'method' => $method,
116+
'location' => $this->location,
112117
'url' => $url,
113118
'headers' => $postSignedHeaders,
114119
'request' => $payload,

Amazon/Pay/API/ReportingClientInterface.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ public function createReportSchedule($requestPayload, $headers = null);
8787
* @optional headers - [array] - optional x-amz-pay-authtoken
8888
*/
8989
public function cancelReportSchedule($reportScheduleId, $headers = null);
90-
90+
91+
/* Amazon Checkout v2 Reporting APIs - Get Disbursements
92+
*
93+
* The getDisbursements operation is used to receive disbursement details based on a date range of the settlement date specified in the request.
94+
*
95+
* @param queryParameters - [multi-dimension array with key and values]
96+
* @optional headers - [array] - optional x-amz-pay-authtoken
97+
*/
98+
public function getDisbursements($queryParameters, $headers = null);
9199

92100
}

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### Version 2.6.7 - September 2024
2+
* Introducing the getDisbursements API.
3+
* The `getDisbursements` API enables you to retrieve disbursement details based on a specified date range for settlement dates.
4+
15
### Version 2.6.6 - July 2024
26
* Introducing new Account Management APIs that allow partners to programmatically onboard merchants onto the Amazon Pay.
37

0 commit comments

Comments
 (0)