Skip to content

Commit 57a75e7

Browse files
committed
feat(stripe_js): add Stripe.js bindings for US bank account collection and microdeposit verification
Add JS interop extensions and freezed data classes for four Stripe.js v3 methods that were previously missing from the stripe_js package: - collectBankAccountForPayment / collectBankAccountForSetup - verifyMicrodepositsForPayment / verifyMicrodepositsForSetup These methods enable the Financial Connections authentication flow for US bank account (ACH) payments and setup intents on the web platform. Each method takes a single options object containing the clientSecret and params/data, matching the Stripe.js API contract.
1 parent ad190d2 commit 57a75e7

20 files changed

Lines changed: 2176 additions & 0 deletions
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import 'package:freezed_annotation/freezed_annotation.dart';
2+
import 'package:stripe_js/stripe_api.dart';
3+
4+
part 'collect_bank_account_for_payment_params.freezed.dart';
5+
part 'collect_bank_account_for_payment_params.g.dart';
6+
7+
@freezed
8+
abstract class CollectBankAccountForPaymentParams
9+
with _$CollectBankAccountForPaymentParams {
10+
const factory CollectBankAccountForPaymentParams({
11+
/// The type of payment method to collect. Currently only
12+
/// `us_bank_account` is supported.
13+
@JsonKey(name: 'payment_method_type') required String paymentMethodType,
14+
15+
/// Payment method data to prefill, including billing details.
16+
@JsonKey(name: 'payment_method_data')
17+
CollectBankAccountForPaymentMethodData? paymentMethodData,
18+
}) = _CollectBankAccountForPaymentParams;
19+
20+
factory CollectBankAccountForPaymentParams.fromJson(
21+
Map<String, dynamic> json,
22+
) => _$CollectBankAccountForPaymentParamsFromJson(json);
23+
}
24+
25+
@freezed
26+
abstract class CollectBankAccountForPaymentMethodData
27+
with _$CollectBankAccountForPaymentMethodData {
28+
const factory CollectBankAccountForPaymentMethodData({
29+
/// Billing details for the payment method.
30+
@JsonKey(name: 'billing_details') BillingDetails? billingDetails,
31+
}) = _CollectBankAccountForPaymentMethodData;
32+
33+
factory CollectBankAccountForPaymentMethodData.fromJson(
34+
Map<String, dynamic> json,
35+
) => _$CollectBankAccountForPaymentMethodDataFromJson(json);
36+
}

0 commit comments

Comments
 (0)