Class: Worldline::Connect::SDK::V1::Merchant::Hostedmandatemanagements::HostedmandatemanagementsClient

Inherits:
ApiResource
  • Object
show all
Defined in:
lib/worldline/connect/sdk/v1/merchant/hostedmandatemanagements/hostedmandatemanagements_client.rb

Overview

Hostedmandatemanagements client. Thread-safe.

Instance Attribute Summary

Attributes inherited from ApiResource

#client_meta_info, #communicator

Instance Method Summary collapse

Constructor Details

#initialize(parent, path_context) ⇒ HostedmandatemanagementsClient

Returns a new instance of HostedmandatemanagementsClient.

Parameters:



23
24
25
# File 'lib/worldline/connect/sdk/v1/merchant/hostedmandatemanagements/hostedmandatemanagements_client.rb', line 23

def initialize(parent, path_context)
  super(parent: parent, path_context: path_context)
end

Instance Method Details

#create(body, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::CreateHostedMandateManagementResponse

Resource /{merchantId}/hostedmandatemanagements - Create hosted mandate management

Parameters:

Returns:

Raises:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/worldline/connect/sdk/v1/merchant/hostedmandatemanagements/hostedmandatemanagements_client.rb', line 40

def create(body, context = nil)
  uri = instantiate_uri('/v1/{merchantId}/hostedmandatemanagements', nil)
  @communicator.post(
    uri,
    client_headers,
    nil,
    body,
    Worldline::Connect::SDK::V1::Domain::CreateHostedMandateManagementResponse,
    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(hosted_mandate_management_id, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::GetHostedMandateManagementResponse

Resource /{merchantId}/hostedmandatemanagements/{hostedMandateManagementId} - Get hosted mandate management status

Parameters:

Returns:

Raises:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/worldline/connect/sdk/v1/merchant/hostedmandatemanagements/hostedmandatemanagements_client.rb', line 68

def get(hosted_mandate_management_id, context = nil)
  path_context = {
    'hostedMandateManagementId'.freeze => hosted_mandate_management_id,
  }
  uri = instantiate_uri('/v1/{merchantId}/hostedmandatemanagements/{hostedMandateManagementId}', path_context)
  @communicator.get(
    uri,
    client_headers,
    nil,
    Worldline::Connect::SDK::V1::Domain::GetHostedMandateManagementResponse,
    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