Class: StickyIoRestfulApiV2025731::WalletController
- Inherits:
-
BaseController
- Object
- BaseController
- StickyIoRestfulApiV2025731::WalletController
- Defined in:
- lib/sticky_io_restful_api_v2025731/controllers/wallet_controller.rb
Overview
WalletController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_contact_payment_source(body, domain, v2_ext, contact_id) ⇒ ApiResponse
Create a new payment source and attach it by customer ID **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | alias | Required | - | String | Desired name for the payment source.
-
#delete_contact_payment_source(domain, v2_ext, contact_id, payment_source_id) ⇒ ApiResponse
Delete an existing payment source here description here.
-
#get_contact_payment_source(domain, v2_ext, contact_id, payment_source_id) ⇒ ApiResponse
Fetch a single payment source **Response Data**\ Response parameters expected in payment method object contained within the ‘data` field object: | Field | Data Type | Description | - | - | - | | alias | String | The payment source name.
-
#get_contact_payment_sources(domain, v2_ext, contact_id) ⇒ ApiResponse
Fetch a list of all payment sources by the customer ID **Response Data**\ Response parameters expected in payment source object contained within the ‘data` field array: | Field | Data Type | Description | - | - | - | | alias | String | The payment source name.
-
#update_contact_payment_source(body, domain, v2_ext, contact_id, payment_source_id) ⇒ ApiResponse
Update an existing payment source that by the customer ID **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | alias | Optional | - | String | Desired name for the payment source.
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
#create_contact_payment_source(body, domain, v2_ext, contact_id) ⇒ ApiResponse
Create a new payment source and attach it by customer ID **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | alias | Required | - | String | Desired name for the payment source. | account_number | Required | - | Required | - | String | The account number depends of the payment type. | payment_type_id | Required | - | Integer | An existed payment type ID. | address_id | Required | - | Integer | An existed address ID. | is_default | Optional | - | Integer Flag | Determines whether or not the payment source is set to be as default. Default is 1 for a first payment source and 0 for any additional one. | expiry | Required Sometimes | - | StringInteger| The expiration date. Required if the payment type is CC. 4 digits. 2 for month 2 for years. 1224. type description here here
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/wallet_controller.rb', line 32 def create_contact_payment_source(body, domain, v2_ext, contact_id) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/.{domain}{v2_ext}contacts/{contact_id}/payment_sources', 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(contact_id, key: 'contact_id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(CreateContactPaymentSource.method(:from_hash)) .is_api_response(true)) .execute end |
#delete_contact_payment_source(domain, v2_ext, contact_id, payment_source_id) ⇒ ApiResponse
Delete an existing payment source here description here
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 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/wallet_controller.rb', line 174 def delete_contact_payment_source(domain, v2_ext, contact_id, payment_source_id) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/.{domain}{v2_ext}contacts/{contact_id}/payment_sources/{payment_source_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(contact_id, key: 'contact_id') .is_required(true) .should_encode(true)) .template_param(new_parameter(payment_source_id, key: 'payment_source_id') .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(DeleteContactPaymentSource.method(:from_hash)) .is_api_response(true)) .execute end |
#get_contact_payment_source(domain, v2_ext, contact_id, payment_source_id) ⇒ ApiResponse
Fetch a single payment source **Response Data**\ Response parameters expected in payment method object contained within the ‘data` field object: | Field | Data Type | Description | - | - | - | | alias | String | The payment source name. | account_number | String | The account number. | payment_type_id | Integer | The payment type ID. | address_id | Integer | The address ID. | is_default | Integer Flag | Determines whether or not the payment source is set to be as default. | expiry | Integer| The expiration date. 2 for month 2 for years. 1224. here description here
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/wallet_controller.rb', line 82 def get_contact_payment_source(domain, v2_ext, contact_id, payment_source_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}contacts/{contact_id}/payment_sources/{payment_source_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(contact_id, key: 'contact_id') .is_required(true) .should_encode(true)) .template_param(new_parameter(payment_source_id, key: 'payment_source_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_contact_payment_sources(domain, v2_ext, contact_id) ⇒ ApiResponse
Fetch a list of all payment sources by the customer ID **Response Data**\ Response parameters expected in payment source object contained within the ‘data` field array: | Field | Data Type | Description | - | - | - | | alias | String | The payment source name. | account_number | String | The account number. | payment_type_id | Integer | The payment type ID. | address_id | Integer | The address ID. | is_default | Integer Flag | Determines whether or not the payment source is set to be as default. | expiry | Integer| The expiration date. 2 for month 2 for years. 1224. here
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/wallet_controller.rb', line 222 def get_contact_payment_sources(domain, v2_ext, contact_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}contacts/{contact_id}/payment_sources', 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(contact_id, key: 'contact_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_contact_payment_source(body, domain, v2_ext, contact_id, payment_source_id) ⇒ ApiResponse
Update an existing payment source that by the customer ID **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | alias | Optional | - | String | Desired name for the payment source. | account_number | Optional | - | Required | - | String | The account number depends of the payment type. | payment_type_id | Optional | - | Integer | An existed payment type ID. | address_id | Optional | - | Integer | An existed address ID. | is_default | Optional | - | Integer Flag | Determines whether or not the payment source is set to be as default. Default is 1 for a first payment source and 0 for any additional one. | expiry | Required Sometimes | - | Integer| The expiration date. Required if the payment type is CC. 4 digits. 2 for month 2 for years. 1224. type description here here description here
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/wallet_controller.rb', line 134 def update_contact_payment_source(body, domain, v2_ext, contact_id, payment_source_id) @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/.{domain}{v2_ext}contacts/{contact_id}/payment_sources/{payment_source_id}', 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(contact_id, key: 'contact_id') .is_required(true) .should_encode(true)) .template_param(new_parameter(payment_source_id, key: 'payment_source_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 |