class TerminalShop::Resources::Subscription
def create(params)
-
(TerminalShop::Models::SubscriptionCreateResponse)
-
Options Hash:
(**params)
-
:request_options
(TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil
) -- -
:schedule
(TerminalShop::Models::SubscriptionAPI::Schedule::Fixed, TerminalShop::Models::SubscriptionAPI::Schedule::Weekly
) -- Schedule of the subscription. -
:next_
(String
) -- Next shipment and billing date for the subscription. -
:quantity
(Integer
) -- Quantity of the subscription. -
:product_variant_id
(String
) -- ID of the product variant being subscribed to. -
:card_id
(String
) -- ID of the card used for the subscription. -
:address_id
(String
) -- ID of the shipping address used for the subscription. -
:id
(String
) -- Unique object identifier. The format and length of IDs may change over time.
Parameters:
-
params
(TerminalShop::Models::SubscriptionCreateParams, Hash{Symbol=>Object}
) -- .
def create(params) parsed, options = TerminalShop::Models::SubscriptionCreateParams.dump_request(params) @client.request( method: :post, path: "subscription", body: parsed, model: TerminalShop::Models::SubscriptionCreateResponse, options: options ) end
def delete(id, params = {})
-
(TerminalShop::Models::SubscriptionDeleteResponse)
-
Options Hash:
(**params)
-
:request_options
(TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil
) --
Parameters:
-
params
(TerminalShop::Models::SubscriptionDeleteParams, Hash{Symbol=>Object}
) -- . -
id
(String
) -- ID of the subscription to cancel.
def delete(id, params = {}) @client.request( method: :delete, path: ["subscription/%0s", id], model: TerminalShop::Models::SubscriptionDeleteResponse, options: params[:request_options] ) end
def get(id, params = {})
-
(TerminalShop::Models::SubscriptionGetResponse)
-
Options Hash:
(**params)
-
:request_options
(TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil
) --
Parameters:
-
params
(TerminalShop::Models::SubscriptionGetParams, Hash{Symbol=>Object}
) -- . -
id
(String
) -- ID of the subscription to get.
def get(id, params = {}) @client.request( method: :get, path: ["subscription/%0s", id], model: TerminalShop::Models::SubscriptionGetResponse, options: params[:request_options] ) end
def initialize(client:)
-
client
(TerminalShop::Client
) --
def initialize(client:) @client = client end
def list(params = {})
-
(TerminalShop::Models::SubscriptionListResponse)
-
Options Hash:
(**params)
-
:request_options
(TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil
) --
Parameters:
-
params
(TerminalShop::Models::SubscriptionListParams, Hash{Symbol=>Object}
) -- .
def list(params = {}) @client.request( method: :get, path: "subscription", model: TerminalShop::Models::SubscriptionListResponse, options: params[:request_options] ) end