Class: CheckoutSdk::Payments::FlowClient
- Defined in:
- lib/checkout_sdk/payments/flow/flow_client.rb
Overview
Client for Payment Flow API operations
- Beta
Constant Summary collapse
- PAYMENT_SESSIONS_PATH =
'payment-sessions'- SUBMIT_PATH =
'submit'- COMPLETE_PATH =
'complete'
Instance Attribute Summary
Attributes inherited from Client
#api_client, #authorization_type, #configuration
Instance Method Summary collapse
-
#initialize(api_client, configuration) ⇒ FlowClient
constructor
A new instance of FlowClient.
-
#request_payment_session(request_payment_session_request) ⇒ Object
Creates a Payment Session.
-
#request_payment_session_with_payment(request_payment_session_with_payment_request) ⇒ Object
Creates and submits a Payment Session in a single request.
-
#submit_payment_session(id, submit_payment_session_request) ⇒ Object
Submits a Payment Session.
Constructor Details
#initialize(api_client, configuration) ⇒ FlowClient
Returns a new instance of FlowClient.
14 15 16 |
# File 'lib/checkout_sdk/payments/flow/flow_client.rb', line 14 def initialize(api_client, configuration) super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH) end |
Instance Method Details
#request_payment_session(request_payment_session_request) ⇒ Object
Creates a Payment Session. Use this endpoint to set up a payment session before collecting payment details from your customer.
- Beta
23 24 25 26 27 28 29 |
# File 'lib/checkout_sdk/payments/flow/flow_client.rb', line 23 def request_payment_session(request_payment_session_request) api_client.invoke_post( build_path(PAYMENT_SESSIONS_PATH), , request_payment_session_request ) end |
#request_payment_session_with_payment(request_payment_session_with_payment_request) ⇒ Object
Creates and submits a Payment Session in a single request. Use this endpoint to create a payment session and immediately process the payment.
- Beta
50 51 52 53 54 55 56 |
# File 'lib/checkout_sdk/payments/flow/flow_client.rb', line 50 def request_payment_session_with_payment(request_payment_session_with_payment_request) api_client.invoke_post( build_path(PAYMENT_SESSIONS_PATH, COMPLETE_PATH), , request_payment_session_with_payment_request ) end |
#submit_payment_session(id, submit_payment_session_request) ⇒ Object
Submits a Payment Session. Use this endpoint to submit payment details and process the payment for an existing session.
- Beta
37 38 39 40 41 42 43 |
# File 'lib/checkout_sdk/payments/flow/flow_client.rb', line 37 def submit_payment_session(id, submit_payment_session_request) api_client.invoke_post( build_path(PAYMENT_SESSIONS_PATH, id, SUBMIT_PATH), , submit_payment_session_request ) end |