Stripe
Learn how to configure pricing plans and integrate Stripe payments in your ShipNow application.
Overview
ShipNow's Stripe payment enables you to:
- 💰 Configure subscription or one-time payments
- 🔄 Automatically handle payment lifecycle
- 🛠️ Developer friendly with sandbox and webhook
Configure Stripe
Create Stripe Account
- Sign up for a Stripe account
- Fill in the information to activate the account
- Before activation, you can use a sandbox or test mode
Configure Stripe Webhooks
Select Events
Search and select the following events:
invoice.paid
checkout.session.completed
customer.subscription.deleted
Get Webhook Secret
- After creating the webhook, click "Reveal" and copy the "Signing secret"
- Add it to
.env.local
:
Payment Flow
Here's how the payment process works in ShipNow:
User clicks "Buy Now" button on the pricing table
System creates a Stripe checkout session
User is redirected to Stripe Checkout
After payment, user is redirected back to success page
Webhook receives payment confirmation
Local Development and Testing
Setup Local Development
When developing locally, use Stripe's sandbox mode:
Go to Stripe Sandboxes, and enter the sandbox you want to use
Get your test API keys from the API keys page
Set up local webhooks in the Stripe Workbench
Use the following command to forward webhooks to your local server:
Test Payment Cards
Use these cards to test different scenarios:
Card Number | Scenario |
---|---|
4242 4242 4242 4242 | Success |
4000 0000 0000 0002 | Decline |
For all test cards:
- Expiry: Any future date, eg
12/34
- CVC: Any 3 digits, eg
123
- ZIP: Any 5 digits if required, eg
12345
Testing Checklist
✅ Create a test subscription
- Use test card
4242 4242 4242 4242
- Verify success redirect
- Check webhook received
✅ Test failed payment
- Use declined test card
4000 0000 0000 0002
- Verify error message shown
✅ Monitor webhook events
- Check Stripe CLI output
- Verify events in application logs
Debugging Tips
If you encounter issues:
- Check environment variables are set correctly
- Ensure webhook forwarding is running
- Look for errors in Stripe Dashboard
Pro Tips
- Do not use the live mode to test the payment process, use the sandbox or test mode instead
Need Help?
- Check the Stripe documentation
- Join our Discord community
- Open an issue on GitHub