Class: ModernTreasury::PaymentReferenceController

Inherits:
BaseController show all
Defined in:
lib/modern_treasury/controllers/payment_reference_controller.rb

Overview

PaymentReferenceController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from ModernTreasury::BaseController

Instance Method Details

#get_payment_reference(id) ⇒ PaymentReferenceObject

TODO: type endpoint description here

Parameters:

  • id (String)

    Required parameter: id

Returns:



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/modern_treasury/controllers/payment_reference_controller.rb', line 49

def get_payment_reference(id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/payment_references/{id}',
                                 Server::DEFAULT)
               .template_param(new_parameter(id, key: 'id')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic_auth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(PaymentReferenceObject.method(:from_hash)))
    .execute
end

#list_payment_references(per_page: nil, referenceable_id: nil, referenceable_type: nil, reference_number: nil, after_cursor: nil) ⇒ Array[PaymentReferenceObject]

TODO: type endpoint description here here referenceable to search for. Must be accompanied by the referenceable_type or will return an error. of the referenceable types. This must be accompanied by the id of the referenceable or will return an error. number assigned by the bank. here

Parameters:

  • per_page (Integer) (defaults to: nil)

    Optional parameter: TODO: type description

  • referenceable_id (String) (defaults to: nil)

    Optional parameter: The id of the

  • referenceable_type (ReferenceableType1Enum) (defaults to: nil)

    Optional parameter: One

  • reference_number (String) (defaults to: nil)

    Optional parameter: The actual reference

  • after_cursor (String) (defaults to: nil)

    Optional parameter: TODO: type description

Returns:



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/modern_treasury/controllers/payment_reference_controller.rb', line 23

def list_payment_references(per_page: nil,
                            referenceable_id: nil,
                            referenceable_type: nil,
                            reference_number: nil,
                            after_cursor: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/payment_references',
                                 Server::DEFAULT)
               .query_param(new_parameter(per_page, key: 'per_page'))
               .query_param(new_parameter(referenceable_id, key: 'referenceable_id'))
               .query_param(new_parameter(referenceable_type, key: 'referenceable_type'))
               .query_param(new_parameter(reference_number, key: 'reference_number'))
               .query_param(new_parameter(after_cursor, key: 'after_cursor'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic_auth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(PaymentReferenceObject.method(:from_hash))
                .is_response_array(true))
    .execute
end