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

Support saved bank accounts in Link #5405

Merged
merged 3 commits into from Aug 15, 2022
Merged

Support saved bank accounts in Link #5405

merged 3 commits into from Aug 15, 2022

Conversation

brnunes-stripe
Copy link
Contributor

Summary

  • Display user's saved bank accounts.
  • Allows user to selected only supported payment methods, show message on the ones unavailable.
  • Fix labels when user email is long.

Motivation

Support bank debits in Link.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Bank only Card only
Screenshot_20220810-175933 Screenshot_20220810-173515

@github-actions
Copy link
Contributor

github-actions bot commented Aug 13, 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 │ +6.4 KiB │  51.9 MiB │  51.9 MiB │ +21.6 KiB 
     arsc │   1.8 MiB │   1.8 MiB │ +2.5 KiB │   1.8 MiB │   1.8 MiB │  +2.5 KiB 
 manifest │     4 KiB │     4 KiB │      0 B │  18.5 KiB │  18.5 KiB │       0 B 
      res │ 872.2 KiB │ 873.3 KiB │ +1.1 KiB │   1.4 MiB │   1.4 MiB │  +2.5 KiB 
   native │   2.5 MiB │   2.5 MiB │      0 B │   5.9 MiB │   5.9 MiB │       0 B 
    asset │     3 MiB │     3 MiB │    -65 B │     3 MiB │     3 MiB │     -65 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 │ +9.9 KiB │    64 MiB │  64.1 MiB │ +26.6 KiB 

         │          raw           │              unique               
         ├────────┬────────┬──────┼────────┬────────┬─────────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff            
─────────┼────────┼────────┼──────┼────────┼────────┼─────────────────
   files │      4 │      4 │    0 │        │        │                 
 strings │ 250763 │ 250845 │  +82 │ 213807 │ 213880 │ +73 (+166 -93)  
   types │  44242 │  44260 │  +18 │  40609 │  40626 │ +17 (+40 -23)   
 classes │  37811 │  37827 │  +16 │  37811 │  37827 │ +16 (+39 -23)   
 methods │ 221295 │ 221354 │  +59 │ 213307 │ 213365 │ +58 (+195 -137) 
  fields │ 162742 │ 162799 │  +57 │ 161702 │ 161759 │ +57 (+148 -91)  

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  292 │  292 │  0         
 entries │ 6226 │ 6231 │ +5 (+6 -1)
APK
     compressed      │     uncompressed     │                               
──────────┬──────────┼──────────┬───────────┤                               
 size     │ diff     │ size     │ diff      │ path                          
──────────┼──────────┼──────────┼───────────┼───────────────────────────────
  2.2 MiB │ +6.4 KiB │  6.9 MiB │ +21.6 KiB │ ∆ classes3.dex                
  1.8 MiB │ +2.5 KiB │  1.8 MiB │  +2.5 KiB │ ∆ resources.arsc              
  1.1 KiB │ +1.1 KiB │  2.5 KiB │  +2.5 KiB │ + res/OJ.xml                  
  8.3 KiB │    -65 B │  8.2 KiB │     -65 B │ ∆ assets/dexopt/baseline.prof 
    1 KiB │     -2 B │  2.6 KiB │       0 B │ ∆ res/j9.xml                  
  6.8 MiB │     -1 B │ 27.7 MiB │       0 B │ ∆ classes.dex                 
  3.1 MiB │     -1 B │  8.3 MiB │       0 B │ ∆ classes2.dex                
  3.2 MiB │     +1 B │    9 MiB │       0 B │ ∆ classes4.dex                
    350 B │     +1 B │    532 B │       0 B │ ∆ res/3m.xml                  
    650 B │     +1 B │  1.3 KiB │       0 B │ ∆ res/5d1.xml                 
    494 B │     +1 B │    836 B │       0 B │ ∆ res/7A.xml                  
    626 B │     +1 B │  1.1 KiB │       0 B │ ∆ res/8_.xml                  
    323 B │     +1 B │    464 B │       0 B │ ∆ res/9o.xml                  
    1 KiB │     +1 B │  3.1 KiB │       0 B │ ∆ res/Fs.xml                  
    726 B │     -1 B │  1.6 KiB │       0 B │ ∆ res/TP.xml                  
  1.5 KiB │     +1 B │  5.2 KiB │       0 B │ ∆ res/WO.xml                  
  1.3 KiB │     +1 B │  3.9 KiB │       0 B │ ∆ res/_n.xml                  
  1.1 KiB │     -1 B │  3.2 KiB │       0 B │ ∆ res/pU.xml                  
  1.1 KiB │     +1 B │  3.4 KiB │       0 B │ ∆ res/x01.xml                 
──────────┼──────────┼──────────┼───────────┼───────────────────────────────
 17.2 MiB │ +9.9 KiB │ 53.7 MiB │ +26.6 KiB │ (total)
DEX
STRINGS:

   old    │ new    │ diff           
  ────────┼────────┼────────────────
   213807 │ 213880 │ +73 (+166 -93) 
  + �
  
  ���
  ���
  ���
  ���
  �������0�*�0�8@X��¢�������������0�*�0�8@X��¢����������	��0�*�0�8@X��¢�����
  ��¨��
  + �
  
  ��
  ���
  ���
  
  ���
  ���������0�0�*�0�2�����0�H¨��
  + �
  ���
  ��
  ���
  ��
  ���
  �������2�0�B���¢����R���������0�0�¢��
  ������¨��
  + �
  
  ���
  
  ���
  
  ���
  
  ���
  ����)���0�2�����0�2�������0�2�������0�H�¢�����
  �	��0�H�¢���
  ¨��
  + �
  
  ���
  
  ���
  ���
  ���
  ���
  ����+���0�2���������0�����0�0�¢����¢����H�¢����*6�������0�����0�0�¢����¢����2�����0�����0�0�¢����¢����¨�	
  + _
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ����À��2�0�B���¢����R�����0�X��¢��
  ������R�����0�X��¢��
  ���	�
  R�����0�X��¢��
  �����R��
  ��0�X��¢��
  ������¨��
  + .
  
  ���
  
  ���
  
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ��������0�2�����0�2�����0�H�¢����������0�2�����0	2�����0�H�¢���
  ������0�2����0
  2�����0�H�¢�����I����0�2����0
  2�����0�2�����0�2�����0�2��������0�0�2��������0�0�H�¢����¨��
  + .
  ���
  ��
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  �0�2�0�:���B���¢����R�����0�X¦�¢��������R�����0�X¦�¢�����	�
  R�����0�X¦�¢�������R��
  ��0�X¦�¢�������������¨��
  + 2
  
  ���
  ���
  ���
  
  ���
  
  ���
  ���
  ���
  
  ���
  
  ���
  ����C����0�2�������0�2��������0�0	2�
  ������0�0	2����
  ����0���0	H�¢����1�
  ��0�2�����0�2�����0�2���������0�����0�0�H�¢�����
  ����0�H�¢�����?����0�2�����0�2��������0�0	2��������0�0	2�
  ������0�0	H�¢��������0�X��¢��
  �����0�X��¢��
  �����0�X��¢��
  ¨��
  + 2
  ���
  ���
  ���
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  ����Ç��2�0�B���¢����J�����0�2�����0�2�����0�H�J	�	��0
  H�J�����02��
  ��0�2�����0
  HÖ�¨��
  + @
  ���
  ���
  
  ���
  
  �� 
  ���
  ���
  ���
  
  ���
  ���
  ��_
  ��
  ���
  ���
  ���
  �0� �2�0�:����B���������0����������0�0�¢����J����0
  2�����0�2�����0�H&J���������0�����0���0�2�����0�H�R���������0�0�¢��
  �����	R�����0�¢��
  ���
  �������¨��
  + d
  
  ���
  
  ���
  
  ���
  
  ���
  ���
  �� 
  
  ��
  ���
  ���
  ���
  ���
  ���
  
  ���
  
  ���
  ���
  ���
  ���
  ���
  ���
  
  ���
  ����+���0�2�����0�2�����0�2��������0�0�H�¢�������	��0�2�
  ������0�0�2�������0�0
  2�������0�2�����0�2���������0�����0�0�2���������0�����0�0�2��������0�0�2��������0�0�H�¢�����O����0�2�����0�2�����0�20���,�� ����0�����0���0�j����¢����¢��������0�0�H�¢��� �å�����0�2�
  ������0�0�2�������0�0
  2�������0�2��!��0�2����0#2��_����0%2���������0�����0�0�2��������0�0�2��&������0�����0�0�2��'������0�����0�0�2�(������0�0�2�)������0�0�20���,�� ����0�����0���0�j����¢����¢��������0�0�H�¢���*�
  �+��0�H�¢���,¨�-
  + v
  ���
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  ���
  ���
  ���
  
  �� 
  ���
  
  ���
  ���
  ���
  ��	
  ���
  
  ��
  ���
  ���
  ���
  
  ���
  ��
  
  ���
  ��	��2�0�:�?B/��������0�������0�������0�������0	���
  ��0�¢���J��)��0*2����+��0,J��-��0*H�J��.��0*2��/��0�J��0��0*2��/��0�J��1����0�2��������0�0�H�J��2��0*2����3��0,H�J��4��0*J��5��0*2��6��0�H�J��5��0*2��6��07H�J��8��0*2��9��07H�J��:��0*2��;��0�J��<��0*J��=��0*2��>��0�H�R��
  �
  ������0�0�X��¢��
  R������
  ������0�0�0�X��¢��
  R���������0�0�X��¢��
  R����
  ������0�0�X��¢��
  R�����0�¢��
  ������R�����0	X��¢��
  R����
  ������0�0�¢��
  ������R�����0�X��¢��
  R��
  ��0�X��¢��
  R�����0�X��¢��
  R������
  ������0�0�0�¢��
  ������R���������0�0�¢��
  ������R�� �
  ������0�0�¢��
  ���!��R����0#X��¢��
  R��_������0&0%¢��
  ���'�(¨�@
  + _bankAccount
  + _isSupported
  + _itemBeingRemoved_delegate
  + _onItemSelected
  + _paymentDetailsList
  + _removeLabel
  + _selectedItem
  + _selectedItemIsValid
  + _supportedTypes
  + (ILkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;I)V
  + (Lcom/stripe/android/model/ConsumerPaymentDetails_BankAccount;)I
  + (Lcom/stripe/android/model/ConsumerPaymentDetails_BankAccount;ZLandroidx/compose/runtime/Composer;I)V
  + (Lcom/stripe/android/model/ConsumerPaymentDetails_Card;ZLandroidx/compose/runtime/Composer;I)V
  + (Lcom/stripe/android/model/ConsumerPaymentDetails_PaymentDetails;)I
  + (Lcom/stripe/android/model/ConsumerPaymentDetails_PaymentDetails;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/r
...✂
ARSC
ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   6226 │ 6231 │ +5 (+6 -1) 
  + drawable/ic_link_bank
  + string/wallet_bank_account_terms
  + string/wallet_remove_account_confirmation
  + string/wallet_remove_card_confirmation
  + string/wallet_remove_linked_account
  + string/wallet_unavailable
  
  - string/wallet_remove_confirmation

Comment on lines +52 to +53
bankName = "Bank Name",
last4 = "last4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be localized

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a @Preview, just for visualization

@jameswoo-stripe
Copy link
Contributor

Are we going to use the bank icons, or always use the generic bank icon?

@brnunes-stripe
Copy link
Contributor Author

Are we going to use the bank icons, or always use the generic bank icon?

The goal is to show the bank icons, I'll try to reuse the logic we already have

@brnunes-stripe brnunes-stripe merged commit 3d373fc into master Aug 15, 2022
@brnunes-stripe brnunes-stripe deleted the brnunes/wallet branch August 15, 2022 18:34
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

3 participants