Skip to content

feat: add checkoutButton title to PaymentSheetConfiguration - #63

Merged
weiping-awx merged 1 commit into
airwallex:mainfrom
gedy182:feat/checkout-button-title
Oct 19, 2026
Merged

weiping-awx merged 1 commit into
airwallex:mainfrom
gedy182:feat/checkout-button-title

Conversation

@gedy182

@gedy182 gedy182 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The native SDKs already support a custom checkout button title on the payment sheet, but the React Native wrapper only forwards layout, so RN apps can't use it:

  • iOS: AWXUIContext.Configuration.checkoutButton.title
  • Android: PaymentElementConfiguration.PaymentSheet(checkoutButton = CheckoutButton(title))

This adds an optional checkoutButton: { title } to PaymentSheetConfiguration and forwards it on both platforms:

presentEntirePaymentFlow(session, {
  layout: 'tab',
  checkoutButton: { title: 'Pay HKD 50.00' },
});

When checkoutButton or title is omitted, behavior is unchanged (the SDK default "Pay" / "Confirm").

Use case: show the amount the customer is about to pay on a one-off payment sheet, as suggested by the Airwallex team.

Changes

  • src/types/PaymentSheetConfiguration.ts: new optional checkoutButton?: CheckoutButtonConfiguration ({ title?: string }).
  • ios/AWXUIContextConfiguration+Extensions.swift: reads checkoutButton.title into checkoutButton.title.
  • android/.../PaymentSheetConfigurationConverter.kt: passes CheckoutButton(title) into PaymentSheet (default CheckoutButton() otherwise).
  • README.md: documents the configuration object.
  • example/src/App.tsx: new "PresentEntirePaymentFlow (custom button)" entry.
  • src/__tests__/index.test.tsx: type-level test for the new option.

Testing

  • yarn typecheck, yarn lint, yarn test: pass.
  • Native: not yet run on a device. To verify in the example app on iOS and Android:
    • "PresentEntirePaymentFlow (custom button)" shows "Pay ".
    • The existing tab and accordion entries still show the default "Pay".
    • A payment completes.

🤖 Generated with Claude Code

The native SDKs already support a custom checkout button title
(iOS AWXUIContext.Configuration.checkoutButton.title, Android
PaymentElementConfiguration.CheckoutButton), but the React Native
wrapper only passed `layout`. presentEntirePaymentFlow now accepts
`checkoutButton: { title }` and forwards it on both platforms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@weiping-awx
weiping-awx merged commit c2c6a0f into airwallex:main Oct 19, 2026
5 checks passed
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.

2 participants