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

Fix issue with single-digit expiry month not being preserved in PaymentSheet #5422

Merged
merged 4 commits into from Aug 18, 2022

Conversation

tillh-stripe
Copy link
Collaborator

Summary

This pull request fixes an issue where card expiration dates with a single-digit month weren’t preserved correctly when closing and re-opening a PaymentSheet via the FlowController.

Motivation

The issue came from converting the month input to an integer and then back to a string without preserving any leading zeros. As a result, 01/23 would turn into "123" instead of "0123", which was an invalid initial value for the expiration date element.

We’re doing this now with month.toString().padStart(length = 2, padChar = '0').

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screen recordings

Before

expiry-month-bug.mp4

After

expiry-month-fixed.mp4

Changelog

[Fixed] Card expiration dates with a single-digit month are now preserved correctly when closing and re-opening the PaymentSheet via the FlowController.

@tillh-stripe tillh-stripe force-pushed the tillh/fix-expiry-month-with-single-digit branch from e2d2345 to 0eef89b Compare August 17, 2022 19:21
@github-actions
Copy link
Contributor

github-actions bot commented Aug 17, 2022

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: none)
NEW: paymentsheet-example-release-pr.apk (signature: none)

          │          compressed           │         uncompressed         
          ├───────────┬───────────┬───────┼───────────┬───────────┬──────
 APK      │ old       │ new       │ diff  │ old       │ new       │ diff 
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼──────
      dex │  15.4 MiB │  15.4 MiB │ +17 B │  51.9 MiB │  51.9 MiB │ +8 B 
     arsc │   1.8 MiB │   1.8 MiB │   0 B │   1.8 MiB │   1.8 MiB │  0 B 
 manifest │     4 KiB │     4 KiB │   0 B │  18.5 KiB │  18.5 KiB │  0 B 
      res │ 873.3 KiB │ 873.3 KiB │   0 B │   1.4 MiB │   1.4 MiB │  0 B 
   native │   2.5 MiB │   2.5 MiB │   0 B │   5.9 MiB │   5.9 MiB │  0 B 
    asset │     3 MiB │     3 MiB │   0 B │     3 MiB │     3 MiB │  0 B 
    other │  81.7 KiB │  81.7 KiB │   0 B │ 155.6 KiB │ 155.6 KiB │  0 B 
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼──────
    total │  23.6 MiB │  23.6 MiB │ +17 B │  64.1 MiB │  64.1 MiB │ +8 B 

         │          raw           │           unique            
         ├────────┬────────┬──────┼────────┬────────┬───────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff      
─────────┼────────┼────────┼──────┼────────┼────────┼───────────
   files │      4 │      4 │    0 │        │        │           
 strings │ 250849 │ 250849 │    0 │ 213884 │ 213884 │ 0 (+0 -0) 
   types │  44261 │  44261 │    0 │  40627 │  40627 │ 0 (+0 -0) 
 classes │  37828 │  37828 │    0 │  37828 │  37828 │ 0 (+0 -0) 
 methods │ 221365 │ 221365 │    0 │ 213376 │ 213376 │ 0 (+0 -0) 
  fields │ 162804 │ 162804 │    0 │ 161764 │ 161764 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  292 │  292 │  0   
 entries │ 6231 │ 6231 │  0
APK
   compressed    │ uncompressed │                
─────────┬───────┼───────┬──────┤                
 size    │ diff  │ size  │ diff │ path           
─────────┼───────┼───────┼──────┼────────────────
 3.2 MiB │ +17 B │ 9 MiB │ +8 B │ ∆ classes4.dex 
─────────┼───────┼───────┼──────┼────────────────
 3.2 MiB │ +17 B │ 9 MiB │ +8 B │ (total)

Use correct label for changelog note
@tillh-stripe tillh-stripe merged commit 0247bb3 into master Aug 18, 2022
@tillh-stripe tillh-stripe deleted the tillh/fix-expiry-month-with-single-digit branch August 18, 2022 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants