amazon-pay-api-sdk-ruby 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec55f9f54ca4cd12db49f81319d1315c7f45a6cf523ae924bb2596665395f839
|
4
|
+
data.tar.gz: c3b68bae12b5784f0535fe51f5b8e1d09a31c52eb3e5d8eb5b78b443b534a975
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46934a830919a7de8bd646a11f34dbd61dd68a808a50816cb4d976c628104cb1c25376480686324d751bc4bd465d65cd3a3b0b888e1db73c9d2df70446ef1a7b
|
7
|
+
data.tar.gz: f8ac26c439661578e5fc8356922d8c30fdc80ec470f9a2bd013d91c2a55ac2f6819db2ace82ed9128e2d9aba92248908eb1e8e7fec1dc15624b53941c083fc11
|
data/README.md
CHANGED
@@ -775,6 +775,7 @@ end
|
|
775
775
|
```
|
776
776
|
|
777
777
|
### Create Dispute API
|
778
|
+
#### NOTE: This API is intended to be called only by PSPs (Payment Service Providers).
|
778
779
|
|
779
780
|
```ruby
|
780
781
|
creation_timestamp = Time.now.to_i
|
@@ -812,6 +813,19 @@ else
|
|
812
813
|
end
|
813
814
|
```
|
814
815
|
|
816
|
+
### Get Dispute API
|
817
|
+
```ruby
|
818
|
+
response = client.get_dispute('S03-XXXXXX-XXXXXX-XXXXXX')
|
819
|
+
if response.code.to_i == 200
|
820
|
+
puts "Get Dispute API Response:"
|
821
|
+
puts response.body
|
822
|
+
else
|
823
|
+
puts "Error: Get Dispute API"
|
824
|
+
puts "Status: #{response.code}"
|
825
|
+
puts response.body
|
826
|
+
end
|
827
|
+
```
|
828
|
+
|
815
829
|
### Update Dispute API
|
816
830
|
|
817
831
|
```ruby
|
@@ -2,7 +2,7 @@ require 'net/http'
|
|
2
2
|
|
3
3
|
module Constants
|
4
4
|
SDK_TYPE = "amazon-pay-api-sdk-ruby".freeze
|
5
|
-
SDK_VERSION = "2.
|
5
|
+
SDK_VERSION = "2.1.0".freeze
|
6
6
|
API_VERSION = "v2".freeze
|
7
7
|
API_ENDPOINTS = {
|
8
8
|
'na' => 'pay-api.amazon.com',
|
@@ -38,7 +38,7 @@ module Constants
|
|
38
38
|
DELETE = 'DELETE'.freeze
|
39
39
|
MAX_RETRIES = 3.freeze
|
40
40
|
BACKOFF_TIMES = [1, 2, 4].freeze # Define backoff times for retries
|
41
|
-
RETRYABLE_ERROR_CODES = [408, 429, 500, 502, 503, 504].freeze
|
41
|
+
RETRYABLE_ERROR_CODES = [408, 425, 429, 500, 502, 503, 504].freeze
|
42
42
|
HTTP_OK = '200'
|
43
43
|
HTTP_SERVER_ERROR = '500'
|
44
44
|
BUYERS_URL = 'buyers'.freeze
|
@@ -92,6 +92,10 @@ module Constants
|
|
92
92
|
CANCELLATION_POLICY: "CancellationPolicy",
|
93
93
|
CUSTOMER_SIGNATURE: "CustomerSignature",
|
94
94
|
TRACKING_NUMBER: "TrackingNumber",
|
95
|
+
CARRIER_NAME: "CarrierName",
|
96
|
+
DEVICE_ID: "DeviceId",
|
97
|
+
DEVICE_NAME: "DeviceName",
|
98
|
+
DOWNLOAD_DATE_TIME: "DownloadDateTime",
|
95
99
|
OTHER: "Other"
|
96
100
|
}.freeze
|
97
101
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module PaymentServiceProviderClient
|
2
2
|
# API to create dispute.
|
3
3
|
# The createDispute operation is used to notify Amazon of a newly created chargeback dispute by a buyer on a
|
4
|
-
# transaction processed by the PSP (Payment Service Provider), ensuring the dispute is properly accounted for in the Amazon Pay systems.
|
5
|
-
#
|
4
|
+
# transaction processed only by the PSP (Payment Service Provider), ensuring the dispute is properly accounted for in the Amazon Pay systems.
|
5
|
+
# NOTE: This API is intended to be called only by PSPs (Payment Service Providers).
|
6
6
|
# @param {Object} payload - The payload containing statusDetails.
|
7
7
|
# @param {Object} headers - Requires : x-amz-pay-idempotency-key, Optional headers for the request, such as authorization tokens or custom headers.
|
8
8
|
# @return [HTTPResponse] The response from the API call, which includes details of the dispute.
|
@@ -10,10 +10,17 @@ module PaymentServiceProviderClient
|
|
10
10
|
api_call(Constants::DISPUTE_URLS, Constants::POST, payload: payload, headers: headers)
|
11
11
|
end
|
12
12
|
|
13
|
+
# API to get dispute.
|
14
|
+
# The getDispute operation is used to retrieve details of a chargeback dispute associated with a specific order
|
15
|
+
# @param {Object} headers - Optional headers for the request, such as x-amz-pay-idempotency-key, authorization tokens or custom headers.
|
16
|
+
# @return [HTTPResponse] The response from the API call, which includes details of the dispute.
|
17
|
+
def get_dispute(dispute_id, headers: {});
|
18
|
+
api_call("#{Constants::DISPUTE_URLS}/#{dispute_id}", Constants::GET, headers: headers)
|
19
|
+
end
|
20
|
+
|
13
21
|
# API to update dispute.
|
14
22
|
# The updateDispute operation is used to notify Amazon of the closure status of a chargeback dispute initiated by a
|
15
|
-
# buyer for orders
|
16
|
-
# @see https://developer.amazon.com/docs/amazon-pay-apis/dispute.html/#update-dispute
|
23
|
+
# buyer for orders, ensuring proper accounting within the Amazon systems.
|
17
24
|
# @param {String} dispute_id - The unique ID of the dispute to retrieve.
|
18
25
|
# @param {Object} payload - The payload containing statusDetails.
|
19
26
|
# @param {Object} headers - Optional headers for the request, such as x-amz-pay-idempotency-key, authorization tokens or custom headers.
|
@@ -26,7 +33,6 @@ module PaymentServiceProviderClient
|
|
26
33
|
# The contestDispute operation is used by the partner, on behalf of the merchant, to formally contest a dispute
|
27
34
|
# managed by Amazon, requiring the submission of necessary evidence files within the specified
|
28
35
|
# Dispute Window (11 days for Chargeback, 7 days for A-Z Claims).
|
29
|
-
# @see https://developer.amazon.com/docs/amazon-pay-apis/dispute.html/#contest-dispute
|
30
36
|
# @param {String} dispute_id - The unique ID of the dispute to retrieve.
|
31
37
|
# @param {Object} payload - The payload containing statusDetails.
|
32
38
|
# @param {Object} headers - Optional headers for the request, such as x-amz-pay-idempotency-key, authorization tokens or custom headers.
|
@@ -36,10 +42,9 @@ module PaymentServiceProviderClient
|
|
36
42
|
end
|
37
43
|
|
38
44
|
# API to upload file.
|
39
|
-
# The uploadFile operation is utilised
|
45
|
+
# The uploadFile operation is utilised to upload file-based evidence when a
|
40
46
|
# merchant contests a dispute, providing the necessary reference ID to the evidence file as part of
|
41
47
|
# the Update Dispute API process.
|
42
|
-
# @see https://developer.amazon.com/docs/amazon-pay-apis/file.html#upload-a-file
|
43
48
|
# @param {Object} headers - Requires : x-amz-pay-idempotency-key, Optional headers for the request, such as authorization tokens or custom headers.
|
44
49
|
# @return [HTTPResponse] The response from the API call, which includes details of the file.
|
45
50
|
def upload_file(payload, headers: {});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazon-pay-api-sdk-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AmazonPay
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|