You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrong behavior on select payment method.
After calling presentPaymentMethodSelection(), if a user already has selected payment method and on click "back" on the activity AppBar or with the hardware button - onActivityResult receive Activity.RESULT_OK, but need to return Activity.RESULT_CANCELED.
Code to reproduce
private val paymentSession by lazy { PaymentSession(this) }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
paymentSession.init(paymentSessionListener, PaymentSessionConfig.Builder().build(), savedInstanceState)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data) // received resultCode = -1 (Activity.RESULT_OK)
data?.let {
paymentSession.handlePaymentData(requestCode, resultCode, it)
}
}
Android version
6, 7, 8, 9, 10
Impacted devices
Google Pixel, Google Pixel 3
Installation method
Gradle
SDK version
12.3.0
Other information
On click "back" on the activity AppBar back on selecting a payment method must return resultCode = Activity.RESULT_CANCELED (0) in onActivityResult instead of Activity.RESULT_OK (-1)
The text was updated successfully, but these errors were encountered:
@valentynsmetanin thanks for filing. Can you help me understand the underlying issue you're running into? Is it that the behavior changed from when you upgraded to the latest version, or that you simply expect a user tapping back to return Activity.RESULT_CANCELED?
I recommend not checking the result code yourself - let paymentSession.handlePaymentData() handle it.
@mshafrir-stripe It's expected result in onActivityResult (Activity.RESULT_CANCELED) on back pressed. Also I have PaymentSession.PaymentSessionListener with own business logic. And I receive data in onPaymentSessionDataChanged on click "back" on the activity AppBar or with the hardware button too.
…Data() logic
`PaymentMethodsActivity` should use `Activity.RESULT_CANCELED`
when the user taps back via the toolbar or back button;
`Activity.RESULT_OK` otherwise.
This signals to the user what happened during in
`PaymentMethodsActivity`.
Fixes#1806
…Data() logic (#1820)
`PaymentMethodsActivity` should use `Activity.RESULT_CANCELED`
when the user taps back via the toolbar or back button;
`Activity.RESULT_OK` otherwise.
This signals to the user what happened during in
`PaymentMethodsActivity`.
Fixes#1806
Summary
Wrong behavior on select payment method.
After calling presentPaymentMethodSelection(), if a user already has selected payment method and on click "back" on the activity AppBar or with the hardware button - onActivityResult receive Activity.RESULT_OK, but need to return Activity.RESULT_CANCELED.
Code to reproduce
Android version
6, 7, 8, 9, 10
Impacted devices
Google Pixel, Google Pixel 3
Installation method
Gradle
SDK version
12.3.0
Other information
On click "back" on the activity AppBar back on selecting a payment method must return resultCode = Activity.RESULT_CANCELED (0) in onActivityResult instead of Activity.RESULT_OK (-1)
The text was updated successfully, but these errors were encountered: