class Conekta::SubscriptionsApi
Attributes
Public Class Methods
Source
# File lib/conekta/api/subscriptions_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Source
# File lib/conekta/api/subscriptions_api.rb, line 29 def cancel_subscription(id, opts = {}) data, _status_code, _headers = cancel_subscription_with_http_info(id, opts) data end
Cancel Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 41 def cancel_subscription_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.cancel_subscription ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.cancel_subscription" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{id}/subscription/cancel'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.cancel_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#cancel_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Cancel Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 103 def create_subscription(id, subscription_request, opts = {}) data, _status_code, _headers = create_subscription_with_http_info(id, subscription_request, opts) data end
Create Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. You can create the subscription to include the plans that your customers consume @param id [String] Identifier of the resource @param subscription_request [SubscriptionRequest] requested field for subscriptions @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 116 def create_subscription_with_http_info(id, subscription_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.create_subscription ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.create_subscription" end # verify the required parameter 'subscription_request' is set if @api_client.config.client_side_validation && subscription_request.nil? fail ArgumentError, "Missing the required parameter 'subscription_request' when calling SubscriptionsApi.create_subscription" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{id}/subscription'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_request) # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.create_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. You can create the subscription to include the plans that your customers consume @param id [String] Identifier of the resource @param subscription_request [SubscriptionRequest] requested field for subscriptions @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 185 def get_subscription(id, opts = {}) data, _status_code, _headers = get_subscription_with_http_info(id, opts) data end
Get Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 256 def get_subscription_events(id, opts = {}) data, _status_code, _headers = get_subscription_events_with_http_info(id, opts) data end
Get Subscription Events [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. You can get the events of the subscription(s) of a client, with the customer id @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionEventsResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 268 def get_subscription_events_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_subscription_events ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.get_subscription_events" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{id}/subscription/events'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionEventsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.get_subscription_events", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Subscription Events [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. You can get the events of the subscription(s) of a client, with the customer id @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionEventsResponse
, Integer, Hash)>] SubscriptionEventsResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 196 def get_subscription_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_subscription ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.get_subscription" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{id}/subscription'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.get_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 329 def pause_subscription(id, opts = {}) data, _status_code, _headers = pause_subscription_with_http_info(id, opts) data end
Pause Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 341 def pause_subscription_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.pause_subscription ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.pause_subscription" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{id}/subscription/pause'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.pause_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#pause_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Pause Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 402 def resume_subscription(id, opts = {}) data, _status_code, _headers = resume_subscription_with_http_info(id, opts) data end
Resume Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 414 def resume_subscription_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.resume_subscription ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.resume_subscription" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{id}/subscription/resume'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.resume_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#resume_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Resume Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 476 def subscription_cancel(customer_id, id, opts = {}) data, _status_code, _headers = subscription_cancel_with_http_info(customer_id, id, opts) data end
Cancel Subscription Cancel a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 489 def subscription_cancel_with_http_info(customer_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_cancel ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_cancel" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscription_cancel" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{customer_id}/subscriptions/{id}/cancel'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.subscription_cancel", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Cancel Subscription Cancel a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 555 def subscription_create(customer_id, subscription_request, opts = {}) data, _status_code, _headers = subscription_create_with_http_info(customer_id, subscription_request, opts) data end
Create Subscription Create a new subscription for a customer (keeps existing subscriptions active) @param customer_id [String] Identifier of the customer resource @param subscription_request [SubscriptionRequest] requested field for subscriptions @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 568 def subscription_create_with_http_info(customer_id, subscription_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_create ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_create" end # verify the required parameter 'subscription_request' is set if @api_client.config.client_side_validation && subscription_request.nil? fail ArgumentError, "Missing the required parameter 'subscription_request' when calling SubscriptionsApi.subscription_create" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{customer_id}/subscriptions'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_request) # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.subscription_create", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create Subscription Create a new subscription for a customer (keeps existing subscriptions active) @param customer_id [String] Identifier of the customer resource @param subscription_request [SubscriptionRequest] requested field for subscriptions @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 643 def subscription_events(customer_id, id, opts = {}) data, _status_code, _headers = subscription_events_with_http_info(customer_id, id, opts) data end
Get Subscription Events Get events for a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20) @option opts [String] :search General order search, e.g. by mail, reference etc. @option opts [String] :_next next page @option opts [String] :previous previous page @return [SubscriptionEventsResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 660 def subscription_events_with_http_info(customer_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_events ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_events" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscription_events" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsApi.subscription_events, must be smaller than or equal to 250.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsApi.subscription_events, must be greater than or equal to 1.' end # resource path local_var_path = '/customers/{customer_id}/subscriptions/{id}/events'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionEventsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.subscription_events", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Subscription Events Get events for a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20) @option opts [String] :search General order search, e.g. by mail, reference etc. @option opts [String] :_next next page @option opts [String] :previous previous page @return [Array<(SubscriptionEventsResponse
, Integer, Hash)>] SubscriptionEventsResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 741 def subscription_list(customer_id, opts = {}) data, _status_code, _headers = subscription_list_with_http_info(customer_id, opts) data end
List Subscriptions Get a list of subscriptions for a customer @param customer_id [String] Identifier of the customer resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20) @option opts [String] :search General order search, e.g. by mail, reference etc. @option opts [String] :_next next page @option opts [String] :previous previous page @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 757 def subscription_list_with_http_info(customer_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_list ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_list" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsApi.subscription_list, must be smaller than or equal to 250.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SubscriptionsApi.subscription_list, must be greater than or equal to 1.' end # resource path local_var_path = '/customers/{customer_id}/subscriptions'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.subscription_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Subscriptions Get a list of subscriptions for a customer @param customer_id [String] Identifier of the customer resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20) @option opts [String] :search General order search, e.g. by mail, reference etc. @option opts [String] :_next next page @option opts [String] :previous previous page @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 831 def subscription_pause(customer_id, id, opts = {}) data, _status_code, _headers = subscription_pause_with_http_info(customer_id, id, opts) data end
Pause Subscription Pause a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 844 def subscription_pause_with_http_info(customer_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_pause ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_pause" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscription_pause" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{customer_id}/subscriptions/{id}/pause'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.subscription_pause", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_pause\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Pause Subscription Pause a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 910 def subscription_resume(customer_id, id, opts = {}) data, _status_code, _headers = subscription_resume_with_http_info(customer_id, id, opts) data end
Resume Subscription Resume a specific paused subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 923 def subscription_resume_with_http_info(customer_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_resume ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_resume" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscription_resume" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{customer_id}/subscriptions/{id}/resume'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.subscription_resume", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_resume\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Resume Subscription Resume a specific paused subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 990 def subscription_update(customer_id, id, subscription_update_request, opts = {}) data, _status_code, _headers = subscription_update_with_http_info(customer_id, id, subscription_update_request, opts) data end
Update Subscription Update a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param subscription_update_request [SubscriptionUpdateRequest] requested field for update a subscription @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 1004 def subscription_update_with_http_info(customer_id, id, subscription_update_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_update ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscription_update" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscription_update" end # verify the required parameter 'subscription_update_request' is set if @api_client.config.client_side_validation && subscription_update_request.nil? fail ArgumentError, "Missing the required parameter 'subscription_update_request' when calling SubscriptionsApi.subscription_update" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{customer_id}/subscriptions/{id}'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_update_request) # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.subscription_update", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#subscription_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update Subscription Update a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param subscription_update_request [SubscriptionUpdateRequest] requested field for update a subscription @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 1079 def subscriptions_get(customer_id, id, opts = {}) data, _status_code, _headers = subscriptions_get_with_http_info(customer_id, id, opts) data end
Get Subscription Retrieve a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 1092 def subscriptions_get_with_http_info(customer_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_get ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscriptions_get" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_get" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{customer_id}/subscriptions/{id}'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.subscriptions_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Subscription Retrieve a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 1158 def subscriptions_retry(customer_id, id, opts = {}) data, _status_code, _headers = subscriptions_retry_with_http_info(customer_id, id, opts) data end
Retry Failed Payment Retry a failed payment for a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 1171 def subscriptions_retry_with_http_info(customer_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_retry ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling SubscriptionsApi.subscriptions_retry" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_retry" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{customer_id}/subscriptions/{id}/retry'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.subscriptions_retry", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_retry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Retry Failed Payment Retry a failed payment for a specific subscription @param customer_id [String] Identifier of the customer resource @param id [String] Identifier of the subscription resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers
Source
# File lib/conekta/api/subscriptions_api.rb, line 1237 def update_subscription(id, subscription_update_request, opts = {}) data, _status_code, _headers = update_subscription_with_http_info(id, subscription_update_request, opts) data end
Update Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. You can modify the subscription to change the plans that your customers consume @param id [String] Identifier of the resource @param subscription_update_request [SubscriptionUpdateRequest] requested field for update a subscription @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [SubscriptionResponse]
Source
# File lib/conekta/api/subscriptions_api.rb, line 1250 def update_subscription_with_http_info(id, subscription_update_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SubscriptionsApi.update_subscription ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.update_subscription" end # verify the required parameter 'subscription_update_request' is set if @api_client.config.client_side_validation && subscription_update_request.nil? fail ArgumentError, "Missing the required parameter 'subscription_update_request' when calling SubscriptionsApi.update_subscription" end allowable_values = ["es", "en"] if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language']) fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}" end # resource path local_var_path = '/customers/{id}/subscription'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.2.0+json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_update_request) # return_type return_type = opts[:debug_return_type] || 'SubscriptionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"SubscriptionsApi.update_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SubscriptionsApi#update_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update Subscription [Deprecated] DEPRECATED: This endpoint will be removed in version 2.3.0. You can modify the subscription to change the plans that your customers consume @param id [String] Identifier of the resource @param subscription_update_request [SubscriptionUpdateRequest] requested field for update a subscription @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(SubscriptionResponse
, Integer, Hash)>] SubscriptionResponse
data, response status code and response headers