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

Improve expiration date scanning #4719

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

davidme-stripe
Copy link
Contributor

@davidme-stripe davidme-stripe commented Mar 25, 2025

Summary

Due to improvements in iOS' OCR and changes to modern cards, we're often seeing strings like Valid Thru 01/30 Security Code 123, which are not parsed by the existing logic. To catch these, we'll add another check to look for dates in a "00/00" format.

Before: 5/14 test cards successfully populated an expiration date on scan
After: 14/14 test cards succeeded. Scanning was marginally faster, as we don't have to wait for the timeout

Motivation

https://jira.corp.stripe.com/browse/MOBILESDK-3369

Testing

Tested on iPhone 16 Pro, iOS 18.3.2

Changelog

Adding

Copy link

github-actions bot commented Mar 25, 2025

🚨 New dead code detected in this PR:

STPCardScanner.swift:362 warning: Function 'handlePossibleExpirationDate(_:)' is unused

Please remove the dead code before merging.

If this is intentional, you can bypass this check by adding the label skip dead code check to this PR.

ℹ️ If this comment appears to be left in error, double check that the flagged code is actually used and/or make sure your branch is up-to-date with master.

@davidme-stripe davidme-stripe changed the title Fix expiration date scanning Improve expiration date scanning Mar 25, 2025
@davidme-stripe davidme-stripe marked this pull request as ready for review March 25, 2025 22:41
@davidme-stripe davidme-stripe requested review from a team as code owners March 25, 2025 22:41
Copy link

⚠️ Public API changes detected:

StripePaymentSheet

- public var link: StripePaymentSheet.PaymentSheet.LinkConfiguration
- }
- public struct LinkConfiguration {
- public var display: StripePaymentSheet.PaymentSheet.LinkConfiguration.Display
- public enum Display : Swift.String {
- case automatic
- case never
- public init?(rawValue: Swift.String)
- public typealias RawValue = Swift.String
- public var rawValue: Swift.String {
- get
- }
- }
- public init(display: StripePaymentSheet.PaymentSheet.LinkConfiguration.Display = .automatic)

If you are adding a new public API consider the following:

  • Do these APIs need to be public or can they be protected with @_spi(STP)?
  • If these APIs need to be public, assess whether they require an API review.

If you are modifying or removing a public API:

  • Does this require a breaking version change?
  • Do these changes require API review?

If you confirm these APIs need to be added/updated and have undergone necessary review, add the label modifies public API to this PR to acknowledge and bypass this check.

ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants