Class: OnlinePayments::SDK::Merchant::Refunds::RefundsClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- OnlinePayments::SDK::Merchant::Refunds::RefundsClient
- Defined in:
- lib/onlinepayments/sdk/merchant/refunds/refunds_client.rb
Overview
Refunds client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
#client_meta_info, #communicator
Instance Method Summary collapse
-
#get_refunds(payment_id, context = nil) ⇒ OnlinePayments::SDK::Domain::RefundsResponse
Resource /v2/{merchantId}/payments/{paymentId}/refunds - Get refunds of payment.
-
#initialize(parent, path_context) ⇒ RefundsClient
constructor
A new instance of RefundsClient.
Constructor Details
#initialize(parent, path_context) ⇒ RefundsClient
Returns a new instance of RefundsClient.
19 20 21 |
# File 'lib/onlinepayments/sdk/merchant/refunds/refunds_client.rb', line 19 def initialize(parent, path_context) super(parent: parent, path_context: path_context) end |
Instance Method Details
#get_refunds(payment_id, context = nil) ⇒ OnlinePayments::SDK::Domain::RefundsResponse
Resource /v2/{merchantId}/payments/{paymentId}/refunds - Get refunds of payment
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/onlinepayments/sdk/merchant/refunds/refunds_client.rb', line 37 def get_refunds(payment_id, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}/refunds', path_context) @communicator.get( uri, client_headers, nil, OnlinePayments::SDK::Domain::RefundsResponse, context) rescue OnlinePayments::SDK::Communication::ResponseException => e error_type = OnlinePayments::SDK::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise OnlinePayments::SDK.create_exception(e.status_code, e.body, error_object, context) end |