Class: Orb::Resources::SubscriptionChanges
- Inherits:
-
Object
- Object
- Orb::Resources::SubscriptionChanges
- Defined in:
- lib/orb/resources/subscription_changes.rb,
sig/orb/resources/subscription_changes.rbs
Instance Method Summary collapse
-
#apply(subscription_change_id, description: nil, mark_as_paid: nil, payment_external_id: nil, payment_notes: nil, payment_received_date: nil, previously_collected_amount: nil, request_options: {}) ⇒ Orb::Models::SubscriptionChangeApplyResponse
Some parameter documentations has been truncated, see Models::SubscriptionChangeApplyParams for more details.
-
#cancel(subscription_change_id, request_options: {}) ⇒ Orb::Models::SubscriptionChangeCancelResponse
Cancel a subscription change.
-
#initialize(client:) ⇒ SubscriptionChanges
constructor
private
A new instance of SubscriptionChanges.
-
#list(cursor: nil, customer_id: nil, external_customer_id: nil, limit: nil, status: nil, request_options: {}) ⇒ Orb::Internal::Page<Orb::Models::SubscriptionChangeListResponse>
Some parameter documentations has been truncated, see Models::SubscriptionChangeListParams for more details.
-
#retrieve(subscription_change_id, request_options: {}) ⇒ Orb::Models::SubscriptionChangeRetrieveResponse
This endpoint returns a subscription change given an identifier.
Constructor Details
#initialize(client:) ⇒ SubscriptionChanges
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SubscriptionChanges.
133 134 135 |
# File 'lib/orb/resources/subscription_changes.rb', line 133 def initialize(client:) @client = client end |
Instance Method Details
#apply(subscription_change_id, description: nil, mark_as_paid: nil, payment_external_id: nil, payment_notes: nil, payment_received_date: nil, previously_collected_amount: nil, request_options: {}) ⇒ Orb::Models::SubscriptionChangeApplyResponse
Some parameter documentations has been truncated, see Models::SubscriptionChangeApplyParams for more details.
Apply a subscription change to perform the intended action. If a positive amount is passed with a request to this endpoint, any eligible invoices that were created will be issued immediately if they only contain in-advance fees.
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/orb/resources/subscription_changes.rb', line 98 def apply(subscription_change_id, params = {}) parsed, = Orb::SubscriptionChangeApplyParams.dump_request(params) @client.request( method: :post, path: ["subscription_changes/%1$s/apply", subscription_change_id], body: parsed, model: Orb::Models::SubscriptionChangeApplyResponse, options: ) end |
#cancel(subscription_change_id, request_options: {}) ⇒ Orb::Models::SubscriptionChangeCancelResponse
Cancel a subscription change. The change can no longer be applied. A subscription can only have one "pending" change at a time - use this endpoint to cancel an existing change before creating a new one.
121 122 123 124 125 126 127 128 |
# File 'lib/orb/resources/subscription_changes.rb', line 121 def cancel(subscription_change_id, params = {}) @client.request( method: :post, path: ["subscription_changes/%1$s/cancel", subscription_change_id], model: Orb::Models::SubscriptionChangeCancelResponse, options: params[:request_options] ) end |
#list(cursor: nil, customer_id: nil, external_customer_id: nil, limit: nil, status: nil, request_options: {}) ⇒ Orb::Internal::Page<Orb::Models::SubscriptionChangeListResponse>
Some parameter documentations has been truncated, see Models::SubscriptionChangeListParams for more details.
This endpoint returns a list of pending subscription changes for a customer. Use the Fetch Subscription Change endpoint to retrieve the expected subscription state after the pending change is applied.
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/orb/resources/subscription_changes.rb', line 57 def list(params = {}) parsed, = Orb::SubscriptionChangeListParams.dump_request(params) query = Orb::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "subscription_changes", query: query, page: Orb::Internal::Page, model: Orb::Models::SubscriptionChangeListResponse, options: ) end |
#retrieve(subscription_change_id, request_options: {}) ⇒ Orb::Models::SubscriptionChangeRetrieveResponse
This endpoint returns a subscription change given an identifier.
A subscription change is created by including
Create-Pending-Subscription-Change: True in the header of a subscription
mutation API call (e.g.
create subscription endpoint,
schedule plan change endpoint,
...). The subscription change will be referenced by the
pending_subscription_change field in the response.
24 25 26 27 28 29 30 31 |
# File 'lib/orb/resources/subscription_changes.rb', line 24 def retrieve(subscription_change_id, params = {}) @client.request( method: :get, path: ["subscription_changes/%1$s", subscription_change_id], model: Orb::Models::SubscriptionChangeRetrieveResponse, options: params[:request_options] ) end |