Skip to content

Commit

Permalink
fix: manually forward activity results to paymentLauncherFragment (#932)
Browse files Browse the repository at this point in the history
* manually forward activity results to paymentLauncherFragment

* [skip actions] changelog
  • Loading branch information
charliecruzan-stripe committed May 9, 2022
1 parent 8b10432 commit e0e651d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [#914](https://github.com/stripe/stripe-react-native/pull/914) fix: add `fingerprint` to Card result object on Android (already present on iOS)
- [#912](https://github.com/stripe/stripe-react-native/pull/912) fix: allow for providing zip code straight from `CardField` component on Android
- [#925](https://github.com/stripe/stripe-react-native/pull/925) Feat: `us_bank_account` payment method is now available in the payment sheet on iOS. (& Updated `stripe-ios` from 22.2.0 to 22.3.0)
- [#932](https://github.com/stripe/stripe-react-native/pull/932) fix: manually forward activity results to paymentLauncherFragment

## 0.8.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ class StripeSdkModule(private val reactContext: ReactApplicationContext) : React
private val mActivityEventListener = object : BaseActivityEventListener() {
override fun onActivityResult(activity: Activity, requestCode: Int, resultCode: Int, data: Intent?) {
if (::stripe.isInitialized) {
// BEGIN - Necessary on older versions of React Native (~0.64 and below)
paymentSheetFragment?.activity?.activityResultRegistry?.dispatchResult(requestCode, resultCode, data)
googlePayFragment?.activity?.activityResultRegistry?.dispatchResult(requestCode, resultCode, data)
paymentLauncherFragment.activity?.activityResultRegistry?.dispatchResult(requestCode, resultCode, data)
// END
try {
val result = AddPaymentMethodActivityStarter.Result.fromIntent(data)
if (data?.getParcelableExtra<Parcelable>("extra_activity_result") != null) {
Expand Down

0 comments on commit e0e651d

Please sign in to comment.