SPC Integration with Stripe


1.  Create a Subscription Plan in your Stripe Account


If you sell subscription products, you need to create a subscription plan in Stripe for each subscription product in DAP.

The reason you need to do this is because Stripe controls/manages the recurring billing and it informs SPC/DAP via 'webhook' after each successful recurring charge.  SPC/DAP uses the Stripe notification to increment user's access to the subscription product in DAP.

If you only sell one-time products, you can skip this step.

VERY IMPORTANT: The Stripe "Plan Id" as well as "Plan Name" must EXACTLY match your DAP product name. If they don't match, SPC cannot set up a recurring plan for your users in Stripe. And as a result, your users won't be charged on a recurring basis. That's why you need to create a plan in Stripe for all of your recurring products in DAP. And both plan id and plan name must match the DAP product name.

Create the same plan in both Test and Live Modes in Stripe. 

To create a plan in live mode, select Subscriptions >> Plans and create the plan. 

To create it in test mode, select "View Test Data" >> Then click on Subscriptions >> Plans and create the plan.

2.  Create a Coupon in your Stripe Account


If you allow your buyers to enter a coupon code on the checkout page, you need to create 'same name' coupon in your Stripe account otherwise Stripe will reject payments with 'No coupon found' message.

3.  Webhook Notification


Set up Webhook Notification URL in your Stripe account. Click on API >> Webhooks tab >> Add endpoint to add a Webhook URL.  The Stripe webhook URL should be set to http://YOURSITE.com/dap/dap-stripe.php . Replace YOURSITE.com with the name of your site. 

Set up 2 notifications, both using the same webhook URL (http://yoursite.com/dap/dap-stripe.php) - one for test mode and another for live mode.

4.  Stripe Live Keys


Get Stripe Secret and Publishable keys from your Stripe account.

You can get Stripe Live Keys from your Stripe Account >> API >> API tab.

Copy both the secret key and publishable key and paste it in your SPC >> Settings page >> Live tab >> Stripe Secret and Publishable Key fields.



5.  Stripe Test Keys


Click on "View Test Data" >> API to get Stripe Test Keys.



Copy both the secret key and publishable key and paste it in your SPC >> Settings page >> Sandbox tab >> Stripe Keys field.

Enter Secret Key in the secret key field and publishable key in the publishable key field.


6.  Trial Amount / Trial Days


See details in the image below:



If you want to offer a trial, just enter the trial amount in DAP products page >> pricing tab >> trial amount field. Stripe does not allow a trial amount but that's fine. In Stripe, just enter the 'recurring amount'. SPC will initiate 2 different calls to Stripe. One to charge the trial amount and the next to setup subscription.