Skip to content

Commit

Permalink
sync dart layer
Browse files Browse the repository at this point in the history
  • Loading branch information
remonh87 committed Nov 7, 2022
1 parent cc17ef6 commit 5546b61
Show file tree
Hide file tree
Showing 13 changed files with 496 additions and 269 deletions.
14 changes: 10 additions & 4 deletions packages/stripe/lib/src/stripe.dart
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,20 @@ class Stripe {
/// See [PresentPaymentSheetPameters] for more details
///
/// throws [StripeException] in case of a failure
Future<void> presentPaymentSheet({
@Deprecated('Params are now inherited from initPaymentSheet so this `parameters` can be removed')
dynamic parameters,
}) async {
Future<void> presentPaymentSheet() async {
await _awaitForSettings();
return await _platform.presentPaymentSheet();
}

/// Call this method when the user logs out from your app.
///
/// This will ensur ethat any persisted authentication state in the
/// paymentsheet, such as authentication cookies are cleared during logout.
Future<void> resetPaymentSheetCustomer() async {
await _awaitForSettings();
return await _platform.resetPaymentSheetCustomer();
}

/// Confirms the paymentsheet payment
///
/// throws [StripeException] in case of a failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,21 @@ class MethodChannelStripe extends StripePlatform {
}
}

@override
Future<void> resetPaymentSheetCustomer() async {
final result = await _methodChannel.invokeMethod<dynamic>(
'resetPaymentSheetCustomer',
{'params': {}},
);

// iOS returns empty list on success
if (result is List) {
return;
} else {
return _parsePaymentSheetResult(result);
}
}

@override
Future<void> confirmPaymentSheetPayment() async {
final result = await _methodChannel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ class _$_CollectBankAccountParams implements _CollectBankAccountParams {

@override
Map<String, dynamic> toJson() {
return _$$_CollectBankAccountParamsToJson(this);
return _$$_CollectBankAccountParamsToJson(
this,
);
}
}

Expand All @@ -197,12 +199,12 @@ abstract class _CollectBankAccountParams implements CollectBankAccountParams {
/// Billingdetails of the account holder
///
/// It is required to fill in the name in the billing details
BillingDetails get billingDetails => throw _privateConstructorUsedError;
BillingDetails get billingDetails;
@override

/// The paymentmethod type. At this point only method [PaymentMethodType.USBankAccount]
/// is supported.
PaymentMethodType get paymentMethodType => throw _privateConstructorUsedError;
PaymentMethodType get paymentMethodType;
@override
@JsonKey(ignore: true)
_$$_CollectBankAccountParamsCopyWith<_$_CollectBankAccountParams>
Expand Down Expand Up @@ -375,7 +377,9 @@ class _$_VerifyMicroDepositsParams implements _VerifyMicroDepositsParams {

@override
Map<String, dynamic> toJson() {
return _$$_VerifyMicroDepositsParamsToJson(this);
return _$$_VerifyMicroDepositsParamsToJson(
this,
);
}
}

Expand All @@ -393,13 +397,13 @@ abstract class _VerifyMicroDepositsParams implements VerifyMicroDepositsParams {
///
/// Make sure that the amount is exactly 2. When using this field make sure
/// [descriptorCode] is `null`.
List<int>? get amounts => throw _privateConstructorUsedError;
List<int>? get amounts;
@override

/// The descriptor code that is part of the microdepot to the customer bank account.
///
/// When Using this field make sure [amounts] is `null`.
String? get descriptorCode => throw _privateConstructorUsedError;
String? get descriptorCode;
@override
@JsonKey(ignore: true)
_$$_VerifyMicroDepositsParamsCopyWith<_$_VerifyMicroDepositsParams>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ class Card with _$Card {

/// last four digits of the card.
String? last4,

/// The preffered card brand for payment
String? preferredNetwork,

/// The available networks the card can run.
List<String>? availableNetworks,
}) = _Card;

factory Card.fromJson(Map<String, dynamic> json) => _$CardFromJson(json);
Expand Down
Loading

0 comments on commit 5546b61

Please sign in to comment.