amazon-pay-api-sdk-ruby 1.2.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: 428da5a80e49d6cf400205eea58757174f259abce2bb6cc7a83aecd0c1554f5f
4
- data.tar.gz: b809960b865a226d7796e506d1712759c0db90119cd886942b5aa9d6ed125681
3
+ metadata.gz: ec55f9f54ca4cd12db49f81319d1315c7f45a6cf523ae924bb2596665395f839
4
+ data.tar.gz: c3b68bae12b5784f0535fe51f5b8e1d09a31c52eb3e5d8eb5b78b443b534a975
5
5
  SHA512:
6
- metadata.gz: 70c5fb962cf91183aca482ad024752e41a11e398cc666bc87aae026cfbef0efa813b0e36d3b5352f184638efe633f6811927db2a29607b115e59fb1af05836a4
7
- data.tar.gz: 4f62e310db2e153b5c3110a36498e66a81f0f99d9bed70de7c8722feb1c076392b510233df447f37663e23634a5d567b118806beadc01749947de3817efda2df
6
+ metadata.gz: 46934a830919a7de8bd646a11f34dbd61dd68a808a50816cb4d976c628104cb1c25376480686324d751bc4bd465d65cd3a3b0b888e1db73c9d2df70446ef1a7b
7
+ data.tar.gz: f8ac26c439661578e5fc8356922d8c30fdc80ec470f9a2bd013d91c2a55ac2f6819db2ace82ed9128e2d9aba92248908eb1e8e7fec1dc15624b53941c083fc11
data/README.md CHANGED
@@ -5,7 +5,7 @@ This guide provides step-by-step instructions on how to use the Amazon Pay Clien
5
5
 
6
6
  ### Prerequisites
7
7
 
8
- - Ruby installed on your system.
8
+ - Ruby (version 2.7.0 or later) installed on your system.
9
9
  - `amazon-pay-api-sdk-ruby` gem installed or this source code has been imported in your project.
10
10
  - Your `publicKeyId` & `privateKey.pem` file available.
11
11
 
@@ -22,6 +22,8 @@ gem 'amazon-pay-api-sdk-ruby'
22
22
  bundle install
23
23
  ```
24
24
 
25
+ **Notice:** Those who may upgrade from 1.x.x to 2.0.0 or higher: You must change the require statement from: `require './lib/amazon_pay'` to `require './lib/amazon-pay-api-sdk-ruby'` or `require 'amazon_pay'` to `require 'amazon-pay-api-sdk-ruby'`
26
+
25
27
  ### Configuration
26
28
 
27
29
  Create a configuration with your Amazon Pay credentials and region:
@@ -47,7 +49,7 @@ client = AmazonPayClient.new(config)
47
49
  Define the payload and headers for the `create_merchant_account` API call:
48
50
 
49
51
  ```ruby
50
- require './lib/amazon_pay'
52
+ require 'amazon-pay-api-sdk-ruby'
51
53
 
52
54
  client = AmazonPayClient.new(config)
53
55
 
@@ -509,6 +511,32 @@ else
509
511
  end
510
512
  ```
511
513
 
514
+ ### Update Charge
515
+ **Please note that is API is supported only for PSPs (Payment Service Provider)**
516
+
517
+ ```ruby
518
+ def payload = {
519
+ "statusDetails": {
520
+ "state": "Canceled",
521
+ "reasonCode": "ExpiredUnused"
522
+ }
523
+ }
524
+
525
+ def headers = {
526
+ "x-amz-pay-Idempotency-Key": SecureRandom.uuid
527
+ }
528
+
529
+ response = client.update_charge("S03-XXXXXX-XXXXXX-XXXXXX", payload, headers: headers)
530
+ if response.code.to_i == 200
531
+ puts "Update Charge API Response:"
532
+ puts response.body
533
+ else
534
+ puts "Error: Update Charge API"
535
+ puts "Status: #{response.code}"
536
+ puts response.body
537
+ end
538
+ ```
539
+
512
540
  ### Capture Charge
513
541
 
514
542
  ```ruby
@@ -744,4 +772,139 @@ else
744
772
  puts "Status: #{response.code}"
745
773
  puts response.body
746
774
  end
775
+ ```
776
+
777
+ ### Create Dispute API
778
+ #### NOTE: This API is intended to be called only by PSPs (Payment Service Providers).
779
+
780
+ ```ruby
781
+ creation_timestamp = Time.now.to_i
782
+ merchant_response_deadline = creation_timestamp + (14 * 24 * 60 * 60) # Adding 14 days
783
+
784
+ payload = {
785
+ "chargeId": "S03-XXXXXX-XXXXXX-XXXXXX",
786
+ "providerMetadata": {
787
+ "providerDisputeId": "AXXXXXXXXXX"
788
+ },
789
+ "disputeAmount": {
790
+ "amount": "1",
791
+ "currencyCode": "JPY"
792
+ },
793
+ "filingReason": Constants::DISPUTE_FILING_REASON[:PRODUCT_NOT_RECEIVED],
794
+ "creationTimestamp": creation_timestamp,
795
+ "statusDetails": {
796
+ "state": "ActionRequired"
797
+ },
798
+ "merchantResponseDeadline": merchant_response_deadline
799
+ }
800
+
801
+ def headers = {
802
+ "x-amz-pay-Idempotency-Key": SecureRandom.uuid
803
+ }
804
+
805
+ response = client.create_dispute(payload, headers: headers)
806
+ if response.code.to_i == 200
807
+ puts "Create Dispute API Response:"
808
+ puts response.body
809
+ else
810
+ puts "Error: Create Dispute API"
811
+ puts "Status: #{response.code}"
812
+ puts response.body
813
+ end
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
+
829
+ ### Update Dispute API
830
+
831
+ ```ruby
832
+ current_timestamp = Time.now.to_i
833
+ dispute_id = "S03-XXXXXX-XXXXXX-XXXXXX"
834
+
835
+ payload = {
836
+ "statusDetails": {
837
+ "resolution": Constants::DISPUTE_RESOLUTION[:MERCHANT_WON],
838
+ "state": Constants::DISPUTE_STATE[:RESOLVED],
839
+ "reasonCode": Constants::DISPUTE_REASON_CODE[:MERCHANT_ACCEPTED_DISPUTE],
840
+ "reasonDescription": "Merchant accepted the dispute request"
841
+ },
842
+ "closureTimestamp": current_timestamp
843
+ }
844
+
845
+ def headers = {
846
+ "x-amz-pay-Idempotency-Key": SecureRandom.uuid
847
+ }
848
+
849
+ response = client.update_dispute(dispute_id, payload, headers: {})
850
+ if response.code.to_i == 200
851
+ puts "Update Dispute API Response:"
852
+ puts response.body
853
+ else
854
+ puts "Error: Update Dispute API"
855
+ puts "Status: #{response.code}"
856
+ puts response.body
857
+ end
858
+ ```
859
+
860
+ ### Contest Dispute API
861
+
862
+ ```ruby
863
+ current_timestamp = Time.now.to_i
864
+ dispute_id = "S03-XXXXXX-XXXXXX-XXXXXX"
865
+
866
+ payload = {
867
+ "merchantEvidences": [
868
+ "evidenceType": "TrackingNumber",
869
+ "fileId": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxx",
870
+ "evidenceText": "raw text supporting merchant evidence"
871
+ ]
872
+ }
873
+
874
+ def headers = {
875
+ "x-amz-pay-Idempotency-Key": SecureRandom.uuid
876
+ }
877
+
878
+ response = client.contest_dispute(dispute_id, payload, headers: {})
879
+ if response.code.to_i == 200
880
+ puts "Contest Dispute API Response:"
881
+ puts response.body
882
+ else
883
+ puts "Error: Contest Dispute API"
884
+ puts "Status: #{response.code}"
885
+ puts response.body
886
+ end
887
+ ```
888
+
889
+ ### File Upload API
890
+
891
+ ```ruby
892
+ payload = {
893
+ "type": "jpg",
894
+ "purpose": "disputeEvidence"
895
+ }
896
+
897
+ def headers = {
898
+ "x-amz-pay-Idempotency-Key": SecureRandom.uuid
899
+ }
900
+
901
+ response = client.upload_file(payload, headers: headers)
902
+ if response.code.to_i == 200
903
+ puts "Upload File API Response:"
904
+ puts response.body
905
+ else
906
+ puts "Error: Upload File API"
907
+ puts "Status: #{response.code}"
908
+ puts response.body
909
+ end
747
910
  ```
@@ -1,9 +1,10 @@
1
1
  require 'net/http'
2
2
  require_relative 'client_helper'
3
3
  require_relative 'constants'
4
+ require_relative 'payment_service_provider_client'
4
5
 
5
6
  # AmazonPayClient class provides methods to interact with Amazon Pay API
6
- class AmazonPayClient
7
+ class AmazonPayClient include PaymentServiceProviderClient
7
8
 
8
9
  # Initialize the client with configuration settings
9
10
  def initialize(config)
@@ -223,6 +224,18 @@ class AmazonPayClient
223
224
  api_call("#{Constants::CHARGES_URL}/#{charge_id}", Constants::GET, headers: headers)
224
225
  end
225
226
 
227
+ # API to retrieve charge details.
228
+ # The updateCharge operation is used to update the charge status of any PSP (Payment Service Provider) processed payment method (PPM) transactions.
229
+ # Please note that is API is supported only for PSPs (Payment Service Provider)
230
+ # @see https://developer.amazon.com/docs/amazon-pay-apis/charge.html#update-charge
231
+ # @param {String} charge_id - The unique ID of the charge to update.
232
+ # @param {Object} payload - The payload containing statusDetails.
233
+ # @param {Object} headers - Optional headers for the request, such as x-amz-pay-idempotency-key, authorization tokens or custom headers.
234
+ # @return [HTTPResponse] The response from the API call, which includes details of the requested charge.
235
+ def update_charge(charge_id, payload, headers: {})
236
+ api_call("#{Constants::CHARGES_URL}/#{charge_id}", Constants::PATCH, payload: payload, headers: headers)
237
+ end
238
+
226
239
  # API to capture a charge
227
240
  # Captures an authorized charge to collect the funds.
228
241
  # @see https://developer.amazon.com/docs/amazon-pay-api-v2/charge.html#capture-charge
@@ -0,0 +1,101 @@
1
+ require 'net/http'
2
+
3
+ module Constants
4
+ SDK_TYPE = "amazon-pay-api-sdk-ruby".freeze
5
+ SDK_VERSION = "2.1.0".freeze
6
+ API_VERSION = "v2".freeze
7
+ API_ENDPOINTS = {
8
+ 'na' => 'pay-api.amazon.com',
9
+ 'eu' => 'pay-api.amazon.eu',
10
+ 'jp' => 'pay-api.amazon.jp'
11
+ }.freeze
12
+ METHOD_TYPES = {
13
+ 'GET' => Net::HTTP::Get,
14
+ 'POST' => Net::HTTP::Post,
15
+ 'PUT' => Net::HTTP::Put,
16
+ 'PATCH' => Net::HTTP::Patch,
17
+ 'DELETE' => Net::HTTP::Delete
18
+ }.freeze
19
+ HASH_ALGORITHM = "SHA256".freeze
20
+ HTTPS = 'https'.freeze
21
+ AMAZON_SIGNATURE_ALGORITHM = "AMZN-PAY-RSASSA-PSS-V2".freeze
22
+ AUTHORIZATION = 'authorization'.freeze
23
+ ACCEPT = 'accept'.freeze
24
+ CONTENT_TYPE = 'content-type'.freeze
25
+ APPLICATION_JSON = 'application/json'.freeze
26
+ X_AMZ_PAY_REGION = 'x-amz-pay-region'.freeze
27
+ X_AMZ_PAY_DATE = 'x-amz-pay-date'.freeze
28
+ X_AMZ_PAY_HOST = 'x-amz-pay-host'.freeze
29
+ CONTENT_LENGTH = 'content-length'.freeze
30
+ X_AMZ_PAY_SDK_TYPE = 'x-amz-pay-sdk-type'.freeze
31
+ X_AMZ_PAY_SDK_VERSION = 'x-amz-pay-sdk-version'.freeze
32
+ LIVE = 'LIVE-'
33
+ SANDBOX = 'SANDBOX-'
34
+ MERCHANT_ACCOUNTS_BASE_URL = 'merchantAccounts'.freeze
35
+ GET = 'GET'.freeze
36
+ POST = 'POST'.freeze
37
+ PATCH = 'PATCH'.freeze
38
+ DELETE = 'DELETE'.freeze
39
+ MAX_RETRIES = 3.freeze
40
+ BACKOFF_TIMES = [1, 2, 4].freeze # Define backoff times for retries
41
+ RETRYABLE_ERROR_CODES = [408, 425, 429, 500, 502, 503, 504].freeze
42
+ HTTP_OK = '200'
43
+ HTTP_SERVER_ERROR = '500'
44
+ BUYERS_URL = 'buyers'.freeze
45
+ CHECKOUT_SESSION_URL = 'checkoutSessions'.freeze
46
+ CHARGE_PERMISSIONS_URL = 'chargePermissions'.freeze
47
+ CHARGES_URL = 'charges'.freeze
48
+ REFUNDS_URL = 'refunds'.freeze
49
+ REPORTS = 'reports'.freeze
50
+ REPORT_SCHEDULES = 'report-schedules'.freeze
51
+ REPORT_DOCUMENTS = 'report-documents'.freeze
52
+ DISBURSEMENTS = 'disbursements'.freeze
53
+ DISPUTE_URLS = 'disputes'.freeze
54
+ FILES_URLS = 'files'.freeze
55
+ DISPUTE_FILING_REASON = {
56
+ PRODUCT_NOT_RECEIVED: "ProductNotReceived",
57
+ PRODUCT_UNACCEPTABLE: "ProductUnacceptable",
58
+ PRODUCT_NO_LONGER_NEEDED: "ProductNoLongerNeeded",
59
+ CREDIT_NOT_PROCESSED: "CreditNotProcessed",
60
+ OVERCHARGED: "Overcharged",
61
+ DUPLICATE_CHARGE: "DuplicateCharge",
62
+ SUBSCRIPTION_CANCELLED: "SubscriptionCancelled",
63
+ UNRECOGNIZED: "Unrecognized",
64
+ FRAUDULENT: "Fraudulent",
65
+ OTHER: "Other"
66
+ }.freeze
67
+ DISPUTE_REASON_CODE = {
68
+ MERCHANT_RESPONSE_REQUIRED: "MerchantResponseRequired",
69
+ MERCHANT_ADDITIONAL_EVIDENCES_REQUIRED: "MerchantAdditionalEvidencesRequired",
70
+ BUYER_ADDITIONAL_EVIDENCES_REQUIRED: "BuyerAdditionalEvidencesRequired",
71
+ MERCHANT_ACCEPTED_DISPUTE: "MerchantAcceptedDispute",
72
+ MERCHANT_RESPONSE_DEADLINE_EXPIRED: "MerchantResponseDeadlineExpired",
73
+ BUYER_CANCELLED: "BuyerCancelled",
74
+ INVESTIGATOR_RESOLVED: "InvestigatorResolved",
75
+ AUTO_RESOLVED: "AutoResolved",
76
+ CHARGEBACK_FILED: "ChargebackFiled"
77
+ }.freeze
78
+ DISPUTE_RESOLUTION = {
79
+ BUYER_WON: "BuyerWon",
80
+ MERCHANT_WON: "MerchantWon",
81
+ NO_FAULT: "NoFault"
82
+ }.freeze
83
+ DISPUTE_STATE = {
84
+ UNDER_REVIEW: "UnderReview",
85
+ ACTION_REQUIRED: "ActionRequired",
86
+ RESOLVED: "Resolved",
87
+ CLOSED: "Closed"
88
+ }.freeze
89
+ EVIDENCE_TYPE = {
90
+ PRODUCT_DESCRIPTION: "ProductDescription",
91
+ RECEIPT: "Receipt",
92
+ CANCELLATION_POLICY: "CancellationPolicy",
93
+ CUSTOMER_SIGNATURE: "CustomerSignature",
94
+ TRACKING_NUMBER: "TrackingNumber",
95
+ CARRIER_NAME: "CarrierName",
96
+ DEVICE_ID: "DeviceId",
97
+ DEVICE_NAME: "DeviceName",
98
+ DOWNLOAD_DATE_TIME: "DownloadDateTime",
99
+ OTHER: "Other"
100
+ }.freeze
101
+ end
@@ -0,0 +1,53 @@
1
+ module PaymentServiceProviderClient
2
+ # API to create dispute.
3
+ # The createDispute operation is used to notify Amazon of a newly created chargeback dispute by a buyer on a
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
+ # @param {Object} payload - The payload containing statusDetails.
7
+ # @param {Object} headers - Requires : x-amz-pay-idempotency-key, Optional headers for the request, such as authorization tokens or custom headers.
8
+ # @return [HTTPResponse] The response from the API call, which includes details of the dispute.
9
+ def create_dispute(payload, headers: {});
10
+ api_call(Constants::DISPUTE_URLS, Constants::POST, payload: payload, headers: headers)
11
+ end
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
+
21
+ # API to update dispute.
22
+ # The updateDispute operation is used to notify Amazon of the closure status of a chargeback dispute initiated by a
23
+ # buyer for orders, ensuring proper accounting within the Amazon systems.
24
+ # @param {String} dispute_id - The unique ID of the dispute to retrieve.
25
+ # @param {Object} payload - The payload containing statusDetails.
26
+ # @param {Object} headers - Optional headers for the request, such as x-amz-pay-idempotency-key, authorization tokens or custom headers.
27
+ # @return [HTTPResponse] The response from the API call, which includes details of the dispute.
28
+ def update_dispute(dispute_id, payload, headers: {});
29
+ api_call("#{Constants::DISPUTE_URLS}/#{dispute_id}", Constants::PATCH, payload: payload, headers: headers)
30
+ end
31
+
32
+ # API to contest dispute.
33
+ # The contestDispute operation is used by the partner, on behalf of the merchant, to formally contest a dispute
34
+ # managed by Amazon, requiring the submission of necessary evidence files within the specified
35
+ # Dispute Window (11 days for Chargeback, 7 days for A-Z Claims).
36
+ # @param {String} dispute_id - The unique ID of the dispute to retrieve.
37
+ # @param {Object} payload - The payload containing statusDetails.
38
+ # @param {Object} headers - Optional headers for the request, such as x-amz-pay-idempotency-key, authorization tokens or custom headers.
39
+ # @return [HTTPResponse] The response from the API call, which includes details of the dispute.
40
+ def contest_dispute(dispute_id, payload, headers: {});
41
+ api_call("#{Constants::DISPUTE_URLS}/#{dispute_id}/contest", Constants::POST, payload: payload, headers: headers)
42
+ end
43
+
44
+ # API to upload file.
45
+ # The uploadFile operation is utilised to upload file-based evidence when a
46
+ # merchant contests a dispute, providing the necessary reference ID to the evidence file as part of
47
+ # the Update Dispute API process.
48
+ # @param {Object} headers - Requires : x-amz-pay-idempotency-key, Optional headers for the request, such as authorization tokens or custom headers.
49
+ # @return [HTTPResponse] The response from the API call, which includes details of the file.
50
+ def upload_file(payload, headers: {});
51
+ api_call(Constants::FILES_URLS, Constants::POST, payload: payload, headers: headers)
52
+ end
53
+ end
@@ -0,0 +1,3 @@
1
+ require_relative './amazon-pay-api-sdk-ruby/client'
2
+ require_relative './amazon-pay-api-sdk-ruby/client_helper'
3
+ require_relative "./amazon-pay-api-sdk-ruby/constants"
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: 1.2.0
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: 2024-09-06 00:00:00.000000000 Z
11
+ date: 2025-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -31,7 +31,7 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.0'
34
- type: :runtime
34
+ type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
@@ -46,10 +46,11 @@ extra_rdoc_files: []
46
46
  files:
47
47
  - LICENSE
48
48
  - README.md
49
- - lib/amazon_pay.rb
50
- - lib/amazon_pay/client.rb
51
- - lib/amazon_pay/client_helper.rb
52
- - lib/amazon_pay/constants.rb
49
+ - lib/amazon-pay-api-sdk-ruby.rb
50
+ - lib/amazon-pay-api-sdk-ruby/client.rb
51
+ - lib/amazon-pay-api-sdk-ruby/client_helper.rb
52
+ - lib/amazon-pay-api-sdk-ruby/constants.rb
53
+ - lib/amazon-pay-api-sdk-ruby/payment_service_provider_client.rb
53
54
  homepage: https://rubygems.org/gems/amazon-pay-api-sdk-ruby
54
55
  licenses:
55
56
  - Apache-2.0
@@ -1,53 +0,0 @@
1
- require 'net/http'
2
-
3
- module Constants
4
- SDK_TYPE = "amazon-pay-api-sdk-ruby".freeze
5
- SDK_VERSION = "1.2.0".freeze
6
- API_VERSION = "v2".freeze
7
- API_ENDPOINTS = {
8
- 'na' => 'pay-api.amazon.com',
9
- 'eu' => 'pay-api.amazon.eu',
10
- 'jp' => 'pay-api.amazon.jp'
11
- }.freeze
12
- METHOD_TYPES = {
13
- 'GET' => Net::HTTP::Get,
14
- 'POST' => Net::HTTP::Post,
15
- 'PUT' => Net::HTTP::Put,
16
- 'PATCH' => Net::HTTP::Patch,
17
- 'DELETE' => Net::HTTP::Delete
18
- }.freeze
19
- HASH_ALGORITHM = "SHA256".freeze
20
- HTTPS = 'https'.freeze
21
- AMAZON_SIGNATURE_ALGORITHM = "AMZN-PAY-RSASSA-PSS-V2".freeze
22
- AUTHORIZATION = 'authorization'.freeze
23
- ACCEPT = 'accept'.freeze
24
- CONTENT_TYPE = 'content-type'.freeze
25
- APPLICATION_JSON = 'application/json'.freeze
26
- X_AMZ_PAY_REGION = 'x-amz-pay-region'.freeze
27
- X_AMZ_PAY_DATE = 'x-amz-pay-date'.freeze
28
- X_AMZ_PAY_HOST = 'x-amz-pay-host'.freeze
29
- CONTENT_LENGTH = 'content-length'.freeze
30
- X_AMZ_PAY_SDK_TYPE = 'x-amz-pay-sdk-type'.freeze
31
- X_AMZ_PAY_SDK_VERSION = 'x-amz-pay-sdk-version'.freeze
32
- LIVE = 'LIVE-'
33
- SANDBOX = 'SANDBOX-'
34
- MERCHANT_ACCOUNTS_BASE_URL = 'merchantAccounts'.freeze
35
- GET = 'GET'.freeze
36
- POST = 'POST'.freeze
37
- PATCH = 'PATCH'.freeze
38
- DELETE = 'DELETE'.freeze
39
- MAX_RETRIES = 3.freeze
40
- BACKOFF_TIMES = [1, 2, 4].freeze # Define backoff times for retries
41
- RETRYABLE_ERROR_CODES = [408, 429, 500, 502, 503, 504].freeze
42
- HTTP_OK = '200'
43
- HTTP_SERVER_ERROR = '500'
44
- BUYERS_URL = 'buyers'.freeze
45
- CHECKOUT_SESSION_URL = 'checkoutSessions'.freeze
46
- CHARGE_PERMISSIONS_URL = 'chargePermissions'.freeze
47
- CHARGES_URL = 'charges'.freeze
48
- REFUNDS_URL = 'refunds'.freeze
49
- REPORTS = 'reports'.freeze
50
- REPORT_SCHEDULES = 'report-schedules'.freeze
51
- REPORT_DOCUMENTS = 'report-documents'.freeze
52
- DISBURSEMENTS = 'disbursements'.freeze
53
- end
data/lib/amazon_pay.rb DELETED
@@ -1,3 +0,0 @@
1
- require_relative './amazon_pay/client'
2
- require_relative './amazon_pay/client_helper'
3
- require_relative "./amazon_pay/constants"