Skip to content

Commit 176e5b0

Browse files
committed
fix(stripe_js): pass clientSecret and data as positional args to verifyMicrodeposits
Stripe.js exposes verifyMicrodepositsForPayment and verifyMicrodepositsForSetup as (clientSecret, data) — two positional arguments — not as a single options object. The previous bindings merged the two into {clientSecret, ...data}.jsify(), which produced a call shaped like verifyMicrodeposits({clientSecret, amounts, ...}) and does not match the Stripe.js signature. Update both external interop declarations to take (String clientSecret, [JSAny? data]) and the Dart wrappers to call them with two arguments, matching the same pattern used by confirmCardPayment / confirmP24Payment / etc.
1 parent 4f0562b commit 176e5b0

2 files changed

Lines changed: 12 additions & 16 deletions

File tree

packages/stripe_js/lib/src/js/payment_intents/verify_microdeposits_for_payment.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ extension ExtensionVerifyMicrodepositsForPayment on Stripe {
1414
Future<PaymentIntentResponse> verifyMicrodepositsForPayment(
1515
String clientSecret, {
1616
VerifyMicrodepositsForPaymentData? data,
17-
}) async {
18-
final jsOptions = <String, dynamic>{
19-
'clientSecret': clientSecret,
20-
...?data?.toJson(),
21-
}.jsify();
22-
return _verifyMicrodepositsForPayment(jsOptions)
17+
}) {
18+
final jsData = data?.toJson().jsify();
19+
return _verifyMicrodepositsForPayment(clientSecret, jsData)
2320
.toDart
2421
.then((response) => response.toDart);
2522
}
2623

2724
@JS('verifyMicrodepositsForPayment')
2825
external JSPromise<JSIntentResponse> _verifyMicrodepositsForPayment(
29-
JSAny? options,
30-
);
26+
String clientSecret, [
27+
JSAny? data,
28+
]);
3129
}

packages/stripe_js/lib/src/js/setup_intents/verify_microdeposits_for_setup.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ extension ExtensionVerifyMicrodepositsForSetup on Stripe {
1414
Future<SetupIntentResponse> verifyMicrodepositsForSetup(
1515
String clientSecret, {
1616
VerifyMicrodepositsForSetupData? data,
17-
}) async {
18-
final jsOptions = <String, dynamic>{
19-
'clientSecret': clientSecret,
20-
...?data?.toJson(),
21-
}.jsify();
22-
return _verifyMicrodepositsForSetup(jsOptions)
17+
}) {
18+
final jsData = data?.toJson().jsify();
19+
return _verifyMicrodepositsForSetup(clientSecret, jsData)
2320
.toDart
2421
.then((response) => response.toDart);
2522
}
2623

2724
@JS('verifyMicrodepositsForSetup')
2825
external JSPromise<JSSetupIntentResponse> _verifyMicrodepositsForSetup(
29-
JSAny? options,
30-
);
26+
String clientSecret, [
27+
JSAny? data,
28+
]);
3129
}

0 commit comments

Comments
 (0)