Skip to main content
Preview. The Payments API (V3) is live at https://api.tagada.io/v1, but it is not open to self-serve integrations yet: merchant secret keys cannot be created from the dashboard. Every merchant processes on V2 today. Contact api-support@tagadapay.com if you plan a new integration.
@tagadapay/core-js/payments-v3 is the browser client of the Payments API. It ships inside @tagadapay/core-js since 3.7.0. It holds a publishable key and one payment’s client_secret, and it:
  • mounts secure card fields and Apple Pay or Google Pay buttons,
  • turns them into a payment method (inst_...),
  • confirms the payment and performs every next_action (3DS, redirects, wallet steps),
  • reads the payment and handles the return from a redirect.
It never creates a payment: your server does, with a secret key.

Install

1. Create the payment on your server

Create the payment with your secret key and hand its client_secret to the page. See Payment lifecycle.

2. Load the client

loadPayments reads the store’s configuration (GET /v1/client-config) before it resolves. Your page’s origin must be in the key’s allowed_origins.

3. Collect a card and confirm

  • cardFields loads the vault’s fields on demand. They never expose the card number to your page.
  • createPaymentMethod refuses incomplete fields and fields created by another client instance.
  • confirmPayment does not tokenize a card by itself: create the payment method first.
  • Send billingDetails when you have them: 3DS providers need the cardholder’s name and email.

Wallets

Use 'google_pay' for Google Pay. A shopper who closes the sheet is not an error. The wallet must be enabled in the store’s configuration.

Redirect methods

For a redirect method (PayPal, Klarna, iDEAL…), confirm with the method type instead of an inst_ id:
The client navigates to the provider. On your return page, report the return:
Pass redirect: 'manual' to confirmPayment if you want the requires_action payment back instead of an automatic navigation.

Other methods

What you get back

The methods return a PublicPayment: id, object, mode, status, amount, currency, purpose, payment_method_type, next_action, last_outcome, saved_payment_method, statement_descriptor, created_at, concluded_at. It never includes the client secret.
A resolved promise does not mean the payment succeeded. Check status. Fulfil orders from your server after reading the payment with your secret key.

Errors

The client retries network errors, 429, 500, 502, 503, 504 and idempotency_key_in_progress up to two times, with the same Idempotency-Key. Every request sends Payments-Version and X-Tagada-SDK.