Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fingerprint check validation for card and us bank #4207

Merged
merged 11 commits into from
Nov 1, 2024
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* [Fixed] Fixed an animation glitch when dismissing PaymentSheet in React Native.
* [Fixed] Fixed an issue with FlowController in vertical layout where the payment method could incorrectly be preserved across a call to `update` when it's no longer valid.
* [Fixed] Fixed a potential deadlock when `paymentOption` is accessed from Swift concurrency.

* [Added] Added a check to `PaymentSheetDeferredValidator.validatePaymentMethod` for mismatched card or US bank account fingerprints
joyceqin-stripe marked this conversation as resolved.
Show resolved Hide resolved

## 23.32.0 2024-10-21
### PaymentSheet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ struct PaymentSheetDeferredValidator {
guard intentPaymentMethod.stripeId == paymentMethod.stripeId else {
if intentPaymentMethod.type == paymentMethod.type {
// Payment methods of type card and us_bank_account can be cloned, leading to mismatched pm ids, but their fingerprints should still match
switch paymentMethod.type.identifier {
case "card":
switch paymentMethod.type {
case .card:
try validateFingerprint(intentFingerprint: intentPaymentMethod.card?.fingerprint, fingerprint: paymentMethod.card?.fingerprint)
return
case "us_bank_account":
case .USBankAccount:
try validateFingerprint(intentFingerprint: intentPaymentMethod.usBankAccount?.fingerprint, fingerprint: paymentMethod.usBankAccount?.fingerprint)
return
default:
Expand Down
Loading