Repository navigation
feat(flutterwave): Flutterwave payment provider package - #107
Open
alexasomba wants to merge 75 commits into
Open
alexasomba wants to merge 75 commits into
alexasomba wants to merge 75 commits into
Conversation
…able Real test-mode run (24 Nov 2026): GET /v3/refunds answers 400 unauthorized on a key that can create refunds. Degrade the duplicate check to a logged warning for that case, log a failed disbursement, and add fixtures from the real verify and refund responses.
This was referenced Nov 24, 2026
createVendor stored stripeAccountId: "" and the field has a unique index, so the second vendor failed. The field is now optional and omitted when there is no Stripe account; a missing field is NULL. Also documents the coupon rule for split allocations (the platform absorbs a cart-wide discount; a larger one is a 409) and makes the allocation comments generic for Paystack.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One review for the Flutterwave package. Supersedes #98, #100, #102, #104 and #106, which were the same package built in five stacked PRs. Part of the set in #97.
Builds on the core PRs: #99 (public key, independent), #101 (split allocations, the base), #103 and #105 (both build on #101; #105 includes split refunds), plus #114 (provider-neutral subscription seam) and #115 (tax guard + refund idempotency). Review those first; this branch contains their commits until they merge. It does not depend on Paystack.
What
packages/flutterwave: aPaymentProviderfor Flutterwave v3. It registers itself onimport "@dashcommerce/flutterwave".POST /v3/payments→ redirect to the hosted link; referencedc-<draftId>./checkout-client;v3.jsloads only on Pay; orders still come only from the webhookpayment_planon hosted and Inline; renewals recorded from theplanfield as idempotent invoices; cancel/resume through the planverif-hash;charge.completedboth outcomes; event-id dedupe; confirmation-failure releasePOST /v3/transactions/:id/refund, duplicate guard via(refundRequestId=…), refund webhook →refund.updatedsubaccountswithflat_subaccount+ the exact amount, hosted and Inlinecapabilities.coupons: true; the discount is applied to the amount Flutterwave chargesmeta.split_settlement_info+app_feeinto core'ssplitSettlement; the order records what each subaccount earnedGET /v3/balances, test/live modeCurrencies: NGN, USD, GBP, EUR, KES, GHS, ZAR, UGX, TZS, RWF, XOF, XAF, ZMW, MWK, EGP.
API facts checked, not assumed
split_typeispercentageorflat; the transaction override supportsflat_subaccount,flatandpercentage. DashCommerce usesflat_subaccountwith the exact vendor amount so the shares never drift; the default is only a fallback.GET /v3/banks/{country}→{ code, name };POST /v3/accounts/resolve→account_name;POST /v3/subaccountsrequires the bank, account, business name, country, mobile andsplit_value(and email in practice).type: percentage|flatandsharebut not the flat share unit; that remains an open question for its own PR.POST /v3/payment-planswithinterval(monthly,every 3 months, …),amount,currencyandduration: 0; passpayment_planon the first charge.verifyreturnsplan, which is how a charge is tied to the plan.GET /v3/subscriptionsanswered400 "Service error"on the test account, so the package uses the plan id and cancels viaPUT /v3/payment-plans/{id}/cancel.Live test-mode evidence (24 Nov 2026)
10633614;callback→finishedtx_refsucceeded,150000minor, KESRS_CD57…, 450 toRS_A075…, 76.5 platform after the 73.5 fee; confirmed inmeta.split_settlement_info0690000033resolved toBale Gary; createdRS_043B…, then deleted the probesuccessful(documented)400withRefund request successfully loggedand no id; treated as a failure and surfaced, not claimed as success254811(KES 100/month); real test-card payment10634465through Inline;verifyreturnedplan: 254811initCheckoutcreated plan254812and opened Inline withpayment_plan; plan cancelled after the probeTests
Review fixes included
#103's review is merged in: verification is optional when a provider cannot resolve names, an active-but-unverified account is stored with
verified: false(Paystack'sis_verified: false), the onboarding form starts on the store's default-currency country, and the bank picker accepts mobile-money channels such as M-PESA. Onboarding is also idempotent here: re-adding the same bank account returns Flutterwave's existing subaccount, matched by account number and bank rather than the error text.Deliberately not included
meta(SWIFT/routing/branch) in the form. The docs conflict between the create reference and the split guide, and there are no test accounts for those countries; the README says to create those accounts in the dashboard/API for now.