Step 7 - Set up Stripe Payment Flow

This will walk you through the process of making your page and integrating the Stripe Payment Element Form from PosiPay. This document provides an example of how to set up a payment form in the flow; you are free to configure it any way you see fit, as long as it supports the lightning web component.

Steps in Setting Up Stripe Payment Flow

Go to Set up Home page > Click Process Automation > Flows.

  • Click New Flow button to create flow.

image-20240312-035241.png
  • Choose Screen Flow and click Create.

image-20240312-035408.png

 

  • After clicking, add new Screen.

 

  1. Set up the Customer Info Screen. Add the required attributes.

Choose what type of component you want to use and don’t forget to put Label. Click Stripe Form under Components.

  • Label = Customer Info Screen

  • API Name: autopopulated

Display the following components with each of the Labels.

  • Text:

    • Amount

    • City

    • Country

    • Email Address

    • Gateway Account

    • Line 1

    • Line 2

    • Payment Method

  • Checkbox

    • Gateway Customer

    • Is MOTO

      • Default Value = {!$GlobalConstant.False}

    • requirePostalCode

  1. Set up the Stripe Form Screen. Click Stripe Form under Components.

  • After clicking, fill in components with the same information from the first screen. After doing this, don’t forget to put the screen flow label, then click Done.

    • Amount = {!Amount}

    • City = {!City}

    • Country = {!Country}

    • Email Address = {!Email_Address}

    • Gateway Account = {!Gateway_Account}

    • Gateway Customer = {!Gateway_Customer}

    • Line 1 = {!Line_1}

    • Line 2: {!Line_2}

    • Payment Method = {!Payment_Method}

    • Require Postal Code = {!requirePostalCode}

  1. Set up the “Thank You” Screen.

  • Choose Display Text component, fill in the description, and don’t forget to fill in the Flow label. Click Done after setting up.

  • After creating the three (3) screens, it should look like this.

After successfully completing the Stripe Payment Flow, click “Save” or “Save As” and fill in the necessary details and click Save.

Validation:

For validations, click “Run” or “Debug” after setting up the Stripe Payment Flow.

The Gateway Account Attribute:

  1. In the Stripe Form, fill in the necessary information including Gateway Account, and Payment Method, and tick CVC if you require the Card Verification Code.

     

    Note: If the Gateway Account is empty, it will display an error message and will not proceed to the Stripe Payment Form.

  2. After filling in, click Next and proceed to display the Stripe Payment Form.

     

The Payment Method attribute:

  1. In the Stripe Form, fill in the necessary information including Gateway Account, and Payment Method, and tick CVC if you require the Card Verification Code.

     

  • Note: If the provided methods in the Payment Method are NOT supported by the Gateway Account record, it won’t proceed to the Stripe Payment Form and will display an error message.

    • If the Payment Method attribute is EMPTY, then the Stripe payment form will not display, and an error message will display.

  1. After filling in the necessary details correctly, it will display the Stripe Payment Form.

Note: If you select Credit Card as Payment Method and the Is MOTO is set to TRUE, the Stripe Form will display like this and the CVC field will NOT display.

 

Once you have filled in all the necessary details, click on Process Payment. The payment will be processed to the gateway with the Credit Card details without CVC.

If you select Credit Card as Payment Method and the Is MOTO is set to FALSE, the Stripe Form will display like this and the CVC field will display.

If you select Direct Debit as the Payment Method, the Stripe Form will display like this :

Once you have filled in all the necessary details, click on Process Payment. You will then be redirected to the next window where you can see the Bank Account Name.

 

Testing the Payment Form

Stripe Payment

  1. Setup > Process Automation > Flow > New Flow > Screen Flow > Create

·        Add the screen element

·        Drag the Stripe Form

o   The required attributes in the element:

  Gateway Account = (Id of Gateway Account)

  Generate Customer set to False

Payment Method = “Credit Card” or “Direct debit” or both “Credit Card” and “Debit Card”

  1. Successful Testing: Fill in the required fields.

a.      Amount

b.      Card Number

c.      Expiration           

d.      CVC

  • After filling in, click Pay Now. Afterwards, it will create a Gateway Transaction record and the component will navigate to the next screen.

Here is the sample Gateway Transaction that has been recorded.

A Payment Transaction is successful if the Transaction Status field is Successful.

  1. For Failed Testing, fill in the required fields.

a.      Amount

b.      Card Number

c.      Expiration

d.      CVC

 

  • After filling in, click Pay now. If the transaction is failed, an error message will appear and the component will stay in the Payment Form.

  • Here is the Gateway Transaction record with the failed payment transaction.

Stripe Payment Element Form Parameters (Attributes)

Input

To be configured when calling the lightning web component of the Stripe payment form.

PARAMETERS

DESCRIPTION

Gateway Account

The gateway service provider where the tokenization process or payment process will be initiated. Make sure the provided Gateway Account record is an active gateway.

Payment Method

Determines the supported payment method of the form which is “Credit Card” for Card and “Direct Debit” for Bank Debit. For multiple payment methods, separate each payment method with a semi-colon. Make sure that the provided payment methods are supported by the Gateway Account.

Amount

The amount to be collected for the payment process.

Redirect URL

The URL where the page will be redirected to after a successful tokenization or payment processing.

Is MOTO

Once set to FALSE, the CVC field on the form will display. Otherwise, the CVC field will be hidden. Take note that it is advisable to enable the CVC field when the form is embedded on an external page.

Email Address

The email address of the customer.

City

The city, district, suburb, town, or village of the customer’s address details.

Country

The country of the customer’s address details. Provide either the whole country name or the two-letter country code (ISO 3166-1 alpha-2).

Line 1

The address line 1 (e.g., street, PO Box, or company name) of the customer’s address details.

Line 2

The address line 2 (e.g., apartment, suite, unit, or building) of the customer’s address details.

State

The state, county, province, or region of the customer’s address details.

Postal Code

The ZIP or postal code of the customer’s address details.

Require Postal Code

Once enabled, the Postal Code field on the form will display. Otherwise, the Postal Code field will be hidden.

Relate Record To

The specific record that will be linked to the Gateway Transaction record. Please provide a valid record ID.

Relate Record To - Field

The custom lookup field under the Gateway Transaction object that will be populated with the provided record ID in the “Relate Record To” attribute.

Output

The results from the process returned by the lightning web component of the Stripe payment form – no need to configure.

PARAMETERS

DESCRIPTION

Successful

Identifies if the whole tokenization process or payment process is either successful or failed. If true, it indicates that it is a success. If false, it indicates is a failure.

Brand

The card type of the Credit Card.

Card Expiry

The card expiry of the Credit Card.

Last 4

The last 4 digits of the provided card number.

Response Code

The returned result code from the parsed response.

Response Message

The returned result message from the parsed response.

Payment Intent ID

Unique identifier of the payment intent.

Payment Method ID

Unique identifier of the payment method.

Gateway Transaction

The Gateway Transaction record that is created from the payment attempt.

Reference ID

Unique transaction reference identifier that will be useful for linking to-be-created record to the Gateway Transaction record.

Cardholder Name

The name on the front of the credit card.

Card BIN

The first six digits of the card number.

BSB Number

The BSB number of the bank account for Direct Debit.

Account Holder Name

The account holder name of the bank account for Direct Debit.

Token

Unique identifier of the customer where the Credit Card/Direct Debit details are linked.

 

Next place to go: Step 8 - Set up Stripe Customer Form