Class: StickyIoRestfulApiV2025731::PaymentTypesMethodsController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/controllers/payment_types_methods_controller.rb

Overview

PaymentTypesMethodsController

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, user_agent_parameters

Constructor Details

This class inherits a constructor from StickyIoRestfulApiV2025731::BaseController

Instance Method Details

#get_payment_methods(search_is_cc_brand, domain, v2_ext) ⇒ ApiResponse

Fetch a list of all payment methods **Response Data**\ Response parameters expected in payment method object contained within the ‘data` field array: | Field | Data Type | Description | - | - | - | | id | Integer | The payment method ID. | name | String | The payment method name. | description | String | The payment method description. | is_cc_brand | Integer Flag | Determines whether or not the payment method type is CC (Credit Card). description here

Parameters:

  • search_is_cc_brand (Integer)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/sticky_io_restful_api_v2025731/controllers/payment_types_methods_controller.rb', line 57

def get_payment_methods(search_is_cc_brand,
                        domain,
                        v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}payments/methods',
                                 Server::SERVER_1)
               .query_param(new_parameter(search_is_cc_brand, key: 'search[is_cc_brand]')
                             .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetPaymentMethodsWithSearch.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_payment_types(domain, v2_ext) ⇒ ApiResponse

Fetch a list of all payment method types **Response Data**\ Response parameters expected in payment method type object contained within the ‘data` field array: | Field | Data Type | Description | - | - | - | | id | Integer | The payment method type ID. | value | String | The payment method type name.

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/sticky_io_restful_api_v2025731/controllers/payment_types_methods_controller.rb', line 20

def get_payment_types(domain,
                      v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}payments/types',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetPaymentTypes.method(:from_hash))
                .is_api_response(true))
    .execute
end