Retrieves and cancels Stripe subscriptions.
More...
#include <Client.h>
Retrieves and cancels Stripe subscriptions.
Reach an instance through StripeClient::subscriptions(). Subscriptions are created by Checkout rather than here; this interface covers inspecting one and ending it.
- See also
- https://docs.stripe.com/api/subscriptions
Definition at line 292 of file Client.h.
◆ RetrieveCompletion
◆ CancelCompletion
Completion callback for the callback form of cancel().
Definition at line 298 of file Client.h.
◆ ~Subscriptions()
| virtual stripekit::Subscriptions::~Subscriptions |
( |
| ) |
|
|
virtualdefault |
Destroys the API instance.
◆ retrieve_async()
Fetches a subscription and its current status.
This reports what Stripe believes right now, which is useful for reconciliation. For day-to-day access decisions, follow the webhooks instead of polling.
- Parameters
-
| subscription_id | Stripe subscription id, of the form "sub_...". |
| options | Per-request settings such as a timeout. |
- Returns
- A task producing the subscription.
- Exceptions
-
◆ retrieve()
Fetches a subscription, reporting the result through a callback.
The callback is invoked exactly once, and may run on a different thread than the caller.
- Parameters
-
| subscription_id | Stripe subscription id, of the form "sub_...". |
| options | Per-request settings such as a timeout. |
| completion | Receives the subscription or the failure. |
◆ cancel_async()
Cancels a subscription immediately.
Billing stops at once rather than at the end of the paid period. Stripe sends a customer.subscription.deleted webhook, which is where access should actually be revoked.
- Parameters
-
| subscription_id | Stripe subscription id, of the form "sub_...". |
| options | Per-request settings such as an idempotency key. |
- Returns
- A task producing the subscription in its cancelled state.
- Exceptions
-
◆ cancel()
Cancels a subscription, reporting the result through a callback.
The callback is invoked exactly once, and may run on a different thread than the caller.
- Parameters
-
| subscription_id | Stripe subscription id, of the form "sub_...". |
| options | Per-request settings such as an idempotency key. |
| completion | Receives the cancelled subscription or the failure. |
The documentation for this class was generated from the following file: