Class: StickyIoRestfulApiV2025731::GatewaysController

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

Overview

GatewaysController

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

#add_profile(body, domain, v2_ext, gateway_provider_id) ⇒ ApiResponse

Create a profile for the given payment provider. The correct payment provider ID for the URI can be found using the Get Accounts endpoint. **Request Data** Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | — | — | — | — | — | | alias | Required | - | String(255) | The Profile alias. | | fields | Required | - | Object | Object containing the global_fields, account_fields, and fee_fields for the Profile. | | currency | Optional | 1 | String Flag | The Profile currency (default USD). | | fields.global_fields | Required | - | Object | Object of global fields associated with the Profile. | | fields.global_fields.cancellation_url | Optional | ‘null` | String(255) | The fallback url after a cancellation has been made. | | fields.global_fields.chargeback_fee | Optional | 0 | Numeric | The Profile chargeback fee. | | fields.global_fields.customer_service_email | Optional | `null` | String(255) | The Profile customer service email. | | fields.global_fields.customer_service_email_from | Optional | `null` | String(255) | The Profile email from used when emails are sended. | | fields.global_fields.customer_service_number | Required | - | String(30) | The Profile customer service number. | | fields.global_fields.cvv | Optional | `null` | Integer Flag | Specifies the Profile’s type of CVV. | | fields.global_fields.descriptor | Required | - | String(255) | The Profile descriptor. | | fields.global_fields.global_monthly_cap | Required | - | Numeric | The Profile maximum monthly amount. | | fields.global_fields.merchant_id | Required | - | String(255) | The Profile merchant id (can be an ID, UUID or string). | | fields.global_fields.mid_group | Optional | ‘null` | String | The profile group used for traffic balancing. | | fields.global_fields.processor | Optional | `null` | Integer Flag | The Profile processor id. | | fields.global_fields.reserve_cap | Optional | `null` | Numeric | The Profile maximum amount of reserves. | | fields.global_fields.reserve_percent | Optional | `null` | Numeric | The Profile reserves percentaje. | | fields.global_fields.reserve_term | Optional | `null` | Integer Flag | The Profile reserves term id. | | fields.global_fields.reserve_term_days | Optional | `null` | Numeric | The Profile reserves term days quantity. | | fields.global_fields.transaction_fee | Optional | `null` | Numeric | The Profile transactions fee. | | fields.global_fields.url | Optional | `null` | String(255) | The Profile main landing page. | | fields.global_fields.vertical | Optional | 0 | Integer Flag | The Profile vertical id. | | fields.account_fields | Optional | `null` | Object | The Profile account fields. | | fields.account_fields.api_login | Required | - | String(255) | The Profile user. | | fields.account_fields.capture_on_shipment | Required | - | Integer Flag | Indicate whether the Profile should capture on shipment or not. | | fields.account_fields.lime_light_3d_verify | Required | - | Integer Flag | Indicate whether the Profile should use 3d verification or not. | | fields.account_fields.signature_key | Required | - | String(255) | The Profile signature key. | | fields.account_fields.subscription_3d_protection | Required Sometimes | - | Integer Flag | The Profile 3D protection type (required if `fields.account_fields.lime_light_3d_verify` is `true`). | | fields.account_fields.test_mode | Required | - | Boolean | Indicate whether the Profile should run on test mode or not. | | fields.account_fields.trans_key | Required | - | String(255) | The Profile trans key. | | fields.account_fields.use_pre_auth_filter | Required | - | Boolean | Indicate whether the the Profile should check for available balance before making a purchase. | | fields.account_fields.void_pre_auth | Required Sometimes | - | Boolean | Void for pre_auth (required if `fields.account_fields.use_pre_auth_filter` is `true`). | | fields.fee_fields | Optional | [] | Object | The Profile fees options. | | fields.fee_fields.monthly_fee | Optional | - | Numeric | The Profile monthly fee. | | fields.fee_fields.batch_fee | Optional | - | Numeric | The Profile fees for batch operations. | | fields.fee_fields.visa | Optional | 0 | Numeric | The Profile fees for Visa payments. | | fields.fee_fields.mastercard | Optional | 0 | Numeric | The Profile fees for Mastercard payments. | | fields.fee_fields.discover | Optional | 0 | Numeric | The Profile fees for Discover payments. | | fields.fee_fields.american_express | Optional | 0 | Numeric | The Profile fees for American Express payments. | | fields.fee_fields.other | Optional | 0 | Numeric | The Profile fees for other payments types. | | fields.fee_fields.refund_processing_fee | Optional | 0 | Numeric | The Profile fees for refundings. | **Response Data** The created Profile, response parameters expected in the object contained within the `data` field object: | Field | Data Type | Description | | — | — | — | | global_fields | Object | Contains all the global fields (one Object per field) for the given payment account. | | account_fields | Object | Contains all the account fields (one Object per field) for the given payment account. | | fee_fields | Object | Contains all the fee fields (one Object per field) for the given payment account. | | provider_custom_fields | Object or null | Contains all the custom fields (one Object per field) for the given payment account provider. | here description here

Parameters:

  • body (AddProfileRequest)

    Required parameter: TODO: type description

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • gateway_provider_id (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/sticky_io_restful_api_v2025731/controllers/gateways_controller.rb', line 397

def add_profile(body,
                domain,
                v2_ext,
                gateway_provider_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}providers/payment/{gateway_provider_id}/profiles',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .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))
               .template_param(new_parameter(gateway_provider_id, key: 'gateway_provider_id')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_account_fields(domain, v2_ext, gateway_account_id) ⇒ ApiResponse

Fetch all the fields for the given payment gateway. **Response Data**\ Response parameters expected in the object contained within the ‘data` field array: | Field | Data Type | Description

|

| ———————————- | ———— |


  • |

| global_fields | Object | Contains all the global fields (one Object per field) for the given payment account. | | account_fields | Object | Contains all the account fields (one Object per field) for the given payment account. | | fee_fields | Object | Contains all the fee fields (one Object per field) for the given payment account.

|                              |

| provider_custom_fields | Object or null | Contains all the custom fields (one Object per field) for the given payment account provider. | description here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • gateway_account_id (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/sticky_io_restful_api_v2025731/controllers/gateways_controller.rb', line 74

def (domain,
                       v2_ext,
                       )
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}providers/payment/{gateway_account_id}/fields',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .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))
               .template_param(new_parameter(, key: 'gateway_account_id')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_accounts(domain, v2_ext) ⇒ ApiResponse

Fetch all the payments providers. **Response Data**\ Response parameters expected in the object contained within the ‘data` field array: | Field | Data Type | Description

|

| ———————————- | ———— |


  • |

| id | Integer | The payment provider id. | | name | String | The payment provider uuid. | | type | String | The payment provider type (credit card/alternative) |

|

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.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/sticky_io_restful_api_v2025731/controllers/gateways_controller.rb', line 28

def get_accounts(domain,
                 v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}providers/payment',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .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))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_profile_details(domain, v2_ext, gateway_profile_id) ⇒ ApiResponse

Fetch a Profile object by ID. **Response Data**\ Response parameters expected in the Profile object contained within the data field object: | Field | Data Type | Description

|

| ————————————— | ———— | ————————————– | | account_id | Integer | The account ID. | | id | Integer | The Profile ID.

|

| alias | String | The Profile alias. | | account_name | String | The account alias.

|

| currency | Object | The Profile currency details. | | currency.title | String | The Profile currency long name. | | currency.code | String | The Profile currency code. | | currency.symbol_left | String | The Profile currency symbol. | | currency.id | String | The Profile currency ID. | | fields | Object | The Profile fields. | | fields.global_fields | Object | Object of global fields associated with the Profile. | | fields.global_fields.cancellation_url | String | The fallback url after a cancellation has been made. | | fields.global_fields.chargeback_fee | Numeric | The Profile chargeback fee. | | fields.global_fields.customer_service_email | String

| The Profile customer service email. |

| fields.global_fields.customer_service_email_from | String | The Profile email from used when emails are sended. | | fields.global_fields.customer_service_number | String | The Profile customer service number. | | fields.global_fields.cvv | Integer Flag | Specifies the Profile’s type of CVV. | | fields.global_fields.descriptor | String | The Profile descriptor. | | fields.global_fields.global_monthly_cap | Numeric | The Profile maximum monthly amount. | | fields.global_fields.merchant_id | String | The Profile merchant id (can be an ID, UUID or string). | | fields.global_fields.mid_group | String | The profile group used for traffic balancing. | | fields.global_fields.processor | Integer Flag | The Profile processor ID. | | fields.global_fields.reserve_cap | Numeric | The Profile maximum amount of reserves. | | fields.global_fields.reserve_percent | Numeric | The Profile reserves percentaje. | | fields.global_fields.reserve_term | Integer Flag | The Profile reserves term id. | | fields.global_fields.reserve_term_days | Numeric | The Profile reserves term days quantity. | | fields.global_fields.transaction_fee | Numeric | The Profile transactions fee. | | fields.global_fields.url | String | The Profile main landing page. | | fields.global_fields.vertical | Integer Flag | The Profile vertical id. | | fields.account_fields | Object | The Profile account fields. | | fields.account_fields.api_login | String | The Profile user. | | fields.account_fields.capture_on_shipment | Integer Flag | Indicate whether the Profile should capture on shipment or not. | | fields.account_fields.lime_light_3d_verify | Integer Flag | Indicate whether the Profile should use 3d verification or not. | | fields.account_fields.signature_key | String | The Profile signature key. | | fields.account_fields.subscription_3d_protection | Integer Flag | The Profile 3D protection type. | | fields.account_fields.test_mode | Boolean | Indicate whether the Profile should run on test mode or not. | | fields.account_fields.trans_key | String | The Profile trans key. | | fields.account_fields.use_pre_auth_filter | Boolean | Indicate whether the the Profile should check for available balance before making a purchase. | | fields.account_fields.void_pre_auth | Boolean | Void for pre_auth. | | fields.fee_fields | Object | The Profile fees options. | | fields.fee_fields.monthly_fee | Numeric | The Profile monthly fee. | | fields.fee_fields.batch_fee | Numeric | The Profile fees for batch operations. | | fields.fee_fields.visa | Numeric | The Profile fees for Visa payments. | | fields.fee_fields.mastercard | Numeric | The Profile fees for Mastercard payments. | | fields.fee_fields.discover | Numeric | The Profile fees for Discover payments. | | fields.fee_fields.american_express | Numeric | The Profile fees for American Express payments. | | fields.fee_fields.other | Numeric | The Profile fees for other payments types. | | fields.fee_fields.refund_processing_fee | Numeric | The Profile fees for refundings. | | fields.fee_fields.currency | String Flag | The Profile currency (default USD). | description here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • gateway_profile_id (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/sticky_io_restful_api_v2025731/controllers/gateways_controller.rb', line 263

def get_profile_details(domain,
                        v2_ext,
                        gateway_profile_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}providers/payment/profiles/{gateway_profile_id}',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .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))
               .template_param(new_parameter(gateway_profile_id, key: 'gateway_profile_id')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_profiles(domain, v2_ext, gateway_account_id) ⇒ ApiResponse

Fetch a list of Profile objects for the given account ID. **Response Data**\ Response parameters expected in each Provider object contained within the ‘data` field array: | Field | Data Type | Description

|

| ————————————— | ———— | ————————————– | | account_id | Integer | The account ID. | | id | Integer | The Profile ID.

|

| alias | String | The Profile alias. | | account_name | String | The account alias.

|

| currency | Object | The Profile currency details. | | currency.title | String | The Profile currency long name. | | currency.code | String | The Profile currency code. | | currency.symbol_left | String | The Profile currency symbol. | | currency.id | String | The Profile currency ID. | description here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • gateway_account_id (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/sticky_io_restful_api_v2025731/controllers/gateways_controller.rb', line 128

def get_profiles(domain,
                 v2_ext,
                 )
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}providers/payment/{gateway_account_id}/profiles',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .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))
               .template_param(new_parameter(, key: 'gateway_account_id')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#update_profile(body, domain, v2_ext) ⇒ ApiResponse

Update the given Profile. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | ——————————— | ——– | — | ———— | ————————————– | | alias | Optional | - | String(255) | The Profile alias. | | fields | Optional | - | Object | Object containing the global_fields, account_fields, and fee_fields for the Profile. | | fields.global_fields | Optional | - | Object

| Object of global fields associated with the Profile. |

| fields.global_fields.cancellation_url | Optional | ‘null` | String(255) | The fallback url after a cancellation has been made. | | fields.global_fields.chargeback_fee | Optional | 0 | Numeric | The Profile chargeback fee. | | fields.global_fields.customer_service_email | Optional | `null` | String(255) | The Profile customer service email. | | fields.global_fields.customer_service_email_from | Optional | `null` | String(255) | The Profile email from used when emails are sended. | | fields.global_fields.customer_service_number | Optional |

  • | String(30) | The Profile customer service number. |

| fields.global_fields.cvv | Optional | ‘null` | Integer Flag | Specifies the Profile’s type of CVV. | | fields.global_fields.descriptor | Optional | - | String(255) | The Profile descriptor. | | fields.global_fields.global_monthly_cap | Optional | - | Numeric | The Profile maximum monthly amount. | | fields.global_fields.merchant_id | Optional | - | String(255) | The Profile merchant id (can be an ID, UUID or string). | | fields.global_fields.mid_group | Optional | ‘null` | String | The profile group used for traffic balancing. | | fields.global_fields.processor | Optional | `null` | Integer Flag | The Profile processor id. | | fields.global_fields.reserve_cap | Optional | `null` | Numeric

| The Profile maximum amount of reserves. |

| fields.global_fields.reserve_percent | Optional | ‘null` | Numeric | The Profile reserves percentaje. | | fields.global_fields.reserve_term | Optional | `null` | Integer Flag | The Profile reserves term id. | | fields.global_fields.reserve_term_days | Optional | `null` | Numeric | The Profile reserves term days quantity. | | fields.global_fields.transaction_fee | Optional | `null` | Numeric | The Profile transactions fee. | | fields.global_fields.url | Optional | `null` | String(255)

| The Profile main landing page. |

| fields.global_fields.vertical | Optional | 0 | Integer Flag

| The Profile vertical id. |

| fields.account_fields | Optional | ‘null` | Object | The Profile account fields. | | fields.account_fields.api_login | Optional | - | String(255)

| The Profile user. |

| fields.account_fields.capture_on_shipment | Optional | - | Integer Flag | Indicate whether the Profile should capture on shipment or not. | | fields.account_fields.lime_light_3d_verify | Optional | - | Integer Flag | Indicate whether the Profile should use 3d verification or not. | | fields.account_fields.signature_key | Optional | - | String(255) | The Profile signature key. | | fields.account_fields.subscription_3d_protection | Required Sometimes | - | Integer Flag | The Profile 3D protection type (required if ‘fields.account_fields.lime_light_3d_verify` is `true`). | | fields.account_fields.test_mode | Optional | - | Boolean

| Indicate whether the Profile should run on test mode or not. |

| fields.account_fields.trans_key | Optional | - | String(255)

| The Profile trans key. |

| fields.account_fields.use_pre_auth_filter | Optional | - | Boolean | Indicate whether the the Profile should check for available balance before making a purchase. | | fields.account_fields.void_pre_auth | Required Sometimes | - | Boolean | Void for pre_auth (required if ‘fields.account_fields.use_pre_auth_filter` is `true`). | | fields.fee_fields | Optional | [] | Object | The Profile fees options. | | fields.fee_fields.monthly_fee | Optional | - | Numeric | The Profile monthly fee. | | fields.fee_fields.batch_fee | Optional | - | Numeric | The Profile fees for batch operations. | | fields.fee_fields.visa | Optional | 0 | Numeric | The Profile fees for Visa payments. | | fields.fee_fields.mastercard | Optional | 0 | Numeric | The Profile fees for Mastercard payments. | | fields.fee_fields.discover | Optional | 0 | Numeric | The Profile fees for Discover payments. | | fields.fee_fields.american_express | Optional | 0 | Numeric

| The Profile fees for American Express payments. |

| fields.fee_fields.other | Optional | 0 | Numeric | The Profile fees for other payments types. | | fields.fee_fields.refund_processing_fee | Optional | 0 | Numeric | The Profile fees for refundings. | **Response Data**\ The updated Profile, response parameters expected in the object contained within the ‘data` field object: | Field | Data Type | Description

|

| ———————————- | ———— |


  • |

| global_fields | Object | Contains all the global fields (one Object per field) for the given payment account. | | account_fields | Object | Contains all the account fields (one Object per field) for the given payment account. | | fee_fields | Object | Contains all the fee fields (one Object per field) for the given payment account.

|                              |

| provider_custom_fields | Object or null | Contains all the custom fields (one Object per field) for the given payment account provider. | description here

Parameters:

  • body (UpdateProfileRequest)

    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.



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/sticky_io_restful_api_v2025731/controllers/gateways_controller.rb', line 544

def update_profile(body,
                   domain,
                   v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}providers/payment/profiles/11',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .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))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end