Class: OnlinePayments::SDK::Merchant::PaymentLinks::PaymentLinksClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- OnlinePayments::SDK::Merchant::PaymentLinks::PaymentLinksClient
- Defined in:
- lib/onlinepayments/sdk/merchant/paymentlinks/payment_links_client.rb
Overview
PaymentLinks client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
#client_meta_info, #communicator
Instance Method Summary collapse
-
#cancel_payment_link_by_id(payment_link_id, context = nil) ⇒ Object
Resource /v2/{merchantId}/paymentlinks/{paymentLinkId}/cancel.
-
#create_payment_link(body, context = nil) ⇒ OnlinePayments::SDK::Domain::PaymentLinkResponse
Resource /v2/{merchantId}/paymentlinks.
-
#get_payment_link_by_id(payment_link_id, context = nil) ⇒ OnlinePayments::SDK::Domain::PaymentLinkResponse
Resource /v2/{merchantId}/paymentlinks/{paymentLinkId}.
-
#initialize(parent, path_context = nil) ⇒ PaymentLinksClient
constructor
A new instance of PaymentLinksClient.
Constructor Details
#initialize(parent, path_context = nil) ⇒ PaymentLinksClient
Returns a new instance of PaymentLinksClient.
19 20 21 |
# File 'lib/onlinepayments/sdk/merchant/paymentlinks/payment_links_client.rb', line 19 def initialize(parent, path_context = nil) super(parent, path_context) end |
Instance Method Details
#cancel_payment_link_by_id(payment_link_id, context = nil) ⇒ Object
Resource /v2/{merchantId}/paymentlinks/{paymentLinkId}/cancel
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/onlinepayments/sdk/merchant/paymentlinks/payment_links_client.rb', line 95 def cancel_payment_link_by_id(payment_link_id, context = nil) path_context = { 'paymentLinkId'.freeze => payment_link_id, } uri = instantiate_uri('/v2/{merchantId}/paymentlinks/{paymentLinkId}/cancel', path_context) @communicator.post( uri, client_headers, nil, nil, nil, context ) rescue ResponseException => e error_type = OnlinePayments::SDK::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#create_payment_link(body, context = nil) ⇒ OnlinePayments::SDK::Domain::PaymentLinkResponse
Resource /v2/{merchantId}/paymentlinks
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/onlinepayments/sdk/merchant/paymentlinks/payment_links_client.rb', line 36 def create_payment_link(body, context = nil) uri = instantiate_uri('/v2/{merchantId}/paymentlinks') @communicator.post( uri, client_headers, nil, body, OnlinePayments::SDK::Domain::PaymentLinkResponse, context ) rescue ResponseException => e error_type = OnlinePayments::SDK::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#get_payment_link_by_id(payment_link_id, context = nil) ⇒ OnlinePayments::SDK::Domain::PaymentLinkResponse
Resource /v2/{merchantId}/paymentlinks/{paymentLinkId}
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/onlinepayments/sdk/merchant/paymentlinks/payment_links_client.rb', line 65 def get_payment_link_by_id(payment_link_id, context = nil) path_context = { 'paymentLinkId'.freeze => payment_link_id, } uri = instantiate_uri('/v2/{merchantId}/paymentlinks/{paymentLinkId}', path_context) @communicator.get( uri, client_headers, nil, OnlinePayments::SDK::Domain::PaymentLinkResponse, context ) rescue ResponseException => e error_type = OnlinePayments::SDK::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |