Class: Ingenico::Connect::SDK::Merchant::Hostedcheckouts::HostedcheckoutsClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- Ingenico::Connect::SDK::Merchant::Hostedcheckouts::HostedcheckoutsClient
- Defined in:
- lib/ingenico/connect/sdk/merchant/hostedcheckouts/hostedcheckouts_client.rb
Overview
Hostedcheckouts client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
#client_meta_info, #communicator
Instance Method Summary collapse
-
#create(body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Hostedcheckout::CreateHostedCheckoutResponse
Resource /{merchantId}/hostedcheckouts - Create hosted checkout.
-
#delete(hosted_checkout_id, context = nil) ⇒ Object
Resource /{merchantId}/hostedcheckouts/{hostedCheckoutId} - Delete hosted checkout.
-
#get(hosted_checkout_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Hostedcheckout::GetHostedCheckoutResponse
Resource /{merchantId}/hostedcheckouts/{hostedCheckoutId} - Get hosted checkout status.
-
#initialize(parent, path_context) ⇒ HostedcheckoutsClient
constructor
A new instance of HostedcheckoutsClient.
Constructor Details
#initialize(parent, path_context) ⇒ HostedcheckoutsClient
Returns a new instance of HostedcheckoutsClient.
21 22 23 |
# File 'lib/ingenico/connect/sdk/merchant/hostedcheckouts/hostedcheckouts_client.rb', line 21 def initialize(parent, path_context) super(parent, path_context) end |
Instance Method Details
#create(body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Hostedcheckout::CreateHostedCheckoutResponse
Resource /{merchantId}/hostedcheckouts - Create hosted checkout
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ingenico/connect/sdk/merchant/hostedcheckouts/hostedcheckouts_client.rb', line 38 def create(body, context = nil) uri = instantiate_uri('/v1/{merchantId}/hostedcheckouts', nil) @communicator.post( uri, client_headers, nil, body, Ingenico::Connect::SDK::Domain::Hostedcheckout::CreateHostedCheckoutResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#delete(hosted_checkout_id, context = nil) ⇒ Object
Resource /{merchantId}/hostedcheckouts/{hostedCheckoutId} - Delete hosted checkout
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/ingenico/connect/sdk/merchant/hostedcheckouts/hostedcheckouts_client.rb', line 95 def delete(hosted_checkout_id, context = nil) path_context = { 'hostedCheckoutId'.freeze => hosted_checkout_id, } uri = instantiate_uri('/v1/{merchantId}/hostedcheckouts/{hostedCheckoutId}', path_context) @communicator.delete( uri, client_headers, nil, nil, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#get(hosted_checkout_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Hostedcheckout::GetHostedCheckoutResponse
Resource /{merchantId}/hostedcheckouts/{hostedCheckoutId} - Get hosted checkout status
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/ingenico/connect/sdk/merchant/hostedcheckouts/hostedcheckouts_client.rb', line 66 def get(hosted_checkout_id, context = nil) path_context = { 'hostedCheckoutId'.freeze => hosted_checkout_id, } uri = instantiate_uri('/v1/{merchantId}/hostedcheckouts/{hostedCheckoutId}', path_context) @communicator.get( uri, client_headers, nil, Ingenico::Connect::SDK::Domain::Hostedcheckout::GetHostedCheckoutResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |