Net::API::Stripe::Billing::Subscription - A Stripe Subscription Object
0.1.1
Subscriptions allow you to charge a customer on a recurring basis.
Creates a new Net::API::Stripe objects. It may also take an hash like arguments, that also are method of the same name.
Net::API::Stripe
Toggles verbose mode on/off
Toggles debug mode on/off
Unique identifier for the object.
String representing the object’s type. Objects of the same type share the same value.
A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account.
Determines the date of the first full invoice, and, for plans with month or year intervals, the day of the month for subsequent invoices.
Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
This is a Net::API::Stripe::Billing::Thresholds object.
Net::API::Stripe::Billing::Thresholds
Monetary threshold that triggers the subscription to create an invoice
Indicates if the billing_cycle_anchor should be reset when a threshold is reached. If true, billing_cycle_anchor will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be true if the subscription contains items with plans that have aggregate_usage=last_ever.
This is an undocumented property returned by Stripe, and I assume this is a duplicate to the canceled_at one.
This is added here, so returned data does not yield a warning, but obviously this should not be used otherwise.
According to Stripe support as of 2019-11-07, this is:
If the associated subscription has been set up to be canceled at a future date, the ‘cancel_at’ property is used to specify the future timestamp of when it will be canceled.
If the subscription has been canceled with the at_period_end flag set to true, cancel_at_period_end on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end, canceled_at will still reflect the date of the initial cancellation request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions.
Time at which the object was created. Measured in seconds since the Unix epoch.
End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
Start of the current period that the subscription has been invoiced for.
ID of the customer who owns the subscription. When expanded, this is a Net::API::Stripe::Customer object.
Net::API::Stripe::Customer
Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically.
ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. If not set, invoices will use the default payment method in the customer’s invoice settings.
When expanded, this is a Net::API::Stripe::Payment::Method object.
Net::API::Stripe::Payment::Method
ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If not set, defaults to the customer’s default source.
When expanded, this is a Net::API::Stripe::Payment::Source object.
Net::API::Stripe::Payment::Source
The tax rates that will apply to any subscription item that does not have tax_rates set. Invoices created will have their default_tax_rates populated from the subscription.
This is an array of Net::API::Stripe::Tax::Rate objects.
Net::API::Stripe::Tax::Rate
Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis.
This is a Net::API::Stripe::Billing::Discount object.
Net::API::Stripe::Billing::Discount
If the subscription has ended, the date the subscription ended.
List of subscription items, each with an attached plan.
This is a Net::API::Stripe::Billing::Subscription::Items object.
Net::API::Stripe::Billing::Subscription::Items
The most recent invoice this subscription has generated.
When expanded, this is a Net::API::Stripe::Billing::Invoice object.
Net::API::Stripe::Billing::Invoice
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
This is an undocumented property on Stripe, but found in its sample data.
This is managed with a virtual module Net::API::Billing::Subscription::Item::Invoice
Net::API::Billing::Subscription::Item::Invoice
You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription’s payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide.
When expanded, this is a Net::API::Stripe::Payment::Intent::Setup object.
Net::API::Stripe::Payment::Intent::Setup
If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid.
If the update is applied, determines the date of the first full invoice, and, for plans with month or year intervals, the day of the month for subsequent invoices.
The point after which the changes reflected by this update will be discarded and no longer applied.
List of subscription items (Net::APi::Stripe::Billing::Subscription::Item), each with an attached plan, that will be set if the update is applied.
Net::APi::Stripe::Billing::Subscription::Item
Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied.
Indicates if a plan’s trial_period_days should be applied to the subscription. Setting trial_end per subscription is preferred, and this defaults to false. Setting this flag to true together with trial_end is not allowed.
Hash describing the plan the customer is subscribed to. Only set if the subscription contains a single plan.
This is a Net::API::Stripe::Billing::Plan object.
Net::API::Stripe::Billing::Plan
The quantity of the plan to which the customer is subscribed. For example, if your plan is $10/user/month, and your customer has 5 users, you could pass 5 as the quantity to have the customer charged $50 (5 x $10) monthly. Only set if the subscription contains a single plan.
The schedule attached to the subscription. When expanded, this is a Net::API::Stripe::Billing::Subscription::Schedule object.
Net::API::Stripe::Billing::Subscription::Schedule
Date of the last substantial change to this subscription. For example, a change to the items array, or a change of status, will reset this timestamp.
Date when the subscription was first created. The date might differ from the created date due to backdating.
Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, or unpaid.
For collection_method=charge_automatically a subscription moves into incomplete if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an active state. If the first invoice is not paid within 23 hours, the subscription transitions to incomplete_expired. This is a terminal state, the open invoice will be voided and no further invoices will be generated.
A subscription that is currently in a trial period is trialing and moves to active when the trial period is over.
If subscription collection_method=charge_automatically it becomes past_due when payment to renew it fails and canceled or unpaid (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts.
If subscription collection_method=send_invoice it becomes past_due when its invoice is not paid by the due date, and canceled or unpaid if it is still not paid by an additional deadline after that. Note that when a subscription has a status of unpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.
If the subscription has a trial, the end of that trial.
If the subscription has a trial, the beginning of that trial.
{ "id": "sub_EccdFNq60pUMDL", "object": "subscription", "application_fee_percent": null, "billing": "charge_automatically", "billing_cycle_anchor": 1551492959, "billing_thresholds": null, "cancel_at_period_end": false, "canceled_at": 1555726796, "collection_method": "charge_automatically", "created": 1551492959, "current_period_end": 1556763359, "current_period_start": 1554171359, "customer": "cus_EccdcylryhFDnC", "days_until_due": null, "default_payment_method": null, "default_source": null, "default_tax_rates": [], "discount": null, "ended_at": 1555726796, "items": { "object": "list", "data": [ { "id": "si_Eccd4op26fXydB", "object": "subscription_item", "billing_thresholds": null, "created": 1551492959, "metadata": {}, "plan": { "id": "professional-monthly-jpy", "object": "plan", "active": true, "aggregate_usage": null, "amount": 8000, "amount_decimal": "8000", "billing_scheme": "per_unit", "created": 1541833564, "currency": "jpy", "interval": "month", "interval_count": 1, "livemode": false, "metadata": {}, "nickname": null, "product": "prod_Dwk1QNPjrMJlY8", "tiers": null, "tiers_mode": null, "transform_usage": null, "trial_period_days": null, "usage_type": "licensed" }, "quantity": 1, "subscription": "sub_EccdFNq60pUMDL", "tax_rates": [] } ], "has_more": false, "url": "/v1/subscription_items?subscription=sub_EccdFNq60pUMDL" }, "latest_invoice": "in_1EKcARCeyNCl6fY2BaXPdnwG", "livemode": false, "metadata": {}, "pending_setup_intent": null, "plan": { "id": "professional-monthly-jpy", "object": "plan", "active": true, "aggregate_usage": null, "amount": 8000, "amount_decimal": "8000", "billing_scheme": "per_unit", "created": 1541833564, "currency": "jpy", "interval": "month", "interval_count": 1, "livemode": false, "metadata": {}, "nickname": null, "product": "prod_Dwk1QNPjrMJlY8", "tiers": null, "tiers_mode": null, "transform_usage": null, "trial_period_days": null, "usage_type": "licensed" }, "quantity": 1, "start": 1554430777, "start_date": 1551492959, "status": "canceled", "tax_percent": null, "trial_end": null, "trial_start": null }
Initial version
Jacques Deguest <jack@deguest.jp>
Stripe API documentation:
https://stripe.com/docs/api/subscriptions, https://stripe.com/docs/billing/subscriptions/creating
Copyright (c) 2018-2019 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Net::API::Stripe, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::API::Stripe
CPAN shell
perl -MCPAN -e shell install Net::API::Stripe
For more information on module installation, please visit the detailed CPAN module installation guide.