Skip to content

Kingdom Funding gateway via NMI (replaces Accept Blue)#8

Open
michael-revitpay wants to merge 4 commits into
ChurchApps:mainfrom
michael-revitpay:nmi-gateway
Open

Kingdom Funding gateway via NMI (replaces Accept Blue)#8
michael-revitpay wants to merge 4 commits into
ChurchApps:mainfrom
michael-revitpay:nmi-gateway

Conversation

@michael-revitpay

Copy link
Copy Markdown

Kingdom Funding gateway via NMI (Accept Blue → NMI)

Implements the Kingdom Funding payment gateway on NMI (Network Merchants Inc.) instead of Accept Blue. The motivation is ACH: Accept Blue cannot tokenize bank accounts, while NMI Collect.js tokenizes both card and ACH into a single-use payment_token, so donors can give by card or bank account.

This is internals-only — the "Kingdom Funding" name, branding, signup flow, locale strings, dropdown labels, and the admin gateway-settings page are unchanged. (This is the NMI version of the earlier Kingdom Funding work; supersedes the Accept Blue approach.)

Highlights

  • Backend (Api): KingdomFundingGatewayProvider on the NMI Payment API (transact.php) — card+ACH charge via payment_token, Customer Vault for saved methods, recurring subscriptions, refund/void, and Webhook-Signature HMAC-SHA256 verification.
  • Frontend (Packages/apphelper): NMI Collect.js with a card/bank toggle; ACH tokenized client-side (no raw bank numbers reach the backend).
  • Credentials map to the existing gateways columns: publicKey = Collect.js tokenization key, privateKey = NMI Security Key, webhookKey = NMI signing key.

Verification

  • tsc clean (Api + apphelper); gateway unit tests pass.
  • Live NMI sandbox: card, debit, ACH, vault, recurring, void, refund all approved.
  • Full browser end-to-end (Collect.js → Api → NMI sandbox → donation + fund logged) for card and ACH.

NMI_MIGRATION_HANDOFF.md (in the Api PR) has setup, local-test, and config details. Note: the branch is based on the Kingdom Funding integration and is behind current main, so a merge/rebase may be needed on your side.

🤖 Generated with Claude Code

ethanmcneil and others added 4 commits June 3, 2026 15:29
- KingdomFundingTokenForm: hosted tokenization component (iframe) that
  exposes a getNonce() handle to parent forms
- KingdomFundingNonAuthDonationInner: guest donation flow for Kingdom Funding
  with card + ACH bank account support, reCAPTCHA, and one-time/recurring modes
- Helpers: added "kingdomfunding" to provider type unions in PaymentMethod,
  DonationInterface, StripePaymentMethod; widened DonationHelper.isProvider
  and findGatewayByProvider; new DonationHelper.isKingdomFunding helper
- Components/index.tsx: three new exports for the Kingdom Funding components
- DonationPreviewModal: useEffect to reset loading state when modal reopens
- 4 single-line type-cast boundaries in BankForm/CardForm/DonationForm/
  MultiGatewayDonationForm so the widened provider union doesn't break
  existing Stripe-only paths

All additive -- no upstream methods, types, or exports removed. handle3DSIfRequired
and ThreeDSResult are preserved untouched.
- Restore MultiGatewayDonationForm, PaymentMethods, RecurringDonations cancel button, and NonAuthDonation polish that were dropped during the earlier surgical refactor.
- Fix donation history dates falling back to today by reading donationDate from the API response.
- Cover the unhandled promise rejection from Accept Blue's hosted tokenization destroy().
- Add KF locale strings (donation.kingdomFunding.*) to both the apphelper fallbacks and the playground en.json.
- Add a playground README with sandbox test cards and KF setup notes.
- Add .env to .gitignore.
Replace the Accept Blue hosted-tokenization iframe with NMI Collect.js in KingdomFundingTokenForm (card + ACH, returns payment_token; backward-compatible result). Wire a card/bank toggle through MultiGatewayDonationForm, KingdomFundingNonAuthDonationInner, and PaymentMethods; remove the old un-tokenized routing/account path and the KF_ACH_ENABLED=false gates so donors can tokenize ACH. Add payWithCard/payWithBank locale strings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… bank tab)

NMI Collect.js only honors one configure() per script load, so toggling the field set silently failed to re-init (bank/ACH form hung on the loading spinner). Reload the script on field-set change and add a fail-safe timeout so it never hangs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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