Class: Ingenico::Direct::SDK::Merchant::Payouts::PayoutsClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- Ingenico::Direct::SDK::Merchant::Payouts::PayoutsClient
- Defined in:
- lib/ingenico/direct/sdk/merchant/payouts/payouts_client.rb
Overview
Payouts client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
#client_meta_info, #communicator
Instance Method Summary collapse
-
#create_payout(body, context = nil) ⇒ Ingenico::Direct::SDK::Domain::PayoutResponse
Resource /v2/{merchantId}/payouts - Create payout.
-
#get_payout(payout_id, context = nil) ⇒ Ingenico::Direct::SDK::Domain::PayoutResponse
Resource /v2/{merchantId}/payouts/{payoutId} - Get payout.
-
#initialize(parent, path_context = nil) ⇒ PayoutsClient
constructor
A new instance of PayoutsClient.
Constructor Details
#initialize(parent, path_context = nil) ⇒ PayoutsClient
Returns a new instance of PayoutsClient.
21 22 23 |
# File 'lib/ingenico/direct/sdk/merchant/payouts/payouts_client.rb', line 21 def initialize(parent, path_context = nil) super(parent, path_context) end |
Instance Method Details
#create_payout(body, context = nil) ⇒ Ingenico::Direct::SDK::Domain::PayoutResponse
Resource /v2/{merchantId}/payouts - Create payout
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/ingenico/direct/sdk/merchant/payouts/payouts_client.rb', line 38 def create_payout(body, context = nil) uri = instantiate_uri('/v2/{merchantId}/payouts') @communicator.post( uri, client_headers, nil, body, Ingenico::Direct::SDK::Domain::PayoutResponse, context ) rescue ResponseException => e error_type = Ingenico::Direct::SDK::Domain::PayoutErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#get_payout(payout_id, context = nil) ⇒ Ingenico::Direct::SDK::Domain::PayoutResponse
Resource /v2/{merchantId}/payouts/{payoutId} - Get payout
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/ingenico/direct/sdk/merchant/payouts/payouts_client.rb', line 67 def get_payout(payout_id, context = nil) path_context = { 'payoutId'.freeze => payout_id, } uri = instantiate_uri('/v2/{merchantId}/payouts/{payoutId}', path_context) @communicator.get( uri, client_headers, nil, Ingenico::Direct::SDK::Domain::PayoutResponse, context ) rescue ResponseException => e error_type = Ingenico::Direct::SDK::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |