Stripe Connect API
Stripe Connect enables you to control creadit cart payment on behalf of merchant’s connected accounts. By configuring
Stripe Connect API you can perform the common task of processing payments on a seller’s behalf. You’ll need
PUBLISHABLE KEY and
WEBHOOK SECRET from Stripe.
Register Your Platform
Very first you have to register your marketpalce platform with Stripe. Login into your Stripe dashboard and go to the
Connected accounts section. Click Get Started button to activate connect account.
On next window, select Build a platform or marketplace option and proceed.
Go to Settings from the sidebar and click Connect Settings.
On the next screen
Integration section get the
client ID, we’ll need this ID later on this guide. Now click Add URI button and give https://your_domain/admin/setting/stripe/redirect in the
Redirect URI field.
On the same screen scroll to
Branding section and fill the form with your brand information, upload logo, and icon.
Get API credentials
Next, go to Developers API keys section from the sidebar and get the
Publishable key and
Handling Stripe Webhooks
One more thing is remaining to finish configuring the Stripe side. And that is webhooks. By setting webhooks we allowing Stripe to communicate with your platform when any changes happen on Stripe’s site like subscription update, cancel, payment failed, etc. so that your marketplace can take actions to manage the vendor account on your marketplace. zCart has everything configured for you, now you just have to set the URL and the secret key for secure communications.
Go to Developers Webhooks section from the sidebar and click the
Add endpoint button. On the next window enter https://your_domain/stripe/webhook in the
Endpoint URI field and add below events on the
Events to send section.
Events need to enabled
After adding the webhook endpoint URL and events. Open the endpoint details and get the
Signing secret value to secure the communication.
You have done Stripe connect API configurations, please open the
.env file and update these keys with your values.
. . . STRIPE_KEY=your_stripe_publishable_key STRIPE_SECRET=your_stripe_secret_key STRIPE_CLIENT_ID=your_stripe_client_id STRIPE_WEBHOOK_SECRET=stripe_webhook_signing_secret . . .
From now the application will automatically handle canceling subscriptions that have too many failed charges (as defined by your Stripe settings), customer updates, customer deletions, subscription updates, and credit card changes.
Now your marketplace can use Stripe APIs to manage payments. But still, we’re not done. You need to create subscriptions and prices on the Stripe dashboard and also in your marketplace dashboard to charge vendors. Please check this section of the documentation for help.
View test datato get test credentials on the Stripe dashboard.
Now from your platform’s admin
Dashboard navigate to
settings configuration payment method tab and enable
Stripe payment method so that your marketplace vendors can accept credit card payment.