Skip to content

Remove setMockBuyerVerificationSuccess dev-testing hook - #268

Merged
Armaxis merged 1 commit into
masterfrom
artem/remove-mock-buyer-verification
Aug 18, 2026
Merged

Remove setMockBuyerVerificationSuccess dev-testing hook#268
Armaxis merged 1 commit into
masterfrom
artem/remove-mock-buyer-verification

Conversation

@Armaxis

@Armaxis Armaxis commented Aug 18, 2026

Copy link
Copy Markdown
Member

What

Removes the SQIPBuyer.setMockBuyerVerificationSuccess API 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:

  • 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, 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.setMockBuyerVerificationSuccess is removed from the JS API. It was a testing-only hook that should never be called in production code.

Testing

  • Android: :react-native-square-in-app-payments:compileDebugKotlin builds clean, including regenerated codegen from the updated Turbo Module spec
  • iOS: SquareInAppPayments pod target builds clean; regenerated codegen specs contain no trace of the removed method
  • tsc and eslint produce results identical to master
  • Zero remaining references to the mock anywhere in source

Note for #267

This will conflict with #267 in SQIPBuyer.kt, SQIPBuyerInternal.m, and src/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

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>
@Armaxis
Armaxis merged commit 50805d8 into master Aug 18, 2026
8 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.

3 participants