amazon-pay-api-sdk-ruby 2.1.0 → 2.2.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: ec55f9f54ca4cd12db49f81319d1315c7f45a6cf523ae924bb2596665395f839
4
- data.tar.gz: c3b68bae12b5784f0535fe51f5b8e1d09a31c52eb3e5d8eb5b78b443b534a975
3
+ metadata.gz: 176034301db14de72484334e1952fbb1e7988eb9affc0a9cdeb881eb1ec195a2
4
+ data.tar.gz: 63074ee096c0cf39d4b0034f697242152c8f821ec75205b8518d742d15681d54
5
5
  SHA512:
6
- metadata.gz: 46934a830919a7de8bd646a11f34dbd61dd68a808a50816cb4d976c628104cb1c25376480686324d751bc4bd465d65cd3a3b0b888e1db73c9d2df70446ef1a7b
7
- data.tar.gz: f8ac26c439661578e5fc8356922d8c30fdc80ec470f9a2bd013d91c2a55ac2f6819db2ace82ed9128e2d9aba92248908eb1e8e7fec1dc15624b53941c083fc11
6
+ metadata.gz: c7b5826e238173968ee21025c3e072e634935d64e512856bf86254a924746203b957f374d7ea9b22cdd0eadfb70ad6b46bb91b06bc36e47904996553c19484c0
7
+ data.tar.gz: 72bc8c3640a675d47badf5db8647c82695efa23fcd9b6b2e4ed897ce4f86d8edf730f208f82536964f0ed55a3bbf9ec0f37c53bb25398dbba864b47ffd008768
data/README.md CHANGED
@@ -907,4 +907,53 @@ else
907
907
  puts "Status: #{response.code}"
908
908
  puts response.body
909
909
  end
910
+ ```
911
+
912
+ ### Create Store
913
+
914
+ ```ruby
915
+ create_store_payload = {
916
+ "allowedOriginDomains": ["https://example.com", "https://www.example.com"],
917
+ "allowedRedirectURLs": ["https://example.com/return", "https://example.com/cancel"],
918
+ "storeName": "My Store",
919
+ "privacyPolicyUrl": "https://example.com/privacy",
920
+ "merchantLogoUrl": "https://example.com/logo.png"
921
+ }
922
+
923
+ merchant_account_id = "MERCHANT_ACCOUNT_ID"
924
+
925
+ response = client.create_store(merchant_account_id, create_store_payload, headers: {})
926
+ if response.code.to_i == 201
927
+ puts "Create Store API Response:"
928
+ puts response.body
929
+ else
930
+ puts "Error: Create Store API"
931
+ puts "Status: #{response.code}"
932
+ puts response.body
933
+ end
934
+ ```
935
+
936
+ ### Update Store
937
+
938
+ ```ruby
939
+ update_store_payload = {
940
+ "allowedOriginDomains": ["https://example.com", "https://www.example.com", "https://shop.example.com"],
941
+ "allowedRedirectURLs": ["https://example.com/return", "https://example.com/cancel"],
942
+ "storeName": "Updated Store Name",
943
+ "privacyPolicyUrl": "https://example.com/privacy-updated",
944
+ "merchantLogoUrl": "https://example.com/new-logo.png"
945
+ }
946
+
947
+ merchant_account_id = "MERCHANT_ACCOUNT_ID"
948
+ store_id = "STORE_ID"
949
+
950
+ response = client.update_store(merchant_account_id, store_id, update_store_payload, headers: {})
951
+ if response.code.to_i == 200
952
+ puts "Update Store API Response:"
953
+ puts response.body
954
+ else
955
+ puts "Error: Update Store API"
956
+ puts "Status: #{response.code}"
957
+ puts response.body
958
+ end
910
959
  ```
@@ -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.1.0".freeze
5
+ SDK_VERSION = "2.2.0".freeze
6
6
  API_VERSION = "v2".freeze
7
7
  API_ENDPOINTS = {
8
8
  'na' => 'pay-api.amazon.com',
@@ -52,6 +52,7 @@ module Constants
52
52
  DISBURSEMENTS = 'disbursements'.freeze
53
53
  DISPUTE_URLS = 'disputes'.freeze
54
54
  FILES_URLS = 'files'.freeze
55
+ STORES_URL = 'stores'.freeze
55
56
  DISPUTE_FILING_REASON = {
56
57
  PRODUCT_NOT_RECEIVED: "ProductNotReceived",
57
58
  PRODUCT_UNACCEPTABLE: "ProductUnacceptable",
@@ -98,4 +99,4 @@ module Constants
98
99
  DOWNLOAD_DATE_TIME: "DownloadDateTime",
99
100
  OTHER: "Other"
100
101
  }.freeze
101
- end
102
+ end
@@ -50,4 +50,29 @@ module PaymentServiceProviderClient
50
50
  def upload_file(payload, headers: {});
51
51
  api_call(Constants::FILES_URLS, Constants::POST, payload: payload, headers: headers)
52
52
  end
53
- end
53
+
54
+ # API to create store.
55
+ # The createStore operation is used to create a new store for a merchant account.
56
+ # This allows merchants to configure store-specific settings like allowed domains, redirect URLs,
57
+ # store name, privacy policy URL, merchant logo URL, and store status.
58
+ # @param {String} merchant_account_id - The unique ID of the merchant account to create the store for.
59
+ # @param {Object} payload - The payload containing store configuration details.
60
+ # @param {Object} headers - Optional headers for the request, such as authorization tokens or custom headers.
61
+ # @return [HTTPResponse] The response from the API call, which includes details of the created store.
62
+ def create_store(merchant_account_id, payload, headers: {})
63
+ api_call("#{Constants::MERCHANT_ACCOUNTS_BASE_URL}/#{merchant_account_id}/#{Constants::STORES_URL}", Constants::POST, payload: payload, headers: headers)
64
+ end
65
+
66
+ # API to update store.
67
+ # The updateStore operation is used to update an existing store's configuration.
68
+ # This allows merchants to modify store-specific settings like allowed domains, redirect URLs,
69
+ # store name, privacy policy URL, merchant logo URL, and store status.
70
+ # @param {String} merchant_account_id - The unique ID of the merchant account that owns the store.
71
+ # @param {String} store_id - The unique ID of the store to update.
72
+ # @param {Object} payload - The payload containing updated store configuration details.
73
+ # @param {Object} headers - Optional headers for the request, such as authorization tokens or custom headers.
74
+ # @return [HTTPResponse] The response from the API call, which includes details of the updated store.
75
+ def update_store(merchant_account_id, store_id, payload, headers: {})
76
+ api_call("#{Constants::MERCHANT_ACCOUNTS_BASE_URL}/#{merchant_account_id}/#{Constants::STORES_URL}/#{store_id}", Constants::PATCH, payload: payload, headers: headers)
77
+ end
78
+ end
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.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AmazonPay
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-29 00:00:00.000000000 Z
11
+ date: 2025-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -56,7 +56,7 @@ licenses:
56
56
  - Apache-2.0
57
57
  metadata:
58
58
  source_code_uri: https://github.com/amzn/amazon-pay-api-sdk-ruby
59
- post_install_message:
59
+ post_install_message:
60
60
  rdoc_options: []
61
61
  require_paths:
62
62
  - lib
@@ -71,8 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0'
73
73
  requirements: []
74
- rubygems_version: 3.5.4
75
- signing_key:
74
+ rubygems_version: 3.0.3.1
75
+ signing_key:
76
76
  specification_version: 4
77
77
  summary: This is an AmazonPay Ruby SDK
78
78
  test_files: []