cybersource_rest_client 0.0.87 → 0.0.88
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 +4 -4
- data/lib/cybersource_rest_client/api/acp_checkout_api.rb +553 -0
- data/lib/cybersource_rest_client/api/agent_registration_api.rb +721 -0
- data/lib/cybersource_rest_client/api/bank_account_validation_api.rb +0 -1
- data/lib/cybersource_rest_client/api/enrollment_api.rb +104 -0
- data/lib/cybersource_rest_client/api/{merchant_capabilities_api.rb → merchant_registration_api.rb} +47 -391
- data/lib/cybersource_rest_client/api/payment_events_api.rb +197 -0
- data/lib/cybersource_rest_client/api/product_feed_api.rb +365 -0
- data/lib/cybersource_rest_client/api/purchase_intent_api.rb +278 -0
- data/lib/cybersource_rest_client/api/ucp_checkout_api.rb +453 -0
- data/lib/cybersource_rest_client/models/activate_merchant_key_response200.rb +1 -1
- data/lib/cybersource_rest_client/models/add_agent_key_response201.rb +11 -11
- data/lib/cybersource_rest_client/models/agent_registration_response201.rb +13 -15
- data/lib/cybersource_rest_client/models/agent_registration_response201_keys.rb +8 -8
- data/lib/cybersource_rest_client/models/agent_request.rb +9 -11
- data/lib/cybersource_rest_client/models/agent_update.rb +7 -9
- data/lib/cybersource_rest_client/models/auth_reversal_request.rb +1 -1
- data/lib/cybersource_rest_client/models/boarding_payouts_configurations.rb +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_200_19_google_merchant_products.rb → boarding_payouts_configurations_acquirer.rb} +33 -76
- data/lib/cybersource_rest_client/models/{inline_response_200_19_errors.rb → boarding_payouts_configurations_merchant_descriptor.rb} +25 -33
- data/lib/cybersource_rest_client/models/boarding_payouts_configurations_processors.rb +581 -0
- data/lib/cybersource_rest_client/models/capture_payment_request.rb +1 -1
- data/lib/cybersource_rest_client/models/create_order_request.rb +11 -1
- data/lib/cybersource_rest_client/models/create_payment_request.rb +14 -1
- data/lib/cybersource_rest_client/models/create_session_req.rb +14 -1
- data/lib/cybersource_rest_client/models/create_session_request.rb +14 -1
- data/lib/cybersource_rest_client/models/iccv1agents_keys.rb +4 -4
- data/lib/cybersource_rest_client/models/iccv1merchants_api_integrations.rb +2 -2
- data/lib/cybersource_rest_client/models/iccv1merchants_encryption_key.rb +6 -6
- data/lib/cybersource_rest_client/models/iccv1merchants_protocol_interactions.rb +1 -1
- data/lib/cybersource_rest_client/models/iccv1merchants_web_integrations.rb +2 -2
- data/lib/cybersource_rest_client/models/inline_response_200_17.rb +55 -0
- data/lib/cybersource_rest_client/models/inline_response_200_18.rb +40 -0
- data/lib/cybersource_rest_client/models/inline_response_200_19.rb +30 -107
- data/lib/cybersource_rest_client/models/inline_response_200_19_processing.rb +213 -0
- data/lib/cybersource_rest_client/models/inline_response_200_19_syndication.rb +224 -0
- data/lib/cybersource_rest_client/models/inline_response_200_20_products.rb +80 -682
- data/lib/cybersource_rest_client/models/inline_response_201_12.rb +40 -0
- data/lib/cybersource_rest_client/models/inline_response_201_12_fulfillment_options.rb +30 -0
- data/lib/cybersource_rest_client/models/inline_response_201_12_totals.rb +15 -0
- data/lib/cybersource_rest_client/models/inline_response_201_6_setups_risk.rb +15 -5
- data/lib/cybersource_rest_client/models/inline_response_201_6_setups_value_added_services.rb +15 -5
- data/lib/cybersource_rest_client/models/{deactivate_merchant_key_response200.rb → inline_response_202_1.rb} +11 -16
- data/lib/cybersource_rest_client/models/key_request.rb +4 -4
- data/lib/cybersource_rest_client/models/key_request_1.rb +5 -5
- data/lib/cybersource_rest_client/models/key_update.rb +5 -5
- data/lib/cybersource_rest_client/models/key_update_1.rb +5 -5
- data/lib/cybersource_rest_client/models/list_agent_keys_response200.rb +2 -2
- data/lib/cybersource_rest_client/models/merchant_registration_response201.rb +10 -10
- data/lib/cybersource_rest_client/models/merchant_registration_response201_api_integrations.rb +225 -0
- data/lib/cybersource_rest_client/models/merchant_registration_response201_keys.rb +1 -1
- data/lib/cybersource_rest_client/models/merchant_registration_response201_web_integrations.rb +225 -0
- data/lib/cybersource_rest_client/models/merchant_request.rb +7 -7
- data/lib/cybersource_rest_client/models/merchant_update.rb +7 -7
- data/lib/cybersource_rest_client/models/mit_reversal_request.rb +1 -1
- data/lib/cybersource_rest_client/models/mit_void_request.rb +15 -5
- data/lib/cybersource_rest_client/models/payments_configuration_setup.rb +11 -1
- data/lib/cybersource_rest_client/models/payments_products.rb +11 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response.rb +12 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1.rb +12 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information.rb +44 -1
- data/lib/cybersource_rest_client/models/{pts_v2_payouts_post201_response_merchant_information_merchant_descriptor.rb → pts_v2_payments_post201_response_1_order_information_merchant_descriptor.rb} +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_processor_information.rb +18 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_installment_information.rb +101 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_ship_to.rb +12 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_point_of_sale_information.rb +22 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +22 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_processor_information.rb +22 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/{ptsv2paymentsidreversals_point_of_sale_information.rb → pts_v2_payments_reversals_post201_response_point_of_sale_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/{ptsv2paymentsidreversals_point_of_sale_information_emv.rb → pts_v2_payments_reversals_post201_response_point_of_sale_information_emv.rb} +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_processor_information.rb +22 -5
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_merchant_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2intents_buyer_information.rb +196 -0
- data/lib/cybersource_rest_client/models/ptsv2intents_merchant_information_merchant_descriptor.rb +18 -1
- data/lib/cybersource_rest_client/models/ptsv2intents_order_information_bill_to.rb +154 -1
- data/lib/cybersource_rest_client/models/ptsv2intents_order_information_line_items.rb +16 -5
- data/lib/cybersource_rest_client/models/ptsv2intentsid_merchant_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2intentsid_merchant_information_merchant_descriptor.rb +207 -0
- data/lib/cybersource_rest_client/models/{ptsv2paymentsidcaptures_point_of_sale_information.rb → ptsv2payments_buyer.rb} +55 -31
- data/lib/cybersource_rest_client/models/{inline_response_200_19_google_merchant.rb → ptsv2payments_order_history.rb} +42 -41
- data/lib/cybersource_rest_client/models/ptsv2payments_ship_to.rb +281 -0
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_point_of_sale_information.rb +1 -1
- data/lib/cybersource_rest_client/models/{ptsv2paymentsidcaptures_point_of_sale_information_emv.rb → ptsv2paymentsidrefunds_point_of_sale_information_emv.rb} +1 -1
- data/lib/cybersource_rest_client/models/risk_products.rb +15 -5
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_point_of_sale_information.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_point_of_sale_information.rb +1 -1
- data/lib/cybersource_rest_client/models/unifiedrisk_acquirer_merchant_account_security_amount.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_expected_annual_sales.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_expected_average_ticket_size.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_expected_monthly_sales.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_limit_value.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_bank_account_balance_before.rb +2 -2
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_bank_account_credit_limit.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_additional_fees.rb +2 -2
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_amount.rb +3 -3
- data/lib/cybersource_rest_client/models/value_added_services_products.rb +15 -5
- data/lib/cybersource_rest_client/models/void_capture_request.rb +15 -5
- data/lib/cybersource_rest_client/models/void_credit_request.rb +15 -5
- data/lib/cybersource_rest_client/models/void_payment_request.rb +15 -5
- data/lib/cybersource_rest_client/models/void_refund_request.rb +15 -5
- data/lib/cybersource_rest_client.rb +25 -11
- metadata +27 -13
- data/lib/cybersource_rest_client/api/agent_capabilities_api.rb +0 -2279
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e1e5c2b604a9baf468ed5dd9dbc71a830b1124514911c6334e2e8d889bc98d33
|
|
4
|
+
data.tar.gz: 8002de77b368c36e76e91ae0307cfdaeb31af01c888a5dc5494f62690ae8e7fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 59c65c5e4e13d30a66cd8a8e8da030a24b8200f084ad6dc2cfcfc1723fb586a4bff8726066ecb6e0d6e74887015eb1449ab9c84729db9efd93818881fcf29f58
|
|
7
|
+
data.tar.gz: 46ec71529aa59f09552e05634cb36bb273a8194fdf638051a501764e97392ae42c82443dd7ad1b411b1fb9c7f7d6ac8aadab1a394d2e82ec523a06f62eed0528
|
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CyberSource Merged Spec
|
|
3
|
+
|
|
4
|
+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.38
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'uri'
|
|
13
|
+
require 'AuthenticationSDK/util/MLEUtility'
|
|
14
|
+
module CyberSource
|
|
15
|
+
class ACPCheckoutApi
|
|
16
|
+
attr_accessor :api_client
|
|
17
|
+
|
|
18
|
+
def initialize(api_client = ApiClient.default, config)
|
|
19
|
+
@api_client = api_client
|
|
20
|
+
@api_client.set_configuration(config)
|
|
21
|
+
end
|
|
22
|
+
# Cancel Checkout ACP
|
|
23
|
+
# Cancels an active ACP checkout session. No charge is made to the buyer. This call is safe to make multiple times — cancelling an already-cancelled session returns a successful response without error. Sessions also expire automatically after 30 minutes of inactivity, so explicit cancellation is optional but recommended to release any reserved inventory immediately.
|
|
24
|
+
#
|
|
25
|
+
# @param session_id The unique identifier of the ACP checkout session to cancel. Obtained from the `id` field in the Create Session response.
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @option opts [String] :idempotency_key Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.
|
|
28
|
+
# @option opts [String] :accept_language Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.
|
|
29
|
+
# @option opts [String] :user_agent Client user agent string identifying the AI agent platform and version.
|
|
30
|
+
# @option opts [String] :request_id Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.
|
|
31
|
+
# @option opts [String] :signature Request signature for payload integrity verification.
|
|
32
|
+
# @option opts [String] :timestamp ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.
|
|
33
|
+
# @option opts [String] :api_version ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.
|
|
34
|
+
# @return [InlineResponse20018]
|
|
35
|
+
#
|
|
36
|
+
def cancel_checkout(session_id, opts = {})
|
|
37
|
+
data, status_code, headers = cancel_checkout_with_http_info(session_id, opts)
|
|
38
|
+
return data, status_code, headers
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Cancel Checkout ACP
|
|
42
|
+
# Cancels an active ACP checkout session. No charge is made to the buyer. This call is safe to make multiple times — cancelling an already-cancelled session returns a successful response without error. Sessions also expire automatically after 30 minutes of inactivity, so explicit cancellation is optional but recommended to release any reserved inventory immediately.
|
|
43
|
+
# @param session_id The unique identifier of the ACP checkout session to cancel. Obtained from the `id` field in the Create Session response.
|
|
44
|
+
# @param [Hash] opts the optional parameters
|
|
45
|
+
# @option opts [String] :idempotency_key Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.
|
|
46
|
+
# @option opts [String] :accept_language Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.
|
|
47
|
+
# @option opts [String] :user_agent Client user agent string identifying the AI agent platform and version.
|
|
48
|
+
# @option opts [String] :request_id Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.
|
|
49
|
+
# @option opts [String] :signature Request signature for payload integrity verification.
|
|
50
|
+
# @option opts [String] :timestamp ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.
|
|
51
|
+
# @option opts [String] :api_version ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.
|
|
52
|
+
# @return [Array<(InlineResponse20018, Fixnum, Hash)>] InlineResponse20018 data, response status code and response headers
|
|
53
|
+
def cancel_checkout_with_http_info(session_id, opts = {})
|
|
54
|
+
|
|
55
|
+
if @api_client.config.debugging
|
|
56
|
+
begin
|
|
57
|
+
raise
|
|
58
|
+
@api_client.config.logger.debug 'Calling API: ACPCheckoutApi.cancel_checkout ...'
|
|
59
|
+
rescue
|
|
60
|
+
puts 'Cannot write to log'
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
# verify the required parameter 'session_id' is set
|
|
64
|
+
if @api_client.config.client_side_validation && session_id.nil?
|
|
65
|
+
fail ArgumentError, "Missing the required parameter 'session_id' when calling ACPCheckoutApi.cancel_checkout"
|
|
66
|
+
end
|
|
67
|
+
# resource path
|
|
68
|
+
local_var_path = 'icc/v1/checkout_sessions/{session_id}/cancel'.sub('{' + 'session_id' + '}', session_id.to_s)
|
|
69
|
+
|
|
70
|
+
# query parameters
|
|
71
|
+
query_params = {}
|
|
72
|
+
|
|
73
|
+
# header parameters
|
|
74
|
+
header_params = {}
|
|
75
|
+
# HTTP header 'Accept' (if needed)
|
|
76
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
77
|
+
# HTTP header 'Content-Type'
|
|
78
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
79
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
80
|
+
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
|
|
81
|
+
header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?
|
|
82
|
+
header_params[:'Request-Id'] = opts[:'request_id'] if !opts[:'request_id'].nil?
|
|
83
|
+
header_params[:'Signature'] = opts[:'signature'] if !opts[:'signature'].nil?
|
|
84
|
+
header_params[:'Timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
|
|
85
|
+
header_params[:'API-Version'] = opts[:'api_version'] if !opts[:'api_version'].nil?
|
|
86
|
+
|
|
87
|
+
# form parameters
|
|
88
|
+
form_params = {}
|
|
89
|
+
|
|
90
|
+
# http body (model)
|
|
91
|
+
if 'POST' == 'POST'
|
|
92
|
+
post_body = '{}'
|
|
93
|
+
else
|
|
94
|
+
post_body = nil
|
|
95
|
+
end
|
|
96
|
+
inbound_mle_status = "mandatory"
|
|
97
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["cancel_checkout","cancel_checkout_with_http_info"])
|
|
98
|
+
begin
|
|
99
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
100
|
+
rescue
|
|
101
|
+
raise
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["cancel_checkout","cancel_checkout_with_http_info"])
|
|
106
|
+
|
|
107
|
+
auth_names = []
|
|
108
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
109
|
+
:header_params => header_params,
|
|
110
|
+
:query_params => query_params,
|
|
111
|
+
:form_params => form_params,
|
|
112
|
+
:body => post_body,
|
|
113
|
+
:auth_names => auth_names,
|
|
114
|
+
:return_type => 'InlineResponse20018',
|
|
115
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
116
|
+
if @api_client.config.debugging
|
|
117
|
+
begin
|
|
118
|
+
raise
|
|
119
|
+
@api_client.config.logger.debug "API called: ACPCheckoutApi#cancel_checkout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
120
|
+
rescue
|
|
121
|
+
puts 'Cannot write to log'
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
return data, status_code, headers
|
|
125
|
+
end
|
|
126
|
+
# Complete Checkout ACP
|
|
127
|
+
# **Final step of the ACP checkout flow.** Submits payment and buyer information to place the order with the merchant. On success, the session transitions to `completed` and an `order_id` is returned confirming the merchant accepted the order. Once completed, the session is immutable — it cannot be updated or cancelled. **Payment token:** The `payment.token` must be a valid token from the payment provider configured for the merchant (e.g. a tokenized card from Stripe or Braintree). ACG forwards the token to the merchant's payment processor — it is never stored.
|
|
128
|
+
#
|
|
129
|
+
# @param session_id The unique identifier of the ACP checkout session to complete.
|
|
130
|
+
# @param acp_complete_checkout_request Final buyer and payment details needed to place the order. Both `buyer` and `payment` may have been provided in earlier Create/Update calls; if so, they can be omitted here. At least a valid payment token is required to process the transaction.
|
|
131
|
+
# @param [Hash] opts the optional parameters
|
|
132
|
+
# @option opts [String] :idempotency_key Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.
|
|
133
|
+
# @option opts [String] :accept_language Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.
|
|
134
|
+
# @option opts [String] :user_agent Client user agent string identifying the AI agent platform and version.
|
|
135
|
+
# @option opts [String] :request_id Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.
|
|
136
|
+
# @option opts [String] :signature Request signature for payload integrity verification.
|
|
137
|
+
# @option opts [String] :timestamp ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.
|
|
138
|
+
# @option opts [String] :api_version ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.
|
|
139
|
+
# @return [InlineResponse20017]
|
|
140
|
+
#
|
|
141
|
+
def complete_checkout(session_id, acp_complete_checkout_request, opts = {})
|
|
142
|
+
data, status_code, headers = complete_checkout_with_http_info(session_id, acp_complete_checkout_request, opts)
|
|
143
|
+
return data, status_code, headers
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Complete Checkout ACP
|
|
147
|
+
# **Final step of the ACP checkout flow.** Submits payment and buyer information to place the order with the merchant. On success, the session transitions to `completed` and an `order_id` is returned confirming the merchant accepted the order. Once completed, the session is immutable — it cannot be updated or cancelled. **Payment token:** The `payment.token` must be a valid token from the payment provider configured for the merchant (e.g. a tokenized card from Stripe or Braintree). ACG forwards the token to the merchant's payment processor — it is never stored.
|
|
148
|
+
# @param session_id The unique identifier of the ACP checkout session to complete.
|
|
149
|
+
# @param acp_complete_checkout_request Final buyer and payment details needed to place the order. Both `buyer` and `payment` may have been provided in earlier Create/Update calls; if so, they can be omitted here. At least a valid payment token is required to process the transaction.
|
|
150
|
+
# @param [Hash] opts the optional parameters
|
|
151
|
+
# @option opts [String] :idempotency_key Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.
|
|
152
|
+
# @option opts [String] :accept_language Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.
|
|
153
|
+
# @option opts [String] :user_agent Client user agent string identifying the AI agent platform and version.
|
|
154
|
+
# @option opts [String] :request_id Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.
|
|
155
|
+
# @option opts [String] :signature Request signature for payload integrity verification.
|
|
156
|
+
# @option opts [String] :timestamp ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.
|
|
157
|
+
# @option opts [String] :api_version ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.
|
|
158
|
+
# @return [Array<(InlineResponse20017, Fixnum, Hash)>] InlineResponse20017 data, response status code and response headers
|
|
159
|
+
def complete_checkout_with_http_info(session_id, acp_complete_checkout_request, opts = {})
|
|
160
|
+
|
|
161
|
+
if @api_client.config.debugging
|
|
162
|
+
begin
|
|
163
|
+
raise
|
|
164
|
+
@api_client.config.logger.debug 'Calling API: ACPCheckoutApi.complete_checkout ...'
|
|
165
|
+
rescue
|
|
166
|
+
puts 'Cannot write to log'
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
# verify the required parameter 'session_id' is set
|
|
170
|
+
if @api_client.config.client_side_validation && session_id.nil?
|
|
171
|
+
fail ArgumentError, "Missing the required parameter 'session_id' when calling ACPCheckoutApi.complete_checkout"
|
|
172
|
+
end
|
|
173
|
+
# verify the required parameter 'acp_complete_checkout_request' is set
|
|
174
|
+
if @api_client.config.client_side_validation && acp_complete_checkout_request.nil?
|
|
175
|
+
fail ArgumentError, "Missing the required parameter 'acp_complete_checkout_request' when calling ACPCheckoutApi.complete_checkout"
|
|
176
|
+
end
|
|
177
|
+
# resource path
|
|
178
|
+
local_var_path = 'icc/v1/checkout_sessions/{session_id}/complete'.sub('{' + 'session_id' + '}', session_id.to_s)
|
|
179
|
+
|
|
180
|
+
# query parameters
|
|
181
|
+
query_params = {}
|
|
182
|
+
|
|
183
|
+
# header parameters
|
|
184
|
+
header_params = {}
|
|
185
|
+
# HTTP header 'Accept' (if needed)
|
|
186
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
187
|
+
# HTTP header 'Content-Type'
|
|
188
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
189
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
190
|
+
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
|
|
191
|
+
header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?
|
|
192
|
+
header_params[:'Request-Id'] = opts[:'request_id'] if !opts[:'request_id'].nil?
|
|
193
|
+
header_params[:'Signature'] = opts[:'signature'] if !opts[:'signature'].nil?
|
|
194
|
+
header_params[:'Timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
|
|
195
|
+
header_params[:'API-Version'] = opts[:'api_version'] if !opts[:'api_version'].nil?
|
|
196
|
+
|
|
197
|
+
# form parameters
|
|
198
|
+
form_params = {}
|
|
199
|
+
|
|
200
|
+
# http body (model)
|
|
201
|
+
post_body = @api_client.object_to_http_body(acp_complete_checkout_request)
|
|
202
|
+
sdk_tracker = SdkTracker.new
|
|
203
|
+
post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AcpCompleteCheckoutRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
|
|
204
|
+
inbound_mle_status = "mandatory"
|
|
205
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["complete_checkout","complete_checkout_with_http_info"])
|
|
206
|
+
begin
|
|
207
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
208
|
+
rescue
|
|
209
|
+
raise
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["complete_checkout","complete_checkout_with_http_info"])
|
|
214
|
+
|
|
215
|
+
auth_names = []
|
|
216
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
217
|
+
:header_params => header_params,
|
|
218
|
+
:query_params => query_params,
|
|
219
|
+
:form_params => form_params,
|
|
220
|
+
:body => post_body,
|
|
221
|
+
:auth_names => auth_names,
|
|
222
|
+
:return_type => 'InlineResponse20017',
|
|
223
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
224
|
+
if @api_client.config.debugging
|
|
225
|
+
begin
|
|
226
|
+
raise
|
|
227
|
+
@api_client.config.logger.debug "API called: ACPCheckoutApi#complete_checkout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
228
|
+
rescue
|
|
229
|
+
puts 'Cannot write to log'
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
return data, status_code, headers
|
|
233
|
+
end
|
|
234
|
+
# Create Checkout Session ACP
|
|
235
|
+
# **Step 1 of the ACP checkout flow.** Initiates a new ACP checkout session with the buyer's cart. ACG validates item availability against the merchant's catalog, calculates initial pricing and tax, and returns a session object with a unique `id`. **Store the `id`** — every subsequent call in this checkout flow (update, complete, cancel) requires it. The session remains active for 30 minutes. A new session must be created after expiry. **Idempotency:** Supply an `Idempotency-Key` header to safely retry this call without creating duplicate sessions.
|
|
236
|
+
#
|
|
237
|
+
# @param acp_create_checkout_session_request The cart contents and buyer context for this checkout session. `items` is required. `buyer` and `fulfillment_address` are optional on creation and can be provided via Update Session before completing checkout.
|
|
238
|
+
# @param [Hash] opts the optional parameters
|
|
239
|
+
# @option opts [String] :idempotency_key Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.
|
|
240
|
+
# @option opts [String] :accept_language Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.
|
|
241
|
+
# @option opts [String] :user_agent Client user agent string identifying the AI agent platform and version.
|
|
242
|
+
# @option opts [String] :request_id Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.
|
|
243
|
+
# @option opts [String] :signature Request signature for payload integrity verification.
|
|
244
|
+
# @option opts [String] :timestamp ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.
|
|
245
|
+
# @option opts [String] :api_version ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.
|
|
246
|
+
# @return [InlineResponse20112]
|
|
247
|
+
#
|
|
248
|
+
def create_checkout_session(acp_create_checkout_session_request, opts = {})
|
|
249
|
+
data, status_code, headers = create_checkout_session_with_http_info(acp_create_checkout_session_request, opts)
|
|
250
|
+
return data, status_code, headers
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Create Checkout Session ACP
|
|
254
|
+
# **Step 1 of the ACP checkout flow.** Initiates a new ACP checkout session with the buyer's cart. ACG validates item availability against the merchant's catalog, calculates initial pricing and tax, and returns a session object with a unique `id`. **Store the `id`** — every subsequent call in this checkout flow (update, complete, cancel) requires it. The session remains active for 30 minutes. A new session must be created after expiry. **Idempotency:** Supply an `Idempotency-Key` header to safely retry this call without creating duplicate sessions.
|
|
255
|
+
# @param acp_create_checkout_session_request The cart contents and buyer context for this checkout session. `items` is required. `buyer` and `fulfillment_address` are optional on creation and can be provided via Update Session before completing checkout.
|
|
256
|
+
# @param [Hash] opts the optional parameters
|
|
257
|
+
# @option opts [String] :idempotency_key Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.
|
|
258
|
+
# @option opts [String] :accept_language Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.
|
|
259
|
+
# @option opts [String] :user_agent Client user agent string identifying the AI agent platform and version.
|
|
260
|
+
# @option opts [String] :request_id Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.
|
|
261
|
+
# @option opts [String] :signature Request signature for payload integrity verification.
|
|
262
|
+
# @option opts [String] :timestamp ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.
|
|
263
|
+
# @option opts [String] :api_version ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.
|
|
264
|
+
# @return [Array<(InlineResponse20112, Fixnum, Hash)>] InlineResponse20112 data, response status code and response headers
|
|
265
|
+
def create_checkout_session_with_http_info(acp_create_checkout_session_request, opts = {})
|
|
266
|
+
|
|
267
|
+
if @api_client.config.debugging
|
|
268
|
+
begin
|
|
269
|
+
raise
|
|
270
|
+
@api_client.config.logger.debug 'Calling API: ACPCheckoutApi.create_checkout_session ...'
|
|
271
|
+
rescue
|
|
272
|
+
puts 'Cannot write to log'
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
# verify the required parameter 'acp_create_checkout_session_request' is set
|
|
276
|
+
if @api_client.config.client_side_validation && acp_create_checkout_session_request.nil?
|
|
277
|
+
fail ArgumentError, "Missing the required parameter 'acp_create_checkout_session_request' when calling ACPCheckoutApi.create_checkout_session"
|
|
278
|
+
end
|
|
279
|
+
# resource path
|
|
280
|
+
local_var_path = 'icc/v1/checkout_sessions'
|
|
281
|
+
|
|
282
|
+
# query parameters
|
|
283
|
+
query_params = {}
|
|
284
|
+
|
|
285
|
+
# header parameters
|
|
286
|
+
header_params = {}
|
|
287
|
+
# HTTP header 'Accept' (if needed)
|
|
288
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
289
|
+
# HTTP header 'Content-Type'
|
|
290
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
291
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
292
|
+
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
|
|
293
|
+
header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?
|
|
294
|
+
header_params[:'Request-Id'] = opts[:'request_id'] if !opts[:'request_id'].nil?
|
|
295
|
+
header_params[:'Signature'] = opts[:'signature'] if !opts[:'signature'].nil?
|
|
296
|
+
header_params[:'Timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
|
|
297
|
+
header_params[:'API-Version'] = opts[:'api_version'] if !opts[:'api_version'].nil?
|
|
298
|
+
|
|
299
|
+
# form parameters
|
|
300
|
+
form_params = {}
|
|
301
|
+
|
|
302
|
+
# http body (model)
|
|
303
|
+
post_body = @api_client.object_to_http_body(acp_create_checkout_session_request)
|
|
304
|
+
sdk_tracker = SdkTracker.new
|
|
305
|
+
post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AcpCreateCheckoutSessionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
|
|
306
|
+
inbound_mle_status = "mandatory"
|
|
307
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["create_checkout_session","create_checkout_session_with_http_info"])
|
|
308
|
+
begin
|
|
309
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
310
|
+
rescue
|
|
311
|
+
raise
|
|
312
|
+
end
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["create_checkout_session","create_checkout_session_with_http_info"])
|
|
316
|
+
|
|
317
|
+
auth_names = []
|
|
318
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
319
|
+
:header_params => header_params,
|
|
320
|
+
:query_params => query_params,
|
|
321
|
+
:form_params => form_params,
|
|
322
|
+
:body => post_body,
|
|
323
|
+
:auth_names => auth_names,
|
|
324
|
+
:return_type => 'InlineResponse20112',
|
|
325
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
326
|
+
if @api_client.config.debugging
|
|
327
|
+
begin
|
|
328
|
+
raise
|
|
329
|
+
@api_client.config.logger.debug "API called: ACPCheckoutApi#create_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
330
|
+
rescue
|
|
331
|
+
puts 'Cannot write to log'
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
return data, status_code, headers
|
|
335
|
+
end
|
|
336
|
+
# Get Checkout Session ACP
|
|
337
|
+
# Retrieves the current state of an ACP checkout session, including line items, buyer information, and current totals. Use this to: - Verify session status before presenting a checkout summary to the buyer - Resume an interrupted checkout flow - Poll for status after an async operation - Confirm a session has not expired before submitting payment
|
|
338
|
+
#
|
|
339
|
+
# @param session_id The unique identifier of the ACP checkout session to retrieve. Obtained from the `id` field in the Create Session response.
|
|
340
|
+
# @param acp_get_checkout_session_request Empty request body.
|
|
341
|
+
# @param [Hash] opts the optional parameters
|
|
342
|
+
# @option opts [String] :idempotency_key Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.
|
|
343
|
+
# @option opts [String] :accept_language Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.
|
|
344
|
+
# @option opts [String] :user_agent Client user agent string identifying the AI agent platform and version.
|
|
345
|
+
# @option opts [String] :request_id Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.
|
|
346
|
+
# @option opts [String] :signature Request signature for payload integrity verification.
|
|
347
|
+
# @option opts [String] :timestamp ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.
|
|
348
|
+
# @option opts [String] :api_version ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.
|
|
349
|
+
# @return [InlineResponse20112]
|
|
350
|
+
#
|
|
351
|
+
def get_checkout_session(session_id, acp_get_checkout_session_request, opts = {})
|
|
352
|
+
data, status_code, headers = get_checkout_session_with_http_info(session_id, acp_get_checkout_session_request, opts)
|
|
353
|
+
return data, status_code, headers
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Get Checkout Session ACP
|
|
357
|
+
# Retrieves the current state of an ACP checkout session, including line items, buyer information, and current totals. Use this to: - Verify session status before presenting a checkout summary to the buyer - Resume an interrupted checkout flow - Poll for status after an async operation - Confirm a session has not expired before submitting payment
|
|
358
|
+
# @param session_id The unique identifier of the ACP checkout session to retrieve. Obtained from the `id` field in the Create Session response.
|
|
359
|
+
# @param acp_get_checkout_session_request Empty request body.
|
|
360
|
+
# @param [Hash] opts the optional parameters
|
|
361
|
+
# @option opts [String] :idempotency_key Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.
|
|
362
|
+
# @option opts [String] :accept_language Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.
|
|
363
|
+
# @option opts [String] :user_agent Client user agent string identifying the AI agent platform and version.
|
|
364
|
+
# @option opts [String] :request_id Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.
|
|
365
|
+
# @option opts [String] :signature Request signature for payload integrity verification.
|
|
366
|
+
# @option opts [String] :timestamp ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.
|
|
367
|
+
# @option opts [String] :api_version ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.
|
|
368
|
+
# @return [Array<(InlineResponse20112, Fixnum, Hash)>] InlineResponse20112 data, response status code and response headers
|
|
369
|
+
def get_checkout_session_with_http_info(session_id, acp_get_checkout_session_request, opts = {})
|
|
370
|
+
|
|
371
|
+
if @api_client.config.debugging
|
|
372
|
+
begin
|
|
373
|
+
raise
|
|
374
|
+
@api_client.config.logger.debug 'Calling API: ACPCheckoutApi.get_checkout_session ...'
|
|
375
|
+
rescue
|
|
376
|
+
puts 'Cannot write to log'
|
|
377
|
+
end
|
|
378
|
+
end
|
|
379
|
+
# verify the required parameter 'session_id' is set
|
|
380
|
+
if @api_client.config.client_side_validation && session_id.nil?
|
|
381
|
+
fail ArgumentError, "Missing the required parameter 'session_id' when calling ACPCheckoutApi.get_checkout_session"
|
|
382
|
+
end
|
|
383
|
+
# verify the required parameter 'acp_get_checkout_session_request' is set
|
|
384
|
+
if @api_client.config.client_side_validation && acp_get_checkout_session_request.nil?
|
|
385
|
+
fail ArgumentError, "Missing the required parameter 'acp_get_checkout_session_request' when calling ACPCheckoutApi.get_checkout_session"
|
|
386
|
+
end
|
|
387
|
+
# resource path
|
|
388
|
+
local_var_path = 'icc/v1/checkout_sessions/{session_id}'.sub('{' + 'session_id' + '}', session_id.to_s)
|
|
389
|
+
|
|
390
|
+
# query parameters
|
|
391
|
+
query_params = {}
|
|
392
|
+
|
|
393
|
+
# header parameters
|
|
394
|
+
header_params = {}
|
|
395
|
+
# HTTP header 'Accept' (if needed)
|
|
396
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
397
|
+
# HTTP header 'Content-Type'
|
|
398
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
399
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
400
|
+
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
|
|
401
|
+
header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?
|
|
402
|
+
header_params[:'Request-Id'] = opts[:'request_id'] if !opts[:'request_id'].nil?
|
|
403
|
+
header_params[:'Signature'] = opts[:'signature'] if !opts[:'signature'].nil?
|
|
404
|
+
header_params[:'Timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
|
|
405
|
+
header_params[:'API-Version'] = opts[:'api_version'] if !opts[:'api_version'].nil?
|
|
406
|
+
|
|
407
|
+
# form parameters
|
|
408
|
+
form_params = {}
|
|
409
|
+
|
|
410
|
+
# http body (model)
|
|
411
|
+
post_body = @api_client.object_to_http_body(acp_get_checkout_session_request)
|
|
412
|
+
sdk_tracker = SdkTracker.new
|
|
413
|
+
post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'Object', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
|
|
414
|
+
inbound_mle_status = "false"
|
|
415
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["get_checkout_session","get_checkout_session_with_http_info"])
|
|
416
|
+
begin
|
|
417
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
418
|
+
rescue
|
|
419
|
+
raise
|
|
420
|
+
end
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["get_checkout_session","get_checkout_session_with_http_info"])
|
|
424
|
+
|
|
425
|
+
auth_names = []
|
|
426
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
427
|
+
:header_params => header_params,
|
|
428
|
+
:query_params => query_params,
|
|
429
|
+
:form_params => form_params,
|
|
430
|
+
:body => post_body,
|
|
431
|
+
:auth_names => auth_names,
|
|
432
|
+
:return_type => 'InlineResponse20112',
|
|
433
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
434
|
+
if @api_client.config.debugging
|
|
435
|
+
begin
|
|
436
|
+
raise
|
|
437
|
+
@api_client.config.logger.debug "API called: ACPCheckoutApi#get_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
438
|
+
rescue
|
|
439
|
+
puts 'Cannot write to log'
|
|
440
|
+
end
|
|
441
|
+
end
|
|
442
|
+
return data, status_code, headers
|
|
443
|
+
end
|
|
444
|
+
# Update Checkout Session ACP
|
|
445
|
+
# Modifies an active ACP checkout session and returns the updated session state with recalculated totals. Use this to: - Add, remove, or change quantities of cart items - Apply or remove discount codes - Update the buyer's shipping address or contact details - Trigger re-calculation of shipping costs and tax Only fields included in the request body are updated — omitted fields retain their current values. **Idempotency:** Supply an `Idempotency-Key` to safely retry updates without applying them twice.
|
|
446
|
+
#
|
|
447
|
+
# @param session_id The unique identifier of the ACP checkout session to update. Obtained from the `id` field in the Create Session response.
|
|
448
|
+
# @param acp_update_checkout_session_request Fields to update. All fields are optional — only included fields are changed. To replace the cart entirely, provide the full `items` array.
|
|
449
|
+
# @param [Hash] opts the optional parameters
|
|
450
|
+
# @option opts [String] :idempotency_key Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.
|
|
451
|
+
# @option opts [String] :accept_language Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.
|
|
452
|
+
# @option opts [String] :user_agent Client user agent string identifying the AI agent platform and version.
|
|
453
|
+
# @option opts [String] :request_id Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.
|
|
454
|
+
# @option opts [String] :signature Request signature for payload integrity verification.
|
|
455
|
+
# @option opts [String] :timestamp ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.
|
|
456
|
+
# @option opts [String] :api_version ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.
|
|
457
|
+
# @return [InlineResponse20112]
|
|
458
|
+
#
|
|
459
|
+
def update_checkout_session(session_id, acp_update_checkout_session_request, opts = {})
|
|
460
|
+
data, status_code, headers = update_checkout_session_with_http_info(session_id, acp_update_checkout_session_request, opts)
|
|
461
|
+
return data, status_code, headers
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
# Update Checkout Session ACP
|
|
465
|
+
# Modifies an active ACP checkout session and returns the updated session state with recalculated totals. Use this to: - Add, remove, or change quantities of cart items - Apply or remove discount codes - Update the buyer's shipping address or contact details - Trigger re-calculation of shipping costs and tax Only fields included in the request body are updated — omitted fields retain their current values. **Idempotency:** Supply an `Idempotency-Key` to safely retry updates without applying them twice.
|
|
466
|
+
# @param session_id The unique identifier of the ACP checkout session to update. Obtained from the `id` field in the Create Session response.
|
|
467
|
+
# @param acp_update_checkout_session_request Fields to update. All fields are optional — only included fields are changed. To replace the cart entirely, provide the full `items` array.
|
|
468
|
+
# @param [Hash] opts the optional parameters
|
|
469
|
+
# @option opts [String] :idempotency_key Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.
|
|
470
|
+
# @option opts [String] :accept_language Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.
|
|
471
|
+
# @option opts [String] :user_agent Client user agent string identifying the AI agent platform and version.
|
|
472
|
+
# @option opts [String] :request_id Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.
|
|
473
|
+
# @option opts [String] :signature Request signature for payload integrity verification.
|
|
474
|
+
# @option opts [String] :timestamp ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.
|
|
475
|
+
# @option opts [String] :api_version ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.
|
|
476
|
+
# @return [Array<(InlineResponse20112, Fixnum, Hash)>] InlineResponse20112 data, response status code and response headers
|
|
477
|
+
def update_checkout_session_with_http_info(session_id, acp_update_checkout_session_request, opts = {})
|
|
478
|
+
|
|
479
|
+
if @api_client.config.debugging
|
|
480
|
+
begin
|
|
481
|
+
raise
|
|
482
|
+
@api_client.config.logger.debug 'Calling API: ACPCheckoutApi.update_checkout_session ...'
|
|
483
|
+
rescue
|
|
484
|
+
puts 'Cannot write to log'
|
|
485
|
+
end
|
|
486
|
+
end
|
|
487
|
+
# verify the required parameter 'session_id' is set
|
|
488
|
+
if @api_client.config.client_side_validation && session_id.nil?
|
|
489
|
+
fail ArgumentError, "Missing the required parameter 'session_id' when calling ACPCheckoutApi.update_checkout_session"
|
|
490
|
+
end
|
|
491
|
+
# verify the required parameter 'acp_update_checkout_session_request' is set
|
|
492
|
+
if @api_client.config.client_side_validation && acp_update_checkout_session_request.nil?
|
|
493
|
+
fail ArgumentError, "Missing the required parameter 'acp_update_checkout_session_request' when calling ACPCheckoutApi.update_checkout_session"
|
|
494
|
+
end
|
|
495
|
+
# resource path
|
|
496
|
+
local_var_path = 'icc/v1/checkout_sessions/{session_id}'.sub('{' + 'session_id' + '}', session_id.to_s)
|
|
497
|
+
|
|
498
|
+
# query parameters
|
|
499
|
+
query_params = {}
|
|
500
|
+
|
|
501
|
+
# header parameters
|
|
502
|
+
header_params = {}
|
|
503
|
+
# HTTP header 'Accept' (if needed)
|
|
504
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
505
|
+
# HTTP header 'Content-Type'
|
|
506
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
507
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
508
|
+
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
|
|
509
|
+
header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?
|
|
510
|
+
header_params[:'Request-Id'] = opts[:'request_id'] if !opts[:'request_id'].nil?
|
|
511
|
+
header_params[:'Signature'] = opts[:'signature'] if !opts[:'signature'].nil?
|
|
512
|
+
header_params[:'Timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
|
|
513
|
+
header_params[:'API-Version'] = opts[:'api_version'] if !opts[:'api_version'].nil?
|
|
514
|
+
|
|
515
|
+
# form parameters
|
|
516
|
+
form_params = {}
|
|
517
|
+
|
|
518
|
+
# http body (model)
|
|
519
|
+
post_body = @api_client.object_to_http_body(acp_update_checkout_session_request)
|
|
520
|
+
sdk_tracker = SdkTracker.new
|
|
521
|
+
post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AcpUpdateCheckoutSessionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
|
|
522
|
+
inbound_mle_status = "mandatory"
|
|
523
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["update_checkout_session","update_checkout_session_with_http_info"])
|
|
524
|
+
begin
|
|
525
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
526
|
+
rescue
|
|
527
|
+
raise
|
|
528
|
+
end
|
|
529
|
+
end
|
|
530
|
+
|
|
531
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["update_checkout_session","update_checkout_session_with_http_info"])
|
|
532
|
+
|
|
533
|
+
auth_names = []
|
|
534
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
535
|
+
:header_params => header_params,
|
|
536
|
+
:query_params => query_params,
|
|
537
|
+
:form_params => form_params,
|
|
538
|
+
:body => post_body,
|
|
539
|
+
:auth_names => auth_names,
|
|
540
|
+
:return_type => 'InlineResponse20112',
|
|
541
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
542
|
+
if @api_client.config.debugging
|
|
543
|
+
begin
|
|
544
|
+
raise
|
|
545
|
+
@api_client.config.logger.debug "API called: ACPCheckoutApi#update_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
546
|
+
rescue
|
|
547
|
+
puts 'Cannot write to log'
|
|
548
|
+
end
|
|
549
|
+
end
|
|
550
|
+
return data, status_code, headers
|
|
551
|
+
end
|
|
552
|
+
end
|
|
553
|
+
end
|