Skip to main content

Add giving to a React Native app

The @thefaithapp/giving-react-native package renders general and campaign giving inside a React Native or Expo app. It uses the member session from @thefaithapp/auth-react-native, presents the church’s active payment provider, and waits for TheFaithApp to confirm the payment. The package includes:
  • general giving with funds, currency, frequency, memo, and fee coverage
  • campaign giving with configured donor form fields
  • Stripe PaymentSheet
  • hosted PayPal and Flutterwave checkout
  • checkout cancellation and expiry handling
  • headless checkout and custom payment-handler support
TheFaithApp creates and verifies each checkout and processes provider webhooks. Do not add payment-provider secret keys or webhook secrets to your mobile app.

Before you begin

You need:
  • an Expo SDK 57 or compatible React Native app
  • @thefaithapp/auth-react-native configured with a client API key
  • a signed-in TheFaithApp member
  • an active payment provider configured for the church
  • a native development or standalone build
Follow the React Native SDK Quickstart first if member sign-in is not working yet.
1

Install the packages

Install the auth and giving SDKs:
Add the native payment dependencies with Expo-compatible versions:
2

Configure the native plugins

Add an application scheme, the auth plugin, and the Stripe plugin to app.json:
Rebuild the native application after changing plugins:
Stripe PaymentSheet cannot run in Expo Go.
3

Create the authenticated giving client

Reuse the auth instance that signs the member in:
The Stripe override adds the return URL used by redirect and 3DS flows. Its provider ID replaces the built-in Stripe handler while PayPal and Flutterwave continue to use their built-in handlers.Before showing protected giving:
The giving client does not accept a member ID or church/client ID. The authenticated session supplies that identity on every request.
4

Render general giving

Add the built-in general giving view to a screen:
The view loads the church’s giving settings and funds. It shows only the currencies, recurrence options, memo, and fee coverage allowed by that configuration.
5

Render campaign giving

Your app chooses the campaign, then passes its numeric ID to the view:
If the campaign has donor fields, the package renders and validates its text, multiline text, number, email, telephone, select, radio, checkbox, and date fields.Campaign discovery and selection belong to your app. The package begins with the campaign ID you provide.

Payment-provider behavior

The package uses the church’s active/default provider. An app does not choose between Stripe, PayPal, and Flutterwave for an individual gift. The result from a native sheet or WebView is not treated as proof of payment. The SDK checks TheFaithApp’s webhook-backed status before reporting the final state. A pending result means the provider or webhook is still processing.

Campaign fields

The built-in campaign view loads the campaign definition and submits its form responses with the authenticated checkout. Required fields are validated before the payment experience opens. Both giving views accept partial strings overrides, contentContainerStyle, allowRecurring, and showMemo.

Headless checkout

The rendered views are optional. A custom form can create an authenticated checkout and render the shared payment host:
For a campaign, call createCampaignCheckout(campaignId, request) and include the campaign’s configured values in request.formFields. Keep the host mounted until the provider completes. If your custom UI dismisses an unrendered checkout, report it:

Add another payment provider

Register a handler whose provider matches the value configured on TheFaithApp:
A handler receives only one checkout’s ephemeral session and narrow completion capabilities. It does not receive the auth client, client API key, bearer token, member ID, or church ID. Never persist or log checkout provider data. A custom handler must complete with the same donation ID and provider it received.

Cancellation and cleanup

Closing a payment experience triggers a best-effort checkout abandonment request. If the device is offline or the app terminates before that request arrives, TheFaithApp expires the checkout on the server. A late valid webhook still has a short grace period so a completed payment is not incorrectly cancelled.

Troubleshooting

Package resources