Before you begin
Each merchant that wants to use Paze needs to be approved by Early Warning Services (EWS), and Gr4vy then enables Paze on a per-merchant basis. To start onboarding, see Set up Paze on the connector page. A runnable version of this integration is available in thesample-standalone-paze repository.
Overview of the flow
The integration has server-side and browser-side steps:- Server-side — create a Paze session with Gr4vy. The session returns the Paze merchant data
id, merchantname, andprofileIdthat the Paze JavaScript SDK needs. - Browser-side — load the Paze JavaScript SDK, initialize it with the session, render the Paze button, and run the checkout.
- Server-side — create a Gr4vy transaction with the opaque token that the Paze checkout returns.
Step 1: Create a Paze session
On your server, create a Paze session with the domain that hosts the Paze button. Pass the full domain, including any subdomains such aswww..
Response
Step 2: Load and initialize the Paze SDK
In the browser, add the Paze JavaScript SDK script for your environment. Use the sandbox script while testing, and the production script when you go live.window.DIGITAL_WALLET_SDK. Initialize it with the session from Step 1, then render the Paze button. The initialization is asynchronous, so call it from inside an async function.
Step 3: Run the checkout
When the shopper clicks the button, callpaze.checkout() followed by paze.complete(). Generate a unique sessionId to correlate the two calls. The complete() response is the opaque token that your server sends to Gr4vy as token, and the checkout() response is sent as the optional checkout_token (named per your SDK’s casing convention).
The preceding example shows a minimal set of Paze SDK options. See the
sample-standalone-paze repository for the full option set.Step 4: Create a transaction
On your server, create the transaction with the token returned bypaze.complete(). Set the payment method method to paze and token to the complete() response.
The checkout_token is optional but recommended. Set it to the checkout() response to add the card last four digits, card type, expiration, and shipping address to the transaction.
status as you would for any other payment method.
Test Paze
To test Paze, load your integration in the browser and complete a checkout with a Paze test wallet. Make sure your environment matches where Paze is configured, so that the browser loads the matching Paze SDK script: the sandbox script forsandbox, and the production script for production.
Test wallet credentials are issued by Paze, not by Gr4vy. To obtain a test wallet for your merchant, work with Paze directly through your Paze onboarding contact.