Class: Worldline::Connect::SDK::V1::Merchant::Payouts::PayoutsClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- Worldline::Connect::SDK::V1::Merchant::Payouts::PayoutsClient
- Defined in:
- lib/worldline/connect/sdk/v1/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
-
#approve(payout_id, body, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::PayoutResponse
Resource /{merchantId}/payouts/{payoutId}/approve - Approve payout.
-
#cancel(payout_id, context = nil) ⇒ Object
Resource /{merchantId}/payouts/{payoutId}/cancel - Cancel payout.
-
#cancelapproval(payout_id, context = nil) ⇒ Object
Resource /{merchantId}/payouts/{payoutId}/cancelapproval - Undo approve payout.
-
#create(body, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::PayoutResponse
Resource /{merchantId}/payouts - Create payout.
-
#find(query, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::FindPayoutsResponse
Resource /{merchantId}/payouts - Find payouts.
-
#get(payout_id, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::PayoutResponse
Resource /{merchantId}/payouts/{payoutId} - Get payout.
-
#initialize(parent, path_context) ⇒ PayoutsClient
constructor
A new instance of PayoutsClient.
Constructor Details
#initialize(parent, path_context) ⇒ PayoutsClient
Returns a new instance of PayoutsClient.
24 25 26 |
# File 'lib/worldline/connect/sdk/v1/merchant/payouts/payouts_client.rb', line 24 def initialize(parent, path_context) super(parent: parent, path_context: path_context) end |
Instance Method Details
#approve(payout_id, body, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::PayoutResponse
Resource /{merchantId}/payouts/{payoutId}/approve - Approve payout
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/worldline/connect/sdk/v1/merchant/payouts/payouts_client.rb', line 128 def approve(payout_id, body, context = nil) path_context = { 'payoutId'.freeze => payout_id, } uri = instantiate_uri('/v1/{merchantId}/payouts/{payoutId}/approve', path_context) @communicator.post( uri, client_headers, nil, body, Worldline::Connect::SDK::V1::Domain::PayoutResponse, context) rescue ResponseException => e error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context) end |
#cancel(payout_id, context = nil) ⇒ Object
Resource /{merchantId}/payouts/{payoutId}/cancel - Cancel payout
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/worldline/connect/sdk/v1/merchant/payouts/payouts_client.rb', line 158 def cancel(payout_id, context = nil) path_context = { 'payoutId'.freeze => payout_id, } uri = instantiate_uri('/v1/{merchantId}/payouts/{payoutId}/cancel', path_context) @communicator.post( uri, client_headers, nil, nil, nil, context) rescue ResponseException => e error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context) end |
#cancelapproval(payout_id, context = nil) ⇒ Object
Resource /{merchantId}/payouts/{payoutId}/cancelapproval - Undo approve payout
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/worldline/connect/sdk/v1/merchant/payouts/payouts_client.rb', line 188 def cancelapproval(payout_id, context = nil) path_context = { 'payoutId'.freeze => payout_id, } uri = instantiate_uri('/v1/{merchantId}/payouts/{payoutId}/cancelapproval', path_context) @communicator.post( uri, client_headers, nil, nil, nil, context) rescue ResponseException => e error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context) end |
#create(body, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::PayoutResponse
Resource /{merchantId}/payouts - Create payout
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/worldline/connect/sdk/v1/merchant/payouts/payouts_client.rb', line 42 def create(body, context = nil) uri = instantiate_uri('/v1/{merchantId}/payouts', nil) @communicator.post( uri, client_headers, nil, body, Worldline::Connect::SDK::V1::Domain::PayoutResponse, context) rescue ResponseException => e error_type = Worldline::Connect::SDK::V1::Domain::PayoutErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context) end |
#find(query, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::FindPayoutsResponse
Resource /{merchantId}/payouts - Find payouts
70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/worldline/connect/sdk/v1/merchant/payouts/payouts_client.rb', line 70 def find(query, context = nil) uri = instantiate_uri('/v1/{merchantId}/payouts', nil) @communicator.get( uri, client_headers, query, Worldline::Connect::SDK::V1::Domain::FindPayoutsResponse, context) rescue ResponseException => e error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context) end |
#get(payout_id, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::PayoutResponse
Resource /{merchantId}/payouts/{payoutId} - Get payout
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/worldline/connect/sdk/v1/merchant/payouts/payouts_client.rb', line 97 def get(payout_id, context = nil) path_context = { 'payoutId'.freeze => payout_id, } uri = instantiate_uri('/v1/{merchantId}/payouts/{payoutId}', path_context) @communicator.get( uri, client_headers, nil, Worldline::Connect::SDK::V1::Domain::PayoutResponse, context) rescue ResponseException => e error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context) end |