Skip to content

WIP: Buy: Feat - Transak headless cards payment opt - #2478

Draft
Gamboster wants to merge 6 commits into
bitpay:developfrom
Gamboster:feat/transakHeadlessCardsPaymentOpt
Draft

Gamboster wants to merge 6 commits into
bitpay:developfrom
Gamboster:feat/transakHeadlessCardsPaymentOpt

Conversation

@Gamboster

@Gamboster Gamboster commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Transak headless cards: pay by card in the app, with the Transak widget as fallback

Flow

  • Transak + credit/debit card: if headless can run, the purchase stays in the app; otherwise it continues with the existing Transak widget, unchanged.
  • Sign in: new onboarding screen (email + 6-digit Transak OTP). Prefilled with the BitPay ID email. "Continue on Transak instead" goes to the widget.
  • The Transak session (30 days) is stored in BUY_CRYPTO.tokens.transakHeadlessUser, which is persisted encrypted like the existing partner token. A session the API rejects is cleared and the user signs in again.
  • Before any headless screen is shown: quote (credit_debit_card), KYC requirement and saved cards. If KYC doesn't allow the order or any call fails, it falls back to the widget silently.
  • Checkout: saved cards, or a new card through TransakCard (@transak/ui-components-rn). 3DS opens in an in-app WebView and the successUrl/failureUrl redirect is intercepted. If it ever leaves the app, the passthrough page brings the user back through the existing deep link.
  • The order is recorded in the Transak history (is_headless), and the flow ends in TransakSettings, as the widget flow does.
  • Errors before an order exists offer "Continue on Transak"; errors after it show "Payment not completed".

Gating

  • Opt-in: buyCrypto.transak.config.headlessBuyEnabled === true. Off by default until Transak enables Headless Cards for our API key and whitelists the BWS IPs.
  • Cards only; GB excluded (FCA journey is widget-only).

Dependencies

  • New: @transak/ui-components-rn@0.6.0. JS only, no native changes. Its expo-web-browser peer stays unmet; the package never imports it.
  • Needs the bitcore changes (BWS /v1/service/transak/headless/* endpoints + BWC transakHeadless* methods) and a BWC bump.

Not included

  • Headless KYC: unapproved KYC goes to the widget.
  • Disconnect/logout of the Transak session, deleting saved cards.

Pending

  • Translations for the new strings.
  • Confirm with Transak: authorization header format, response/error shapes, quote validity while the card form is open, card form height.

Jira: RN-3105

@Gamboster
Gamboster marked this pull request as draft October 22, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant