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
Add new CustomerSheet
playground
#8362
base: master
Are you sure you want to change the base?
Conversation
Diffuse output:
APK
|
...ipe/android/paymentsheet/example/playground/customersheet/CustomerSheetPlaygroundActivity.kt
Outdated
Show resolved
Hide resolved
...ipe/android/paymentsheet/example/playground/customersheet/CustomerSheetPlaygroundActivity.kt
Show resolved
Hide resolved
...pe/android/paymentsheet/example/playground/customersheet/CustomerSheetPlaygroundViewModel.kt
Outdated
Show resolved
Hide resolved
.../android/paymentsheet/example/playground/customersheet/settings/CountrySettingsDefinition.kt
Show resolved
Hide resolved
c49a1e7
to
78dc8c4
Compare
...ipe/android/paymentsheet/example/playground/customersheet/CustomerSheetPlaygroundActivity.kt
Show resolved
Hide resolved
.../android/paymentsheet/example/playground/customersheet/settings/CountrySettingsDefinition.kt
Outdated
Show resolved
Hide resolved
...pe/android/paymentsheet/example/playground/customersheet/CustomerSheetPlaygroundViewModel.kt
Outdated
Show resolved
Hide resolved
…ate `CountrySettingsDefinition` comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old playground had a button to launch payment sheet as well (with the same config) which made it easy to test the defaults go saved between the surfaces.
@@ -101,7 +101,7 @@ class MainActivity : AppCompatActivity() { | |||
MenuItem( | |||
titleResId = R.string.customersheet_playground_title, | |||
subtitleResId = R.string.playground_subtitle, | |||
klass = CustomerSheetPlaygroundActivity::class.java, | |||
klass = NewCustomerSheetPlaygroundActivity::class.java, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you replaced this menu item, but didn't delete the old playground.
} | ||
} | ||
|
||
@OptIn(ExperimentalCustomerSheetApi::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should opt-in for the class instead.
} | ||
|
||
@OptIn(ExperimentalCustomerSheetApi::class) | ||
fun fetchOption(customerSheet: CustomerSheet) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took some time to dig into this. I think we did it this way because of the PaymentOptionFactory
, and the only way we can supply that to create them is via CustomerSheet
.
In hindsight, we likely could have hacked around that technical limitation, and made a more compelling public API. Maybe we should reconsider before GA.
retrievePaymentOptionSelection
should probably live on the adapter. But how do we allow merchants to transform it to a PaymentOption
? As of now, we don't have a way to do that.
Summary
Adds a new version of the
CustomerSheet
playground using the architecture from thePaymentSheet
playground.Motivation
Makes it easier to add additional playground settings and create effective end-to-end tests.
Video
Playground.mp4