Integration
Step 1: Partner Backend Generates a Flex Token
When the user clicks the Flex button, the backend system will make an API call to Flex with the customer data and receive a token in response. The token will be loaded into the SDK. |
Step 2: Payment Portal Redirects to Flex URL
The portal will open an iFrame, redirecting the user to the the Flex webapp. From here, Flex will handle the user experience inside the iFrame up until the end of the user's journey (when the callback is fired, as described below).
Step 3: Flex runs a credit check
If the user does not have an existing Flex account, Flex will run a credit check and extend a revolving credit line for their payment. The details of the credit line are shown to the user in the modal, and the user accepts the offer to proceed with bill evaluation and payment.
Step 4: Flex pulls the customer’s bill
Flex fetches a list of open charges on the customer's account from the partner's backend APIs. The bill gets evaluated to ensure that the total amount does not exceed the customer's credit limit.
Step 5: Payment confirmation
The customer reviews the payment details.
Step 6: Flex collects customer downpayment
Flex collects the first payment installment from the customer. If the customer does not have funds, Flex will continue to retry periodically to ensure they can cover their downpayment.
Step 7: Flex pays the bill
After receiving the downpayment, Flex will make an API call to the partner backend to update the customer’s ledger. After a successful payment API call to the partner, Flex will initiate funds to the partner.
Step 8: Result Callback
Flex will emit an event from the SDK indicating that the payment is complete.
Sandbox / Test Environment
Flex will set up a sandbox environment for testing the SDK integration. The portal can perform testing of the Flex SDK against the sandbox environment. This will require collaboration with the partner to ensure that Flex is also calling the correct environment on the partner side. Alternatively, mock responses can be provided to isolate the tests to the frontend.