Remove setMockBuyerVerificationSuccess dev-testing hook - #268
Merged
Conversation
The 2.0 rewrite shipped a testing shim (marked "FIXME: Dev Testing") as public API: `SQIPBuyer.setMockBuyerVerificationSuccess`. When enabled, the plugin reports buyer verification as successful with a fake "mock-token" regardless of the real 3DS outcome — and the two platforms didn't even agree on the semantics: - Android treated ANY result as success while the flag was on, and replaced even a genuinely successful verification's real token with "mock-token" - iOS only converted real 3DS failures into fake successes A fake token can never pass server-side validation in `CreatePayment`, so this can't produce fraudulent verified payments — but it lets an app look fully working in every client-side test and then fail 100% of payments in production. That is exactly how it masked a real buyer-verification bug in the 2.x combined flows. Changes: - Remove the mock flag, setter, and mock branches from `SQIPBuyer.kt` and `SQIPBuyerInternal.m` - Remove the bridge methods from `SQIPBuyerModule.kt` and `SQIPBuyer.mm` - Remove the method from the public API (`src/index.ts`) and the Turbo Module spec (`NativeSQIPBuyer.ts`) - Remove the "Mock buyer verification success" toggle from the example app Test buyer verification against the Square sandbox instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
blockdavid
approved these changes
Aug 18, 2026
matheuskiser
approved these changes
Aug 18, 2026
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.
What
Removes the
SQIPBuyer.setMockBuyerVerificationSuccessAPI and all the mock branches behind it, on both platforms, plus the "Mock buyer verification success" toggle in the example app. Pure deletion: 9 files, +20/−103.Why
This dev-testing shim shipped in 2.0 as public API (still marked
// FIXME: Dev Testing). When enabled, the plugin reports buyer verification (3DS) as successful with a fake"mock-token"regardless of the real outcome — and the two platforms didn't even agree on the semantics:"mock-token"A fake token can never pass server-side validation in
CreatePayment, so this can't produce fraudulent verified payments — but it lets an app look fully working in every client-side test and then fail 100% of payments in production, which is exactly how it masked the buyer-verification bug being fixed in #267.Test buyer verification against the Square sandbox instead.
Breaking change
SQIPBuyer.setMockBuyerVerificationSuccessis removed from the JS API. It was a testing-only hook that should never be called in production code.Testing
:react-native-square-in-app-payments:compileDebugKotlinbuilds clean, including regenerated codegen from the updated Turbo Module specSquareInAppPaymentspod target builds clean; regenerated codegen specs contain no trace of the removed methodtscandeslintproduce results identical to masterNote for #267
This will conflict with #267 in
SQIPBuyer.kt,SQIPBuyerInternal.m, andsrc/index.ts— intentional. Plan is to merge this first; the #267 rebase gets simpler because the mock branches it had to preserve in the new pipeline disappear.🤖 Generated with Claude Code