Google Pay & Apple Pay#
Tuna supports both Google Pay and Apple Pay as first-class payment methods. Buyers get the native wallet experience they expect — biometric authentication, no card entry, and full liability shift to the issuer — while you receive a standard encrypted token that flows into Tuna's Payment/Init just like any other card payment.
VTEX#
Tuna is the only payment connector on VTEX that combines all of the following in a single integration, without redirecting buyers away from the checkout:
| Feature | Tuna | Others |
|---|---|---|
| Real authenticated wallet payments (full liability shift) | ✅ | Some |
| First-party and third-party devices | ✅ | Partial |
| Installments on wallet transactions | ✅ | Rare |
| Fully embedded — no redirect from checkout | ✅ | Often redirect |
Google Pay is enabled automatically in the Tuna VTEX connector — no additional setup required beyond standard Tuna account configuration.
Apple Pay requires the Tuna VTEX IO app:
Follow the standard Tuna VTEX setup to configure your credentials. Tuna handles merchant domain verification and session validation automatically.
Headless & mobile apps on VTEX
Tuna has partnerships with the leading headless and mobile implementors in the VTEX ecosystem. Our wallet features — including authenticated Google Pay and Apple Pay with liability shift and installments — are replicated in frameworks built by Compra Rápida, Trinio, and Kobe. If your storefront is built on one of these platforms, contact your implementor or your Tuna Account Manager to enable wallet payments.
Tuna Checkout#
If you use Tuna Checkout — whether as a hosted payment link or embedded via iframe — both Google Pay and Apple Pay are available out of the box. No additional integration work is needed. Enable them for your account through Tuna Console flow settings.
Direct integration#
For direct integrations the flow is the same for both wallets:
- Frontend: Display the wallet button using the native JS API (or tuna.js to simplify).
- Frontend: Buyer authenticates with biometrics / Face ID / Touch ID. You receive an encrypted payment token from the wallet.
- Backend: Send a
NewSession, receivesessionId. - Backend: Call
POST /api/Payment/Initwith the encrypted token ascardInfo.tokenand the appropriatetokenProvider.
Postman collection
Full working examples are available in the Wallets → Google Pay and Wallets → Apple Pay folders in the official Postman collection.
Google Pay — direct integration#
Step 1: Set up the Google Pay button#
Follow the Google Pay Web integration guide (or Android guide for apps).
When configuring the tokenization method, use PAYMENT_GATEWAY and set the gateway to tuna:
- JavaScript
- Java (Android)
Use ENVIRONMENT_TEST while testing and ENVIRONMENT_PRODUCTION for live payments.
After the buyer approves, extract the token from the Google Pay response:
Step 2: Call Payment/Init#
Your backend calls POST https://engine.tunagateway.com/api/Payment/Init. Pass the entire token string as received from Google Pay — do not parse it.
- Request
- Response
Key fields:
| Field | Value |
|---|---|
paymentmethodtype | "1" (card) |
cardinfo.TokenProvider | "GooglePay" |
cardinfo.Token | The full JSON string from paymentData.paymentMethodData.tokenizationData.token |
Installments with Google Pay#
To offer installments, increment installments in the payment method. The buyer sees the Google Pay sheet with the total amount; your backend splits it by sending the installment count to Tuna:
Apple Pay — direct integration#
Requirements#
- An Apple Developer account with Apple Pay enabled
- A merchant identifier (e.g.
merchant.com.yourcompany.store) - Your domain verified with Apple (a file hosted at
/.well-known/apple-developer-merchantid-domain-association) - HTTPS on your domain
Apple Pay domain verification
Tuna handles merchant session validation on its end. You only need to register your domain and merchant identifier in Apple Pay console. Contact your Account Manager for Tuna's payment processing certificate configuration.
Step 1: Start the Apple Pay session#
Follow the Apple Pay on the Web documentation. Check for Apple Pay availability and create a session:
Step 2: Call Payment/Init#
Pass the serialized payment.token.paymentData as Token with TokenProvider: "ApplePay":
- Request
- Response
Key fields:
| Field | Value |
|---|---|
paymentmethodtype | "1" (card) |
cardinfo.TokenProvider | "ApplePay" |
cardinfo.Token | JSON.stringify(event.payment.token.paymentData) from the Apple Pay session |
Installments with Apple Pay#
Same as Google Pay — set installments in the payment method. Display the installment choice in your checkout UI before the buyer hits the Apple Pay button, then pass the selected value to Payment/Init.
Using tuna.js#
tuna.js provides ready-made methods that handle the wallet JS lifecycle for you, including button rendering, session management, and the callback with the token data. This is the fastest path to an opinionated but working integration.
Google Pay via tuna.js#
Include the full tuna.js build (not just essentials):
Then call useGooglePay:
See the full useGooglePay parameter reference in the tuna.js docs.
Apple Pay via tuna.js#
See the full useApplePay parameter reference in the tuna.js docs.
Quick comparison#
| Google Pay | Apple Pay | |
|---|---|---|
| Platforms | Web, Android | Safari (macOS/iOS), iOS apps |
| Device requirement | Any Android or Chrome | Apple device or Safari with Secure Enclave |
| VTEX setup | Automatic | tunabr.tuna-gateway app |
TokenProvider value | "GooglePay" | "ApplePay" |
| Token source | paymentData.paymentMethodData.tokenizationData.token | JSON.stringify(payment.token.paymentData) |
| Installments | ✅ | ✅ |
| Liability shift | ✅ | ✅ |