Skip to content

Commit

Permalink
Amazon Pay API SDK PHP 2.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek Kumar committed Sep 11, 2024
1 parent 72fd366 commit bc4b846
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 160 deletions.
2 changes: 1 addition & 1 deletion Amazon/Pay/API/AccountManagementClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface AccountManagementClientInterface
* 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.
*
* @param payload - [String in JSON format] or [array]
* @param headers - [array] - requires x-amz-pay-Idempotency-Key header
* @param headers - [indexed array of string key-value pairs]
*/
public function createMerchantAccount($payload, $headers);

Expand Down
8 changes: 7 additions & 1 deletion Amazon/Pay/API/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

class Client implements ClientInterface, ReportingClientInterface, MerchantOnboardingClientInterface, AccountManagementClientInterface
{
const SDK_VERSION = '2.6.6';
const SDK_VERSION = '2.6.7';
const SDK_LANGUAGE = 'PHP';
const HASH_ALGORITHM = 'sha256';
const API_VERSION = 'v2';
const ACCOUNT_MANAGEMENT = '/merchantAccounts';
const CLAIM = '/claim';
const DISBURSEMENTS = '/disbursements';

private $config = array();

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

public function getDisbursements($queryParameters, $headers = null)
{
return $this->apiCall('GET', self::API_VERSION . self::DISBURSEMENTS, null, $headers, $queryParameters);
}

/*
* FinalizeCheckoutSession API which enables Pay to validate payment critical attributes and also update book-keeping attributes present in merchantMetadata
*/
Expand Down
5 changes: 5 additions & 0 deletions Amazon/Pay/API/HttpCurl.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class HttpCurl

private $curlResponseInfo = null;
private $requestId = null;
private $location = null;
private $proxyConfig;

/**
Expand All @@ -31,6 +32,9 @@ private function header_callback($ch, $header_line)
if ($key === 'x-amz-pay-request-id') {
$this->requestId = trim($middle[1]);
}
if ($key === 'location') {
$this->location = trim($middle[1]);
}
}
}

Expand Down Expand Up @@ -109,6 +113,7 @@ public function invokeCurl($method, $url, $payload, $postSignedHeaders)
$response = array(
'status' => $statusCode,
'method' => $method,
'location' => $this->location,
'url' => $url,
'headers' => $postSignedHeaders,
'request' => $payload,
Expand Down
10 changes: 9 additions & 1 deletion Amazon/Pay/API/ReportingClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ public function createReportSchedule($requestPayload, $headers = null);
* @optional headers - [array] - optional x-amz-pay-authtoken
*/
public function cancelReportSchedule($reportScheduleId, $headers = null);


/* Amazon Checkout v2 Reporting APIs - Get Disbursements
*
* The getDisbursements operation is used to receive disbursement details based on a date range of the settlement date specified in the request.
*
* @param queryParameters - [multi-dimension array with key and values]
* @optional headers - [array] - optional x-amz-pay-authtoken
*/
public function getDisbursements($queryParameters, $headers = null);

}
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Version 2.6.7 - September 2024
* Introducing the getDisbursements API.
* The `getDisbursements` API enables you to retrieve disbursement details based on a specified date range for settlement dates.

### Version 2.6.6 - July 2024
* Introducing new Account Management APIs that allow partners to programmatically onboard merchants onto the Amazon Pay.

Expand Down
Loading

0 comments on commit bc4b846

Please sign in to comment.