Class: Ingenico::Connect::SDK::Merchant::Disputes::DisputesClient

Inherits:
ApiResource
  • Object
show all
Defined in:
lib/ingenico/connect/sdk/merchant/disputes/disputes_client.rb

Overview

Disputes client. Thread-safe.

Instance Attribute Summary

Attributes inherited from ApiResource

#client_meta_info, #communicator

Instance Method Summary collapse

Constructor Details

#initialize(parent, path_context) ⇒ DisputesClient

Returns a new instance of DisputesClient.

Parameters:



20
21
22
# File 'lib/ingenico/connect/sdk/merchant/disputes/disputes_client.rb', line 20

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

Instance Method Details

#cancel(dispute_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse

Resource /{merchantId}/disputes/{disputeId}/cancel - Cancel dispute

Parameters:

Returns:

Raises:



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/ingenico/connect/sdk/merchant/disputes/disputes_client.rb', line 98

def cancel(dispute_id, context=nil)
  path_context = {
    'disputeId'.freeze => dispute_id,
  }
  uri = instantiate_uri('/v1/{merchantId}/disputes/{disputeId}/cancel', path_context)
  return @communicator.post(
    uri,
    client_headers,
    nil,
    nil,
    Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse,
    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(dispute_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse

Resource /{merchantId}/disputes/{disputeId} - Get dispute

Parameters:

Returns:

Raises:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/ingenico/connect/sdk/merchant/disputes/disputes_client.rb', line 37

def get(dispute_id, context=nil)
  path_context = {
    'disputeId'.freeze => dispute_id,
  }
  uri = instantiate_uri('/v1/{merchantId}/disputes/{disputeId}', path_context)
  return @communicator.get(
    uri,
    client_headers,
    nil,
    Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse,
    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

#submit(dispute_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse

Resource /{merchantId}/disputes/{disputeId}/submit - Submit dispute

Parameters:

Returns:

Raises:



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/ingenico/connect/sdk/merchant/disputes/disputes_client.rb', line 67

def submit(dispute_id, context=nil)
  path_context = {
    'disputeId'.freeze => dispute_id,
  }
  uri = instantiate_uri('/v1/{merchantId}/disputes/{disputeId}/submit', path_context)
  return @communicator.post(
    uri,
    client_headers,
    nil,
    nil,
    Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse,
    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

#upload_file(dispute_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Dispute::UploadDisputeFileResponse

Resource /{merchantId}/disputes/{disputeId} - Upload File

Parameters:

Returns:

Raises:



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/ingenico/connect/sdk/merchant/disputes/disputes_client.rb', line 130

def upload_file(dispute_id, body, context=nil)
  path_context = {
    'disputeId'.freeze => dispute_id,
  }
  uri = instantiate_uri('/files/v1/{merchantId}/disputes/{disputeId}', path_context)
  return @communicator.post(
    uri,
    client_headers,
    nil,
    body,
    Ingenico::Connect::SDK::Domain::Dispute::UploadDisputeFileResponse,
    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