Skip to main content

Advanced Flow

Introduction

The Advanced Flow gives you full control over how payment data is collected and processed. It separates the secure collection of sensitive card information (handled by the SecureFields SDK) from the actual payment creation (handled by the Payment API).

This flow is recommended if you want to:

  • Keep a low-level integration with maximum flexibility.
  • Control when and how payments are created.
  • Handle business rules before sending a payment request.

Advanced Flow sequence

Flow description

  1. Checkout initialization — The customer opens checkout; the Merchant Frontend initializes the SecureFields SDK.
  2. Card data collection — The customer enters card details in secure iframes. On submit, the SDK returns a vault_form_token — no PAN or CVV ever touches your systems.
  3. Payment creation — The Merchant Backend calls the Payment API with the token, order data, and 3DS preferences. The API returns a redirection object for 3DS.
  4. 3DS authentication — The customer completes authentication, then is redirected back to your shopper_redirection_url.
  5. Final update — The Payment API sends the final payment status via webhook.

Before you start

  • Ask your Purse Integration Team for a Vault Tenant ID and a Payment API Key.

Collect card data: choose your SDK

Card data is collected client-side by a SecureFields SDK. Pick the one that matches your platform — all three collect the card on the client, keep raw data out of your code, and return the same vault_form_token. The Payment API steps that follow are identical on every platform.

PlatformSDKHighlights
WebWeb SDKSecure iframes, CDN or npm, framework-agnostic
iOSiOS SDKNative UIKit / SwiftUI views, Swift Package Manager
AndroidAndroid SDKJetpack Compose / View system, Maven Central

Payment API steps

Once a SecureFields SDK returns a vault_form_token, these server-side steps are the same regardless of the SDK you used to collect the card:

StepWhat it covers
Retrieve payment methodsCheck eligible MOPs before rendering the UI
Create a paymentCall the Payment API with the token and 3DS params
Token paymentSave cards, pay with saved tokens, delete tokens
Complete payment flowEnd-to-end example connecting collection and creation