Installation
The official Gr4vy mobile SDKs are available for both iOS and Android platforms. Add them to your project to get started.- Swift (iOS)
- Kotlin (Android)
The official Gr4vy Swift SDK is available via Swift Package Manager.
- In Xcode, select File -> Add Packages
- Enter the repository URL: https://github.com/gr4vy/gr4vy-swift
- Select the version or branch you wish to use.
The vaulting flow
1
Initialize Checkout Session
Create a checkout session on your backend.
2
Capture Card Data
Use your own native UI components to collect the card number, expiry date, and CVV.
3
Vault via SDK
Pass the card data and checkout session ID to the native SDK.
4
Process Payment
Use the vaulted session ID on your backend to create a transaction or store the card.
Implementation
1. Initialize the SDK
First, ensure the SDK is initialized with your Gr4vy ID and the correct environment.2. Vault card details
Use thetokenize method to send the card details to Gr4vy. In this basic flow, set the authenticate parameter to false to skip the 3DS process.
3. Backend Authorization
Once the SDK returns a success result, your backend can use thatcheckout_session_id to create a transaction. Since 3DS was skipped, this can be processed as a standard non-3DS transaction.