Class: CheckoutSdk::Payments::PaymentSetupsClient
- Defined in:
- lib/checkout_sdk/payments/setups/payment_setups_client.rb
Overview
Client for Payment Setups API operations
- Beta
Constant Summary collapse
- PAYMENTS_PATH =
'payments'- SETUPS_PATH =
'setups'- CONFIRM_PATH =
'confirm'
Instance Attribute Summary
Attributes inherited from Client
#api_client, #authorization_type, #configuration
Instance Method Summary collapse
-
#confirm_payment_setup(id, payment_method_option_id) ⇒ Object
Confirms a Payment Setup to begin processing the payment request with your chosen payment method option.
-
#create_payment_setup(payment_setups_request) ⇒ Object
Creates a Payment Setup.
-
#get_payment_setup(id) ⇒ Object
Retrieves a Payment Setup.
-
#initialize(api_client, configuration) ⇒ PaymentSetupsClient
constructor
A new instance of PaymentSetupsClient.
-
#update_payment_setup(id, payment_setups_request) ⇒ Object
Updates a Payment Setup.
Constructor Details
#initialize(api_client, configuration) ⇒ PaymentSetupsClient
Returns a new instance of PaymentSetupsClient.
14 15 16 |
# File 'lib/checkout_sdk/payments/setups/payment_setups_client.rb', line 14 def initialize(api_client, configuration) super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH) end |
Instance Method Details
#confirm_payment_setup(id, payment_method_option_id) ⇒ Object
Confirms a Payment Setup to begin processing the payment request with your chosen payment method option.
- Beta
-
to process the payment with
67 68 69 70 71 72 |
# File 'lib/checkout_sdk/payments/setups/payment_setups_client.rb', line 67 def confirm_payment_setup(id, payment_method_option_id) api_client.invoke_post( build_path(PAYMENTS_PATH, SETUPS_PATH, id, CONFIRM_PATH, payment_method_option_id), ) end |
#create_payment_setup(payment_setups_request) ⇒ Object
Creates a Payment Setup. To maximize the amount of information the payment setup can use, we recommend that you create a payment setup as early as possible in the customer’s journey. For example, the first time they land on the basket page.
- Beta
25 26 27 28 29 30 31 |
# File 'lib/checkout_sdk/payments/setups/payment_setups_client.rb', line 25 def create_payment_setup(payment_setups_request) api_client.invoke_post( build_path(PAYMENTS_PATH, SETUPS_PATH), , payment_setups_request ) end |
#get_payment_setup(id) ⇒ Object
Retrieves a Payment Setup.
- Beta
53 54 55 56 57 58 |
# File 'lib/checkout_sdk/payments/setups/payment_setups_client.rb', line 53 def get_payment_setup(id) api_client.invoke_get( build_path(PAYMENTS_PATH, SETUPS_PATH, id), ) end |
#update_payment_setup(id, payment_setups_request) ⇒ Object
Updates a Payment Setup. You should update the payment setup whenever there are significant changes in the data relevant to the customer’s transaction. For example, when the customer makes a change that impacts the total payment amount.
- Beta
41 42 43 44 45 46 47 |
# File 'lib/checkout_sdk/payments/setups/payment_setups_client.rb', line 41 def update_payment_setup(id, payment_setups_request) api_client.invoke_put( build_path(PAYMENTS_PATH, SETUPS_PATH, id), , payment_setups_request ) end |