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

Pass GooglePayLauncher arguments to DefaultGooglePayRepository #4157

Merged
merged 5 commits into from
Sep 9, 2021

Conversation

michelleb-stripe
Copy link
Contributor

@michelleb-stripe michelleb-stripe commented Sep 1, 2021

Summary

Arguments from GooglePayLauncher were not being pass through to the DefaultGooglePayRepository. Also added a class for a GooglePayLauncher playground. This is not exposed in the launcher list so as not to confuse users on how to integrate.

#4155

Testing

  • Added tests
  • Modified tests
  • Manually verified

Copy link
Contributor

@brnunes-stripe brnunes-stripe left a comment

Choose a reason for hiding this comment

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

Does it need to be fixed in GooglePayPaymentMethodLauncher too?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2021

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 │  11.5 MiB │  11.5 MiB │ +374 B │  39.3 MiB │  39.3 MiB │ +592 B 
     arsc │   1.3 MiB │   1.3 MiB │    0 B │   1.3 MiB │   1.3 MiB │    0 B 
 manifest │   2.5 KiB │   2.5 KiB │    0 B │  10.5 KiB │  10.5 KiB │    0 B 
      res │ 639.4 KiB │ 639.4 KiB │    0 B │ 997.8 KiB │ 997.8 KiB │    0 B 
    asset │  77.7 KiB │  77.7 KiB │   +1 B │ 109.2 KiB │ 109.2 KiB │   +1 B 
    other │    78 KiB │    78 KiB │   +2 B │   154 KiB │   154 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
    total │  13.6 MiB │  13.6 MiB │ +377 B │  41.8 MiB │  41.8 MiB │ +593 B 


         │          raw           │            unique            
         ├────────┬────────┬──────┼────────┬────────┬────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff       
─────────┼────────┼────────┼──────┼────────┼────────┼────────────
   files │      3 │      3 │    0 │        │        │            
 strings │ 178852 │ 178854 │   +2 │ 165740 │ 165742 │ +2 (+8 -6) 
   types │  31486 │  31487 │   +1 │  29844 │  29845 │ +1 (+2 -1) 
 classes │  27554 │  27555 │   +1 │  27554 │  27555 │ +1 (+2 -1) 
 methods │ 158989 │ 158989 │    0 │ 154671 │ 154671 │  0 (+7 -7) 
  fields │ 108313 │ 108318 │   +5 │ 107962 │ 107967 │ +5 (+6 -1) 


 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  293 │  293 │  0   
 entries │ 4326 │ 4326 │  0
APK
    compressed    │   uncompressed    │                                                       
─────────┬────────┼──────────┬────────┤                                                       
 size    │ diff   │ size     │ diff   │ path                                                  
─────────┼────────┼──────────┼────────┼───────────────────────────────────────────────────────
 3.5 MiB │ +374 B │ 10.1 MiB │ +592 B │ ∆ classes2.dex                                        
   186 B │   +2 B │      6 B │    0 B │ ∆ META-INF/androidx.activity_activity-compose.version 
 5.4 KiB │   +1 B │  5.3 KiB │   +1 B │ ∆ assets/dexopt/baseline.prof                         
─────────┼────────┼──────────┼────────┼───────────────────────────────────────────────────────
 3.5 MiB │ +377 B │ 10.1 MiB │ +593 B │ (total)
DEX
STRINGS:

   old    │ new    │ diff       
  ────────┼────────┼────────────
   165740 │ 165742 │ +2 (+8 -6) 
  
  + �
  
  ���
  ���
  ���
  ����0�*�0�H����0�*�0�H¨��
  + >
  ���
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  ���
  ���
  
  ���
  ���
  ���
  ��2�0�B/������0�������0�������0�������0	�����
  ��0�¢���J���������0	0�H�R�����0�X��¢��
  R�����0�X��¢��
  R�����0�X��¢��
  R�����0	X��¢��
  R��
  ��0�X��¢��
  R��
  ��0�X��¢��
  R�����0�8BX���¢�
  �����������¨��
  + GooglePayConfigConversionKtx.kt
  + Lcom/stripe/android/googlepaylauncher/GooglePayConfigConversionKtxKt_WhenMappings;
  + Lcom/stripe/android/googlepaylauncher/GooglePayConfigConversionKtxKt;
  + SMAP
  AnalyticsRequestFactory.kt
  Kotlin
  *S Kotlin
  *F
  + 1 AnalyticsRequestFactory.kt
  com/stripe/android/networking/AnalyticsRequestFactory
  + 2 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,327:1
  1#2:328
  *E
  
  + SMAP
  AnalyticsRequestFactory.kt
  Kotlin
  *S Kotlin
  *F
  + 1 AnalyticsRequestFactory.kt
  com/stripe/android/networking/AnalyticsRequestFactory_ThreeDS2UiType_Companion
  + 2 _Arrays.kt
  kotlin/collections/ArraysKt___ArraysKt
  *L
  1#1,327:1
  1275#2,2:328
  *S KotlinDebug
  *F
  + 1 AnalyticsRequestFactory.kt
  com/stripe/android/networking/AnalyticsRequestFactory_ThreeDS2UiType_Companion
  *L
  287#1:328,2
  *E
  
  + SMAP
  GooglePayLauncherViewModel.kt
  Kotlin
  *S Kotlin
  *F
  + 1 GooglePayLauncherViewModel.kt
  com/stripe/android/googlepaylauncher/GooglePayLauncherViewModel
  + 2 Transformations.kt
  androidx/lifecycle/TransformationsKt
  + 3 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,269:1
  87#2:270
  1#3:271
  *S KotlinDebug
  *F
  + 1 GooglePayLauncherViewModel.kt
  com/stripe/android/googlepaylauncher/GooglePayLauncherViewModel
  *L
  50#1:270
  *E
  
  
  - @
  ���
  ���
  
  ���
  
  ���
  
  ���
  ���
  ���
  
  ���
  ���
  ���
  
  ���
  ���
  ���
  ��2�0�B!��������0�������0���������0�¢����B5������0�������0��
  ���	����0
  ��������0��������0�¢���
  J���������00�H�R��	����0
  X��¢��
  R�����0�X��¢��
  R�����0�X��¢��
  R�����0X��¢��
  R�����0�X��¢��
  R�����0�X��¢��
  R�����0�8BX���¢�
  �����������¨��
  - (Landroid/content/Context;Lcom/stripe/android/googlepaylauncher/GooglePayEnvironment;Lcom/stripe/android/Logger;)V
  - Lcom/stripe/android/googlepaylauncher/GooglePayLauncherViewModel_Factory_WhenMappings;
  - SMAP
  AnalyticsRequestFactory.kt
  Kotlin
  *S Kotlin
  *F
  + 1 AnalyticsRequestFactory.kt
  com/stripe/android/networking/AnalyticsRequestFactory
  + 2 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,328:1
  1#2:329
  *E
  
  - SMAP
  AnalyticsRequestFactory.kt
  Kotlin
  *S Kotlin
  *F
  + 1 AnalyticsRequestFactory.kt
  com/stripe/android/networking/AnalyticsRequestFactory_ThreeDS2UiType_Companion
  + 2 _Arrays.kt
  kotlin/collections/ArraysKt___ArraysKt
  *L
  1#1,328:1
  1275#2,2:329
  *S KotlinDebug
  *F
  + 1 AnalyticsRequestFactory.kt
  com/stripe/android/networking/AnalyticsRequestFactory_ThreeDS2UiType_Companion
  *L
  288#1:329,2
  *E
  
  - SMAP
  GooglePayLauncherViewModel.kt
  Kotlin
  *S Kotlin
  *F
  + 1 GooglePayLauncherViewModel.kt
  com/stripe/android/googlepaylauncher/GooglePayLauncherViewModel
  + 2 Transformations.kt
  androidx/lifecycle/TransformationsKt
  + 3 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,281:1
  87#2:282
  1#3:283
  *S KotlinDebug
  *F
  + 1 GooglePayLauncherViewModel.kt
  com/stripe/android/googlepaylauncher/GooglePayLauncherViewModel
  *L
  50#1:282
  *E
  
  

TYPES:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   29844 │ 29845 │ +1 (+2 -1) 
  
  + Lcom/stripe/android/googlepaylauncher/GooglePayConfigConversionKtxKt_WhenMappings;
  + Lcom/stripe/android/googlepaylauncher/GooglePayConfigConversionKtxKt;
  
  - Lcom/stripe/android/googlepaylauncher/GooglePayLauncherViewModel_Factory_WhenMappings;
  

METHODS:

   old    │ new    │ diff      
  ────────┼────────┼───────────
   154671 │ 154671 │ 0 (+7 -7) 
  
  + com.stripe.android.googlepaylauncher.GooglePayConfigConversionKtxKt_WhenMappings <clinit>()
  + com.stripe.android.googlepaylauncher.GooglePayConfigConversionKtxKt convert(GooglePayLauncher_BillingAddressConfig) → GooglePayJsonFactory_BillingAddressParameters
  + com.stripe.android.googlepaylauncher.GooglePayConfigConversionKtxKt convert(GooglePayPaymentMethodLauncher_BillingAddressConfig) → GooglePayJsonFactory_BillingAddressParameters
  + com.stripe.android.googlepaylauncher.G
...✂

@michelleb-stripe michelleb-stripe changed the title Pass GooglePayLauncher arguments through [WIP] Pass GooglePayLauncher arguments through Sep 1, 2021
@michelleb-stripe michelleb-stripe changed the title [WIP] Pass GooglePayLauncher arguments through Pass GooglePayLauncher arguments to DefaultGooglePayRepository Sep 7, 2021
Comment on lines +24 to +25
GooglePayJsonFactory.BillingAddressParameters(),
true,
Copy link
Contributor

Choose a reason for hiding this comment

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

So for Payment Sheet we'll always require an existing Payment Method? I know this is the existing behavior, but thinking that we could set to false so Google Pay will still be an option and the user can add the Payment Method during checkout.

Choose a reason for hiding this comment

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

I think we should give developer more control, so he/she can manage the flow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did ask this question. The plan for now is to match iOS.

@michelleb-stripe michelleb-stripe merged commit 0f730ca into master Sep 9, 2021
@michelleb-stripe michelleb-stripe deleted the michelleb/googlepaylauncher branch September 9, 2021 18:58
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

4 participants