Class: StickyIoRestfulApiV2025731::StartStopResetController
- Inherits:
-
BaseController
- Object
- BaseController
- StickyIoRestfulApiV2025731::StartStopResetController
- Defined in:
- lib/sticky_io_restful_api_v2025731/controllers/start_stop_reset_controller.rb
Overview
StartStopResetController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#destroy_stop_on_next_success(domain, v2_ext, subscription_id) ⇒ ApiResponse
Destroy the stop subscription for the given order subscription ID in the next successful period condition.
-
#reset(domain, v2_ext, subscription_id) ⇒ ApiResponse
Resets a subscription for the given order subscription ID.
-
#start(domain, v2_ext, subscription_id) ⇒ ApiResponse
Starts a new subscription for the given order subscription ID.
-
#stop(cancellation_id, cancellation_reason, domain, v2_ext, subscription_id) ⇒ ApiResponse
Stops a subscription for the given order subscription ID.
-
#stop_on_next_success(domain, v2_ext, subscription_id) ⇒ ApiResponse
Stops subscription for the given order subscription ID in the next successful period.
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
#destroy_stop_on_next_success(domain, v2_ext, subscription_id) ⇒ ApiResponse
Destroy the stop subscription for the given order subscription ID in the next successful period condition. here
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/start_stop_reset_controller.rb', line 210 def destroy_stop_on_next_success(domain, v2_ext, subscription_id) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/.{domain}{v2_ext}subscriptions/{subscription_id}/terminate_next', 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(subscription_id, key: 'subscription_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(DestroyStopOnNextSuccess.method(:from_hash)) .is_api_response(true)) .execute end |
#reset(domain, v2_ext, subscription_id) ⇒ ApiResponse
Resets a subscription for the given order subscription ID. **Response Data**\ Response parameters expected in object contained within the ‘data` field object: | Field | Data Type | Description
|
| ————————————— | ———— | ————————————– | | recurring_date | Object | Object that contains data pertaining to the Subscription recurring date.
|
| recurring_date.date | String | The Subscription recurring date timestamp. . | | recurring_date.timezone_type | String | The transaction authorization identifier. | | recurring_date.timezone | String | The Subscription recurring date timestamp timezone. | here
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/start_stop_reset_controller.rb', line 141 def reset(domain, v2_ext, subscription_id) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/.{domain}{v2_ext}subscriptions/{subscription_id}/reset', 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(subscription_id, key: 'subscription_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(Reset.method(:from_hash)) .is_api_response(true) .local_error('422', 'Unprocessable Entity', ResetInvalidException)) .execute end |
#start(domain, v2_ext, subscription_id) ⇒ ApiResponse
Starts a new subscription for the given order subscription ID. **Response Data**\ Response parameters expected in object contained within the ‘data` field object: | Field | Data Type | Description
|
| ————————————— | ———— | ————————————– | | errorFound | Integer | 0 if no errors are present. | | transactionID | String | The subscription transaction identifier. | | authId | String | The transaction authorization identifier. | | responseCode | Integer | The status of the response. | | responseMessage | String | A message indicating the state of the order. | | orderId | Integer | The ID of the order. | here
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 61 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/start_stop_reset_controller.rb', line 34 def start(domain, v2_ext, subscription_id) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/.{domain}{v2_ext}subscriptions/{subscription_id}/start', 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(subscription_id, key: 'subscription_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(Start.method(:from_hash)) .is_api_response(true) .local_error('422', 'Unprocessable Entity', StartOnAlreadyRecurringSubscriptionException)) .execute end |
#stop(cancellation_id, cancellation_reason, domain, v2_ext, subscription_id) ⇒ ApiResponse
Stops a subscription for the given order subscription ID. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | ——————————— | ——– | — | ———— | ————————————– | | cancellation_id | Optional | - | Integer
| The cancellation note type. |
| cancellation_reason | Optional | - | String
| The cancellation note content. |
description here description here here
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 109 110 111 112 113 114 115 116 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/start_stop_reset_controller.rb', line 83 def stop(cancellation_id, cancellation_reason, domain, v2_ext, subscription_id) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/.{domain}{v2_ext}subscriptions/{subscription_id}/stop', Server::SERVER_1) .query_param(new_parameter(cancellation_id, key: 'cancellation_id') .is_required(true)) .query_param(new_parameter(cancellation_reason, key: 'cancellation_reason') .is_required(true)) .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(subscription_id, key: 'subscription_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(StopWithCancellationReason.method(:from_hash)) .is_api_response(true) .local_error('404', 'Not Found', StopInvalidRequestException)) .execute end |
#stop_on_next_success(domain, v2_ext, subscription_id) ⇒ ApiResponse
Stops subscription for the given order subscription ID in the next successful period. here
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 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/start_stop_reset_controller.rb', line 177 def stop_on_next_success(domain, v2_ext, subscription_id) @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/.{domain}{v2_ext}subscriptions/{subscription_id}/terminate_next', 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(subscription_id, key: 'subscription_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(StopOnNextSuccess.method(:from_hash)) .is_api_response(true)) .execute end |