Class: CheckoutSdk::Payments::PaymentsClient
- Inherits:
-
BasePaymentsClient
- Object
- Client
- BasePaymentsClient
- CheckoutSdk::Payments::PaymentsClient
- Defined in:
- lib/checkout_sdk/payments/payments_client.rb
Constant Summary
Constants inherited from BasePaymentsClient
BasePaymentsClient::PAYMENTS_PATH
Instance Attribute Summary
Attributes inherited from Client
#api_client, #authorization_type, #configuration
Instance Method Summary collapse
- #capture_payment(payment_id, capture_request = nil, idempotency_key = nil) ⇒ Object
- #increment_payment_authorization(payment_id, authorization_request = nil, idempotency_key = nil) ⇒ Object
-
#initialize(api_client, configuration) ⇒ PaymentsClient
constructor
A new instance of PaymentsClient.
- #request_payment(payment_request, idempotency_key = nil) ⇒ Object
- #request_payout(payout_request, idempotency_key = nil) ⇒ Object
Methods inherited from BasePaymentsClient
#get_payment_actions, #get_payment_details, #get_payments_list, #refund_payment, #reverse_payment, #void_payment
Constructor Details
#initialize(api_client, configuration) ⇒ PaymentsClient
Returns a new instance of PaymentsClient.
8 9 10 |
# File 'lib/checkout_sdk/payments/payments_client.rb', line 8 def initialize(api_client, configuration) super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH end |
Instance Method Details
#capture_payment(payment_id, capture_request = nil, idempotency_key = nil) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/checkout_sdk/payments/payments_client.rb', line 33 def capture_payment(payment_id, capture_request = nil, idempotency_key = nil) api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'captures'), , capture_request, idempotency_key) end |
#increment_payment_authorization(payment_id, authorization_request = nil, idempotency_key = nil) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/checkout_sdk/payments/payments_client.rb', line 43 def (payment_id, = nil, idempotency_key = nil) api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'authorizations'), , , idempotency_key) end |
#request_payment(payment_request, idempotency_key = nil) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/checkout_sdk/payments/payments_client.rb', line 14 def request_payment(payment_request, idempotency_key = nil) api_client.invoke_post(PAYMENTS_PATH, , payment_request, idempotency_key) end |
#request_payout(payout_request, idempotency_key = nil) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/checkout_sdk/payments/payments_client.rb', line 23 def request_payout(payout_request, idempotency_key = nil) api_client.invoke_post(PAYMENTS_PATH, , payout_request, idempotency_key) end |