Beanie serverless integration

Use Beanie serverless integration to sell products and subscriptions defined in your Stripe Dashboard

The client-only integration has several limitations. This integration does not support associating payments with existing Customers, or customize trial periods for subscriptions. Dynamic pricing (inline ad-hoc prices) is also not supported, so the client/server integration may be a better suit for very large catalogs.

Step 1: Configure products and plans in your Stripe account

Beanie works only with the Stripe payment provider. Stripe provides a product management feature that allows you to create plans for recurring payments or products for one-time purchase. You'll be able to create these products on your Stripe Dashboard. Be sure to be in the correct environment when you create your Stripe products.

Step 2: Add Beanie to your website

To use Beanie on your website, you must add a snippet of code that includes the desired price or plan IDs. You can use the Dashboard to generate the necessary code, or you can write it yourself.

Serverless Beanie relies on an optional BeanieConfiguration object. Its goal is to provide a set of options to make sure your Beanie checkout page behaves as expected. Being stored on our servers, a BeanieConfiguration ensures a customer cannot mitigate a configuration and enables lots of configuration options for a serverless usage of Beanie. You can share a same configuration between different prices or plans, as the Beanie Session's behaviour is the loading of the nested configuration options along with the items sold.

In order to use Beanie in a serverless context, go to: Octobat Configuration > Collect payments > BeanieConfiguration (https://app.octobat.com/configuration/beanie_configurations). You'll be able to "add a Beanie Configuration".

The form above allows you to change the options of your Beanie hosted payment page.

Then, you'll be able to use this configuration with Beanie. Click the "Use with Beanie" button. It will display a popup.

Enter Stripe price IDs (for one-time charges) or Stripe plan IDs (for subscriptions) that you've created in the Step 1. Then, click the "Generate code integration" button in order to generate a snippet that you can add to your website.

Copy and paste the snippet into the body of a web page to add a payment button that redirects the customer to your Beanie hosted payment page.

The snippet calls a function that when invoked redirects the customer to Beanie. When your customer successfully completes their payment, they are redirected to the success URL that you specified when calling redirectToBeanie. Typically, this is a page on your website that informs the customer that their payment was successful. The cancel URL is the page where Beanie redirects customers when they cancel the payment process.

Last updated