Testing subscription trial periods
You can test how your integration handles trial periods without waiting a full trial period to see the results by creating a new subscription with a
trial_end value a few minutes in the future.
Using this approach, you won’t see a
customer.subscription.trial_will_end event notification (which occurs three days before a trial ends), but in all other ways it behaves the same as a subscription with a longer trial period.
Testing subscription webhook notifications
After you set up the Stripe CLI and link to your Stripe account, you can trigger events from the Subscription Lifecycle to test your webhook integration. By using the Stripe CLI instead of the Dashboard to trigger events, you can see event notifications on your server as they come in. This means you can check your webhook integration directly without complicating factors such as network tunnels or firewalls.
When you use either the Stripe CLI or the Dashboard to trigger events, the event your webhook receives contains fake data that doesn’t correlate to subscription information. The most reliable way to test webhook notifications is to create actual test subscriptions and handle the corresponding events.
Testing payment failures
Use specific test credit card numbers to trigger payment failures for subscriptions and invoices.
Some subscription updates cause Stripe to invoice the subscription and attempt payment immediately (this synchronous payment attempt can occur on the initial invoice, or on certain invoice updates). If this attempt fails, the subscription is created in an
To test the effects of payment failure on an active subscription, attach the 4000 0000 0000 0341 card as the customer’s default payment method, but use a trial period to defer the attempt (a trial of a few seconds or minutes is sufficient).
Depending on your retry settings, you’ll have to wait a day or more to see the first retry attempt. If required, you can use that period to update the customer’s payment method to a working test card to see what happens for a successful retry.
Testing payments that require 3D Secure
When a 3D Secure authentication flow is triggered, you can test authenticating or failing the payment attempt in the 3DS dialog that opens. If the payment is authenticated successfully, the invoice is paid. If the invoice belongs to a subscription in an
incomplete status, the subscription becomes active. When a payment attempt fails, the authentication attempt is unsuccessful and the invoice remains
Testing ACH credit transfer payments for invoices
To test manual payments on invoices through ACH credit transfers:
- Create a testmode invoice with the collection method set to
- Find the invoice in the Dashboard and click Send.
- Identify the newly-created
ach_credit_transfersource on the customer being invoiced.
- Update the owner email to
XXXXis an integer representing the amount of money transferred. For example, to transfer 149.35 USD, set the email to
Here’s how to update the email on the created source:
Testing customer tax ID verification
Use these magic tax IDs to trigger certain verification conditions in test mode. The tax ID type should be either the EU VAT Number or Australian Business Number (ABN).
|Verification remains pending indefinitely|