Class: CheckoutSdk::Payments::PaymentSessionsClient

Inherits:
Client
  • Object
show all
Defined in:
lib/checkout_sdk/payments/sessions/payment_sessions_client.rb

Constant Summary collapse

PAYMENT_SESSIONS =
'payment-sessions'

Instance Attribute Summary

Attributes inherited from Client

#api_client, #authorization_type, #configuration

Instance Method Summary collapse

Constructor Details

#initialize(api_client, configuration) ⇒ PaymentSessionsClient

Returns a new instance of PaymentSessionsClient.

Parameters:



12
13
14
# File 'lib/checkout_sdk/payments/sessions/payment_sessions_client.rb', line 12

def initialize(api_client, configuration)
  super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY)
end

Instance Method Details

#create_and_complete_payment_sessions(payment_sessions_request) ⇒ Object

Create and immediately submit a payment session. POST /payment-sessions/complete.

Parameters:

  • payment_sessions_request (Hash)


23
24
25
26
27
28
29
# File 'lib/checkout_sdk/payments/sessions/payment_sessions_client.rb', line 23

def create_and_complete_payment_sessions(payment_sessions_request)
  api_client.invoke_post(
    build_path(PAYMENT_SESSIONS, COMPLETE),
    sdk_authorization,
    payment_sessions_request
  )
end

#create_payment_sessions(payment_sessions) ⇒ Object

Parameters:



17
18
19
# File 'lib/checkout_sdk/payments/sessions/payment_sessions_client.rb', line 17

def create_payment_sessions(payment_sessions)
  api_client.invoke_post(PAYMENT_SESSIONS, sdk_authorization, payment_sessions)
end