Introduction

This documentation will go over how to setup Stripe Connect (marketplace) payments using Checkout in your Bubble app.

This plugin contains all the workflow actions and data calls to let your user connect their Stripe account and create marketplace payments & subscriptions while taking a platform fee.

Demo page (editor is public): https://stripeconnectdemo.bubbleapps.io/version-test

Plugin page: https://bubble.io/plugin/stripe-connect-checkout-inc-subscriptions-1642201569923x177444100576378880

My contributor page: https://bubble.io/contributor/thimo-1531681544178x908277594484388900

Support

Questions, bug reports or feature requests? You can message me on the Bubble Forum: @thimo or shoot me an email (you can find my email on my contributor page).

Connect with me on Twitter.

If you find yourself having trouble at one point in this documentation, please reach out! I want this documentation to be super clear and easy to follow (ideas to improve the docs are greatly appreciated).

Basics

First, make sure to add the plugin to your Bubble app. Inside this step-by-step documentation we will implement the plugin from scratch. Below you will find a summary of the most important steps. You can see the demo page here: https://bubble.io/page?name=index&id=stripeconnectdemo&tab=tabs-1

The plugin contains the following workflow actions:

  • Stripe Connect - Checkout Single Payment

  • Stripe Connect - Checkout Subscription Payment

  • Refund Charge

  • Perform Manual Payout

  • Cancel a Subscription

  • Create Stripe Account

  • Create Account Link

  • Update Payout Schedule for Express Account

  • Create Express Dashboard Link

The plugin contains the following data calls:

  • GET Checkout Session Details

  • GET Payment Intent Details

  • Retrieve Stripe Account

  • Retrieve Connected Account Balances

  • GET Subscription details

  • List Invoices For A Subscription

  • GET Charge details

  • GET Balance Transaction details

TL:DR

Below is a quick summary of the most important steps we will be performing to implement marketplace payments using the plugin in your Bubble app. Visit the other pages in this documentation to read a step-by-step instruction.

Onboarding users

  1. First we will create a Stripe account using a workflow action and we will save the returned Account ID to the database.

  2. Next we will go over how to use a workflow action to create an 'Account Link' to connect the Stripe account from your user to the created account from step 1. This account link will redirect your users to a Stripe Onboarding flow to connect their Stripe account.

  3. When onboarding is completed, the user will be redirected to your specified 'Return URL' and we will perform the 'Retrieve Stripe Account' data call with the Account ID to check if charges_enabled parameter is set to true which means that the onboarding succeeded for the user.

Creating payments (one-time and subscription) and collecting a fee

  1. One-time marketplace payments

    1. First we will use the 'Stripe Connect - Checkout Single Payment' workflow action to generate the Checkout URL for a one-time payment and save the Checkout ID and Payment Intent ID to the database. Inside this workflow action we specify the Account ID of the user that will receive part of the payment and a fee percentage that you (the platform) will receive. You also need to specify a 'Success URL' where the user will be redirected after completing the payment.

    2. Next we will redirect the user to that Checkout URL to let the user perform the payment.

    3. The user will be redirected to your 'Success URL'. Note: we still need to check if the payment is successful.

    4. To check if the payment is successful, we need to run the 'GET Payment Intent Details' data call. The Payment Intent ID necessary for this call is saved in step 1. Next we look at the charges object and select the first item to see if it is paid. You can display / use this information how you like in your app!

  2. Subscription marketplace payments

    1. First we will use the 'Stripe Connect - Checkout Subscription Payment' workflow action to generate the Checkout URL for a subscription and save the Checkout ID to the database. Inside this workflow action we specify the Account ID of the user that will receive part of the payment and a fee percentage that you (the platform) will receive. You also need to specify a 'Success URL' where the user will be redirected after completing the subscription.

    2. Next we will redirect the user to that Checkout URL to let the user create the subscription.

    3. The user will be redirected to your 'Success URL'. Note: we still need to check if the subscription is successfully created.

    4. To check if the payment is successful, we need to run the 'GET Checkout Session Details' data call. The Checkout ID necessary for this call saved in step 1 to the database. Next we can look at the subscription parameter and check if it contains a value (Subscription ID). Once it is not empty you know that the subscription has succeeded. Make sure to save the Subscription ID to your database. You can display / use this information how you like in your app!

Last updated