Skip to content

Commit

Permalink
fix: #1083 use correct method channel for dangerouslyupdateCard (#1094)
Browse files Browse the repository at this point in the history
  • Loading branch information
remonh87 authored Jan 20, 2023
1 parent 9d73f5b commit 799eafd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
12 changes: 9 additions & 3 deletions packages/stripe/lib/src/widgets/card_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,15 @@ class _MethodChannelCardFieldState extends State<_MethodChannelCardField>
@override
void dangerouslyUpdateCardDetails(CardFieldInputDetails details) {
assert(widget.dangerouslyUpdateFullCardDetails, kDebugPCIMessage);
_methodChannel?.invokeMethod('dangerouslyUpdateCardDetails', {
'cardDetails': details.toJson(),
});

Stripe.instance.dangerouslyUpdateCardDetails(
CardDetails(
number: details.number,
cvc: details.cvc,
expirationMonth: details.expiryMonth,
expirationYear: details.expiryYear,
),
);
}
}

Expand Down
11 changes: 8 additions & 3 deletions packages/stripe/lib/src/widgets/card_form_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,14 @@ class _MethodChannelCardFormFieldState
@override
void dangerouslyUpdateCardDetails(CardFieldInputDetails details) {
assert(widget.dangerouslyUpdateFullCardDetails, kDebugPCIMessage);
_methodChannel?.invokeMethod('dangerouslyUpdateCardDetails', {
'cardDetails': details.toJson(),
});
Stripe.instance.dangerouslyUpdateCardDetails(
CardDetails(
number: details.number,
cvc: details.cvc,
expirationMonth: details.expiryMonth,
expirationYear: details.expiryYear,
),
);
}
}

Expand Down

0 comments on commit 799eafd

Please sign in to comment.