Subscription billing involves more than a single payment — renewals, cancellations, failed charges, and webhook timing all need to be verified before you launch. This guide covers how to test the full subscription lifecycle in SmartPay Pro.
Prerequisites
- Test Mode enabled in SmartPay → Settings → General
- A subscription-capable gateway configured with sandbox/test credentials (Stripe or Mollie recommended for testing)
- A subscription form created in SmartPay → Forms
Step 1: Test the Initial Signup
- Visit your subscription form on the frontend.
- Submit with a Stripe test card:
4242 4242 4242 4242. - Verify in SmartPay → Subscriptions that a new subscription appears with status Active.
- Verify the customer email received a confirmation.
- If you have an LMS or membership integration, verify the user was enrolled/granted access.
Step 2: Simulate a Renewal
Waiting for a real renewal cycle (days or months) isn't practical in testing. Use the gateway's test tools to fast-forward time:
Stripe
- In the Stripe Dashboard (test mode), find the subscription you just created.
- Click Actions → Fast-forward subscription to advance the billing cycle to the next renewal date.
- Stripe will fire the
invoice.paidwebhook event, which SmartPay receives and records as a renewal payment. - Verify a second payment appears in SmartPay → Payments linked to the same subscription.
Mollie
Mollie's test mode approves the next recurring charge immediately. After the initial mandate is confirmed, trigger the subscription via Mollie's API or simply wait — in Mollie test mode, subscription intervals are compressed.
Step 3: Test a Failed Renewal
Stripe
- In Stripe Dashboard (test mode), find the subscription.
- Update the payment method to a declining card:
4000 0000 0000 0341. - Fast-forward the billing cycle.
- Stripe fires a
invoice.payment_failedwebhook. - In SmartPay, the subscription should change to Failing.
- Verify the payment failure email is sent to the customer.
- If connected to LMS/membership, verify access is suspended.
Step 4: Test Subscription Cancellation
- In SmartPay, go to the subscription detail and click Cancel.
- Choose between "Cancel at end of period" or "Cancel immediately".
- Verify the subscription status changes to Cancelled.
- Verify gateway webhook fires (Stripe sends
customer.subscription.deleted). - If connected to LMS/membership, verify the user's access is revoked.
Step 5: Test the Customer Account Page
- Create a WordPress page with the shortcode
[smartpay_account]. - Log in as the test subscriber.
- Verify they can see their subscription, billing date, and status.
- Click Cancel Subscription and verify the cancellation flow.
- Click Update Payment Method and verify the secure Stripe/Paddle form appears.
Step 6: Test a Fixed-Term Subscription (Installment Plan)
- Create a form with billing period set to Monthly and subscription length set to 3 months.
- Complete a test signup.
- In Stripe, fast-forward twice more (for a total of 3 renewals).
- After the 3rd payment, the subscription should automatically change to Completed.
- No further renewals should occur.
Webhook Testing Tips
- Stripe CLI: Install the Stripe CLI and run
stripe listen --forward-to localhost:8080/smartpay/v1/webhook/stripeto forward Stripe events to your local dev environment without a public URL. - ngrok for local testing: If testing on localhost, use ngrok to expose a public URL:
ngrok http 8080. Use the ngrok HTTPS URL as the webhook endpoint in Stripe/Razorpay. - Webhook log in SmartPay: Check SmartPay → Settings → Webhooks for incoming webhook delivery status and retry failed deliveries.
Checklist Before Going Live
- ☑ Initial subscription payment completes and status shows Active
- ☑ Renewal webhook fires and second payment records in SmartPay
- ☑ Failed renewal changes status to Failing and sends failure email
- ☑ Cancellation changes status to Cancelled and revokes access
- ☑ Customer account page shows correct subscription state
- ☑ Test Mode disabled before launch
- ☑ Live gateway credentials entered (not sandbox keys)