Stripe Connector (Black Belt Edition)

Stripe Connector (Black Belt Edition) (ODC)

Stable version 0.1.5 (Compatible with ODC)
Uploaded on 15 November 2024 by OutSystems Labs
Stripe Connector (Black Belt Edition)

Stripe Connector (Black Belt Edition) (ODC)

Documentation
0.1.5

Pre-requisites


To use this component correctly, you should have a Stripe account setup and you should have created the needed API key via Developer dashboard. Note that the secret key is the one to be used in the ODC Stripe Connector library configuration. For now, please take note of the value of the secret key found in your Stripe Developer dashboard.

Without the correct API key, you will not be able to connect to Stripe publicly exposed service. This API key uniquely identify you to that service.


Installation


You can install the connector through ODC Forge.

You should install both the custom code extension as well as the Stripe Connector (Black Belt Edition) library.


How to Use

Add library to your application


Firstly, add the Stripe Connector (Black Belt Edition) library to your application as shown below.



Depending whether you want to use all the APIs, you can selectively add the needed APIs (or removed unused ones automatically later).


Configuration


The Stripe Connector (Black Belt Edition) library requires a setting STRIPE_API_KEY to be configured. As your application uses this library, the value of STRIPE_API_KEY can be configured in ODC portal as a secret. Refer to the screenshot below as an example of where to find the STRIPE_API_KEY for your application


Example 1: Creating a checkout session


A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout or Payment Links. We recommend creating a new Session each time your customer attempts to pay.


Once payment is successful, the Checkout Session will contain a reference to the Customer, and either the successful PaymentIntent or an active Subscription.


You can create a Checkout Session on your server and redirect to its URL to begin Checkout.



NOTE: The customer ID is an optional field. However, it is recommended to supply it.


Example 2: Creating payment intent


A PaymentIntent guides you through the process of collecting a payment from your customer. It is recommended that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session.


A PaymentIntent tracks the customer’s payment lifecycle, keeping track of any failed payment attempts and ensuring the customer is only charged once. The CreatePaymentIntent API returns the PaymentIntent’s client secret in the response to finish the payment on the client.


You can create a Payment Intent for a customer as shown in the sample flow below.



Found a bug?


Kindly submit your bug report here and do indicate the build number of the library which you are using too.


For more information see here.