Class: Checkbook::Payment

Inherits:
Object
  • Object
show all
Defined in:
lib/checkbook/models/payment.rb,
lib/checkbook/api/payment.rb

Overview

Payment fields

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Payment

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



55
56
57
# File 'lib/checkbook/models/payment.rb', line 55

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/checkbook/api/payment.rb', line 17

def api_client
  @api_client
end

#expirationObject

Payment expiration



20
21
22
# File 'lib/checkbook/models/payment.rb', line 20

def expiration
  @expiration
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/checkbook/models/payment.rb', line 160

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = ::Checkbook.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



30
31
32
# File 'lib/checkbook/models/payment.rb', line 30

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



35
36
37
# File 'lib/checkbook/models/payment.rb', line 35

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



23
24
25
26
27
# File 'lib/checkbook/models/payment.rb', line 23

def self.attribute_map
  {
    :'expiration' => :'expiration'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/checkbook/models/payment.rb', line 136

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



47
48
49
50
51
# File 'lib/checkbook/models/payment.rb', line 47

def self.openapi_nullable
  Set.new([
    :'expiration'
  ])
end

.openapi_typesObject

Attribute type mapping.



40
41
42
43
44
# File 'lib/checkbook/models/payment.rb', line 40

def self.openapi_types
  {
    :'expiration' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



115
116
117
118
119
# File 'lib/checkbook/models/payment.rb', line 115

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      expiration == o.expiration
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/checkbook/models/payment.rb', line 231

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#delete_check(check_id, opts = {}) ⇒ nil

Void a payment Void the specified payment

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/checkbook/api/payment.rb', line 27

def delete_check(check_id, opts = {})
  delete_check_with_http_info(check_id, opts)
  nil
end

#delete_check_with_http_info(check_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Void a payment Void the specified payment

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/checkbook/api/payment.rb', line 37

def delete_check_with_http_info(check_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.delete_check ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.delete_check"
  end
  # resource path
  local_var_path = '/v3/check/{check_id}'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.delete_check",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#delete_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


123
124
125
# File 'lib/checkbook/models/payment.rb', line 123

def eql?(o)
  self == o
end

#get_check(check_id, opts = {}) ⇒ GetCheckResponse

Get payment Get the specified payment

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



90
91
92
93
# File 'lib/checkbook/api/payment.rb', line 90

def get_check(check_id, opts = {})
  data, _status_code, _headers = get_check_with_http_info(check_id, opts)
  data
end

#get_check_attachment(check_id, opts = {}) ⇒ File

Get attachment for a payment Get the attachment for a payment

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (File)


153
154
155
156
# File 'lib/checkbook/api/payment.rb', line 153

def get_check_attachment(check_id, opts = {})
  data, _status_code, _headers = get_check_attachment_with_http_info(check_id, opts)
  data
end

#get_check_attachment_with_http_info(check_id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Get attachment for a payment Get the attachment for a payment

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(File, Integer, Hash)>)

    File data, response status code and response headers



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/checkbook/api/payment.rb', line 163

def get_check_attachment_with_http_info(check_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.get_check_attachment ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.get_check_attachment"
  end
  # resource path
  local_var_path = '/v3/check/{check_id}/attachment'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.get_check_attachment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#get_check_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_check_deposit(check_id, opts = {}) ⇒ GetCheckDepositedResponse

Get deposit details Get details on a deposited payment

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



216
217
218
219
# File 'lib/checkbook/api/payment.rb', line 216

def get_check_deposit(check_id, opts = {})
  data, _status_code, _headers = get_check_deposit_with_http_info(check_id, opts)
  data
end

#get_check_deposit_with_http_info(check_id, opts = {}) ⇒ Array<(GetCheckDepositedResponse, Integer, Hash)>

Get deposit details Get details on a deposited payment

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetCheckDepositedResponse, Integer, Hash)>)

    GetCheckDepositedResponse data, response status code and response headers



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/checkbook/api/payment.rb', line 226

def get_check_deposit_with_http_info(check_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.get_check_deposit ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.get_check_deposit"
  end
  # resource path
  local_var_path = '/v3/check/{check_id}/deposit'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetCheckDepositedResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.get_check_deposit",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#get_check_deposit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_check_fail(check_id, opts = {}) ⇒ GetCheckFailedResponse

Get details on failed payment Get details on a failed payment

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



279
280
281
282
# File 'lib/checkbook/api/payment.rb', line 279

def get_check_fail(check_id, opts = {})
  data, _status_code, _headers = get_check_fail_with_http_info(check_id, opts)
  data
end

#get_check_fail_with_http_info(check_id, opts = {}) ⇒ Array<(GetCheckFailedResponse, Integer, Hash)>

Get details on failed payment Get details on a failed payment

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetCheckFailedResponse, Integer, Hash)>)

    GetCheckFailedResponse data, response status code and response headers



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/checkbook/api/payment.rb', line 289

def get_check_fail_with_http_info(check_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.get_check_fail ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.get_check_fail"
  end
  # resource path
  local_var_path = '/v3/check/{check_id}/fail'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetCheckFailedResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.get_check_fail",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#get_check_fail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_check_tracking(check_id, opts = {}) ⇒ GetCheckTrackingResponseExpress

Get tracking details on mailed check Get tracking details on a mailed check

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



342
343
344
345
# File 'lib/checkbook/api/payment.rb', line 342

def get_check_tracking(check_id, opts = {})
  data, _status_code, _headers = get_check_tracking_with_http_info(check_id, opts)
  data
end

#get_check_tracking_with_http_info(check_id, opts = {}) ⇒ Array<(GetCheckTrackingResponseExpress, Integer, Hash)>

Get tracking details on mailed check Get tracking details on a mailed check

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/checkbook/api/payment.rb', line 352

def get_check_tracking_with_http_info(check_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.get_check_tracking ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.get_check_tracking"
  end
  # resource path
  local_var_path = '/v3/check/{check_id}/tracking'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetCheckTrackingResponseExpress'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.get_check_tracking",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#get_check_tracking\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_check_verification(check_id, opts = {}) ⇒ VerifyCheckResponse

Get verification code Get the verification code

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



405
406
407
408
# File 'lib/checkbook/api/payment.rb', line 405

def get_check_verification(check_id, opts = {})
  data, _status_code, _headers = get_check_verification_with_http_info(check_id, opts)
  data
end

#get_check_verification_with_http_info(check_id, opts = {}) ⇒ Array<(VerifyCheckResponse, Integer, Hash)>

Get verification code Get the verification code

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(VerifyCheckResponse, Integer, Hash)>)

    VerifyCheckResponse data, response status code and response headers



415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/checkbook/api/payment.rb', line 415

def get_check_verification_with_http_info(check_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.get_check_verification ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.get_check_verification"
  end
  # resource path
  local_var_path = '/v3/check/{check_id}/verification'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VerifyCheckResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.get_check_verification",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#get_check_verification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_check_with_http_info(check_id, opts = {}) ⇒ Array<(GetCheckResponse, Integer, Hash)>

Get payment Get the specified payment

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetCheckResponse, Integer, Hash)>)

    GetCheckResponse data, response status code and response headers



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/checkbook/api/payment.rb', line 100

def get_check_with_http_info(check_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.get_check ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.get_check"
  end
  # resource path
  local_var_path = '/v3/check/{check_id}'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetCheckResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.get_check",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#get_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_checks(opts = {}) ⇒ GetChecksResponse

Get sent/received payments Return the sent/received payments

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :direction (String)

    Direction

  • :end_date (Date)

    End date

  • :page (Integer)

    Page number (default to 1)

  • :per_page (Integer)

    Items per page (default to 50)

  • :q (String)

    Query

  • :sort (String)

    Sort

  • :start_date (Date)

    Start date

  • :status (String)

    Status

Returns:



475
476
477
478
# File 'lib/checkbook/api/payment.rb', line 475

def get_checks(opts = {})
  data, _status_code, _headers = get_checks_with_http_info(opts)
  data
end

#get_checks_with_http_info(opts = {}) ⇒ Array<(GetChecksResponse, Integer, Hash)>

Get sent/received payments Return the sent/received payments

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :direction (String)

    Direction

  • :end_date (Date)

    End date

  • :page (Integer)

    Page number (default to 1)

  • :per_page (Integer)

    Items per page (default to 50)

  • :q (String)

    Query

  • :sort (String)

    Sort

  • :start_date (Date)

    Start date

  • :status (String)

    Status

Returns:

  • (Array<(GetChecksResponse, Integer, Hash)>)

    GetChecksResponse data, response status code and response headers



492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
# File 'lib/checkbook/api/payment.rb', line 492

def get_checks_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.get_checks ...'
  end
  allowable_values = ["INCOMING", "OUTGOING"]
  if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction'])
    fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling Payment.get_checks, must be greater than or equal to 1.'
  end

  allowable_values = [10, 25, 50, 100, 250]
  if @api_client.config.client_side_validation && opts[:'per_page'] && !allowable_values.include?(opts[:'per_page'])
    fail ArgumentError, "invalid value for \"per_page\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'q'].nil? && opts[:'q'].to_s.length > 180
    fail ArgumentError, 'invalid value for "opts[:"q"]" when calling Payment.get_checks, the character length must be smaller than or equal to 180.'
  end

  allowable_values = ["+NUMBER", "-NUMBER", "+TYPE", "-TYPE", "+AMOUNT", "-AMOUNT", "+STATUS", "-STATUS", "+DATE", "-DATE", "+UPDATE", "-UPDATE", "+DESCRIPTION", "-DESCRIPTION"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["PAID", "IN_PROCESS", "UNPAID", "VOID", "EXPIRED", "PRINTED", "MAILED", "FAILED", "REFUNDED"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v3/check'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetChecksResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.get_checks",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#get_checks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



129
130
131
# File 'lib/checkbook/models/payment.rb', line 129

def hash
  [expiration].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/checkbook/models/payment.rb', line 76

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if !@expiration.nil? && @expiration > 180
    invalid_properties.push('invalid value for "expiration", must be smaller than or equal to 180.')
  end

  if !@expiration.nil? && @expiration < 10
    invalid_properties.push('invalid value for "expiration", must be greater than or equal to 10.')
  end

  invalid_properties
end

#post_check_deposit(check_id, deposit_check_request, opts = {}) ⇒ GetCheckResponse

Deposit a payment Deposit a payment

Parameters:

  • check_id (String)
  • deposit_check_request (DepositCheckRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



574
575
576
577
# File 'lib/checkbook/api/payment.rb', line 574

def post_check_deposit(check_id, deposit_check_request, opts = {})
  data, _status_code, _headers = post_check_deposit_with_http_info(check_id, deposit_check_request, opts)
  data
end

#post_check_deposit_with_http_info(check_id, deposit_check_request, opts = {}) ⇒ Array<(GetCheckResponse, Integer, Hash)>

Deposit a payment Deposit a payment

Parameters:

  • check_id (String)
  • deposit_check_request (DepositCheckRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetCheckResponse, Integer, Hash)>)

    GetCheckResponse data, response status code and response headers



585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
# File 'lib/checkbook/api/payment.rb', line 585

def post_check_deposit_with_http_info(check_id, deposit_check_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.post_check_deposit ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.post_check_deposit"
  end
  # verify the required parameter 'deposit_check_request' is set
  if @api_client.config.client_side_validation && deposit_check_request.nil?
    fail ArgumentError, "Missing the required parameter 'deposit_check_request' when calling Payment.post_check_deposit"
  end
  # resource path
  local_var_path = '/v3/check/deposit/{check_id}'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(deposit_check_request)

  # return_type
  return_type = opts[:debug_return_type] || 'GetCheckResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.post_check_deposit",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#post_check_deposit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_check_digital(create_digital_check_request, opts = {}) ⇒ GetCheckResponse

Create a digital payment Create a digital payment > [!NOTE] > **Common Errors** > > - **‘Invalid deposit option`:** If deposit options do not include `PRINT`, `MAIL`, or `BANK`, please ensure the payment is funded by a wallet. If you still encounter this error, please contact support@checkbook.io to ensure the specified payment rails are enabled for your account. > - **`Amount is larger than $2000 and requires signature`:** Please add a signature to the sender using [`v3/user/signature`](#tag/user/post/v3/user/signature). A signature is required for users to send out payments over $2000.

Parameters:

Returns:



647
648
649
650
# File 'lib/checkbook/api/payment.rb', line 647

def post_check_digital(create_digital_check_request, opts = {})
  data, _status_code, _headers = post_check_digital_with_http_info(create_digital_check_request, opts)
  data
end

#post_check_digital_with_http_info(create_digital_check_request, opts = {}) ⇒ Array<(GetCheckResponse, Integer, Hash)>

Create a digital payment Create a digital payment &gt; [!NOTE] &gt; **Common Errors** &gt; &gt; - **&#x60;Invalid deposit option&#x60;:** If deposit options do not include &#x60;PRINT&#x60;, &#x60;MAIL&#x60;, or &#x60;BANK&#x60;, please ensure the payment is funded by a wallet. If you still encounter this error, please contact support@checkbook.io to ensure the specified payment rails are enabled for your account. &gt; - **&#x60;Amount is larger than $2000 and requires signature&#x60;:** Please add a signature to the sender using [&#x60;v3/user/signature&#x60;](#tag/user/post/v3/user/signature). A signature is required for users to send out payments over $2000.

Parameters:

Returns:

  • (Array<(GetCheckResponse, Integer, Hash)>)

    GetCheckResponse data, response status code and response headers



657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
# File 'lib/checkbook/api/payment.rb', line 657

def post_check_digital_with_http_info(create_digital_check_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.post_check_digital ...'
  end
  # verify the required parameter 'create_digital_check_request' is set
  if @api_client.config.client_side_validation && create_digital_check_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_digital_check_request' when calling Payment.post_check_digital"
  end
  # resource path
  local_var_path = '/v3/check/digital'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_digital_check_request)

  # return_type
  return_type = opts[:debug_return_type] || 'GetCheckResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.post_check_digital",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#post_check_digital\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_check_endorse(check_id, endorse_check_request, opts = {}) ⇒ nil

Endorse a multi-party payment Endorse a multi party payment

Parameters:

  • check_id (String)
  • endorse_check_request (EndorseCheckRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


716
717
718
719
# File 'lib/checkbook/api/payment.rb', line 716

def post_check_endorse(check_id, endorse_check_request, opts = {})
  post_check_endorse_with_http_info(check_id, endorse_check_request, opts)
  nil
end

#post_check_endorse_with_http_info(check_id, endorse_check_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Endorse a multi-party payment Endorse a multi party payment

Parameters:

  • check_id (String)
  • endorse_check_request (EndorseCheckRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
# File 'lib/checkbook/api/payment.rb', line 727

def post_check_endorse_with_http_info(check_id, endorse_check_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.post_check_endorse ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.post_check_endorse"
  end
  # verify the required parameter 'endorse_check_request' is set
  if @api_client.config.client_side_validation && endorse_check_request.nil?
    fail ArgumentError, "Missing the required parameter 'endorse_check_request' when calling Payment.post_check_endorse"
  end
  # resource path
  local_var_path = '/v3/check/endorse/{check_id}'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(endorse_check_request)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.post_check_endorse",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#post_check_endorse\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_check_multi(create_multi_check_request, opts = {}) ⇒ GetCheckResponse

Create a multi-party payment Create a new multi party payment

Parameters:

Returns:



789
790
791
792
# File 'lib/checkbook/api/payment.rb', line 789

def post_check_multi(create_multi_check_request, opts = {})
  data, _status_code, _headers = post_check_multi_with_http_info(create_multi_check_request, opts)
  data
end

#post_check_multi_with_http_info(create_multi_check_request, opts = {}) ⇒ Array<(GetCheckResponse, Integer, Hash)>

Create a multi-party payment Create a new multi party payment

Parameters:

Returns:

  • (Array<(GetCheckResponse, Integer, Hash)>)

    GetCheckResponse data, response status code and response headers



799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
# File 'lib/checkbook/api/payment.rb', line 799

def post_check_multi_with_http_info(create_multi_check_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.post_check_multi ...'
  end
  # verify the required parameter 'create_multi_check_request' is set
  if @api_client.config.client_side_validation && create_multi_check_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_multi_check_request' when calling Payment.post_check_multi"
  end
  # resource path
  local_var_path = '/v3/check/multi'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_multi_check_request)

  # return_type
  return_type = opts[:debug_return_type] || 'GetCheckResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.post_check_multi",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#post_check_multi\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_check_notify(check_id, opts = {}) ⇒ nil

Resend payment notification Resend payment notification

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


857
858
859
860
# File 'lib/checkbook/api/payment.rb', line 857

def post_check_notify(check_id, opts = {})
  post_check_notify_with_http_info(check_id, opts)
  nil
end

#post_check_notify_with_http_info(check_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Resend payment notification Resend payment notification

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
# File 'lib/checkbook/api/payment.rb', line 867

def post_check_notify_with_http_info(check_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.post_check_notify ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.post_check_notify"
  end
  # resource path
  local_var_path = '/v3/check/notify/{check_id}'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.post_check_notify",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#post_check_notify\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_check_physical(create_physical_check_request, opts = {}) ⇒ GetCheckResponse

Create a physical check Create a new paper check

Parameters:

Returns:



920
921
922
923
# File 'lib/checkbook/api/payment.rb', line 920

def post_check_physical(create_physical_check_request, opts = {})
  data, _status_code, _headers = post_check_physical_with_http_info(create_physical_check_request, opts)
  data
end

#post_check_physical_with_http_info(create_physical_check_request, opts = {}) ⇒ Array<(GetCheckResponse, Integer, Hash)>

Create a physical check Create a new paper check

Parameters:

Returns:

  • (Array<(GetCheckResponse, Integer, Hash)>)

    GetCheckResponse data, response status code and response headers



930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/checkbook/api/payment.rb', line 930

def post_check_physical_with_http_info(create_physical_check_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.post_check_physical ...'
  end
  # verify the required parameter 'create_physical_check_request' is set
  if @api_client.config.client_side_validation && create_physical_check_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_physical_check_request' when calling Payment.post_check_physical"
  end
  # resource path
  local_var_path = '/v3/check/physical'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_physical_check_request)

  # return_type
  return_type = opts[:debug_return_type] || 'GetCheckResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.post_check_physical",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#post_check_physical\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_check_preview(preview_check_request, opts = {}) ⇒ PreviewCheckResponse

Preview payment Preview a new payment

Parameters:

  • preview_check_request (PreviewCheckRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



988
989
990
991
# File 'lib/checkbook/api/payment.rb', line 988

def post_check_preview(preview_check_request, opts = {})
  data, _status_code, _headers = post_check_preview_with_http_info(preview_check_request, opts)
  data
end

#post_check_preview_with_http_info(preview_check_request, opts = {}) ⇒ Array<(PreviewCheckResponse, Integer, Hash)>

Preview payment Preview a new payment

Parameters:

  • preview_check_request (PreviewCheckRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PreviewCheckResponse, Integer, Hash)>)

    PreviewCheckResponse data, response status code and response headers



998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
# File 'lib/checkbook/api/payment.rb', line 998

def post_check_preview_with_http_info(preview_check_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.post_check_preview ...'
  end
  # verify the required parameter 'preview_check_request' is set
  if @api_client.config.client_side_validation && preview_check_request.nil?
    fail ArgumentError, "Missing the required parameter 'preview_check_request' when calling Payment.post_check_preview"
  end
  # resource path
  local_var_path = '/v3/check/preview'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(preview_check_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PreviewCheckResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.post_check_preview",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#post_check_preview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_check_print(check_id, opts = {}) ⇒ File

Print a payment Print a check

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (File)


1056
1057
1058
1059
# File 'lib/checkbook/api/payment.rb', line 1056

def post_check_print(check_id, opts = {})
  data, _status_code, _headers = post_check_print_with_http_info(check_id, opts)
  data
end

#post_check_print_with_http_info(check_id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Print a payment Print a check

Parameters:

  • check_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(File, Integer, Hash)>)

    File data, response status code and response headers



1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
# File 'lib/checkbook/api/payment.rb', line 1066

def post_check_print_with_http_info(check_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.post_check_print ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.post_check_print"
  end
  # resource path
  local_var_path = '/v3/check/print/{check_id}'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.post_check_print",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#post_check_print\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_check_webhook(check_id, trigger_webhook_request, opts = {}) ⇒ nil

Update a sandbox payment status Update a payment’s status in sandbox. Triggers a sandbox check webhook notification.

Parameters:

  • check_id (String)
  • trigger_webhook_request (TriggerWebhookRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1120
1121
1122
1123
# File 'lib/checkbook/api/payment.rb', line 1120

def post_check_webhook(check_id, trigger_webhook_request, opts = {})
  post_check_webhook_with_http_info(check_id, trigger_webhook_request, opts)
  nil
end

#post_check_webhook_with_http_info(check_id, trigger_webhook_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update a sandbox payment status Update a payment&#39;s status in sandbox. Triggers a sandbox check webhook notification.

Parameters:

  • check_id (String)
  • trigger_webhook_request (TriggerWebhookRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
# File 'lib/checkbook/api/payment.rb', line 1131

def post_check_webhook_with_http_info(check_id, trigger_webhook_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: Payment.post_check_webhook ...'
  end
  # verify the required parameter 'check_id' is set
  if @api_client.config.client_side_validation && check_id.nil?
    fail ArgumentError, "Missing the required parameter 'check_id' when calling Payment.post_check_webhook"
  end
  # verify the required parameter 'trigger_webhook_request' is set
  if @api_client.config.client_side_validation && trigger_webhook_request.nil?
    fail ArgumentError, "Missing the required parameter 'trigger_webhook_request' when calling Payment.post_check_webhook"
  end
  # resource path
  local_var_path = '/v3/check/webhook/{check_id}'.sub('{' + 'check_id' + '}', CGI.escape(check_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(trigger_webhook_request)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"Payment.post_check_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: Payment#post_check_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



207
208
209
# File 'lib/checkbook/models/payment.rb', line 207

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/checkbook/models/payment.rb', line 213

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



201
202
203
# File 'lib/checkbook/models/payment.rb', line 201

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



92
93
94
95
96
97
# File 'lib/checkbook/models/payment.rb', line 92

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if !@expiration.nil? && @expiration > 180
  return false if !@expiration.nil? && @expiration < 10
  true
end