Skip to content

Commit 83776ef

Browse files
Update to the latest Android SDK, and adopt the new PaymentOptionResultCallback.
1 parent 4b07510 commit 83776ef

4 files changed

Lines changed: 12 additions & 16 deletions

File tree

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ StripeSdk_compileSdkVersion=30
33
StripeSdk_targetSdkVersion=28
44
StripeSdk_minSdkVersion=21
55
# Keep StripeSdk_stripeVersion in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/android/gradle.properties
6-
StripeSdk_stripeVersion=21.22.+
6+
StripeSdk_stripeVersion=21.23.+

android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import com.stripe.android.paymentsheet.CreateIntentCallback
4646
import com.stripe.android.paymentsheet.CreateIntentResult
4747
import com.stripe.android.paymentsheet.ExperimentalCustomerSessionApi
4848
import com.stripe.android.paymentsheet.PaymentOptionCallback
49+
import com.stripe.android.paymentsheet.PaymentOptionResultCallback
4950
import com.stripe.android.paymentsheet.PaymentSheet
5051
import com.stripe.android.paymentsheet.PaymentSheetResult
5152
import com.stripe.android.paymentsheet.PaymentSheetResultCallback
@@ -124,9 +125,9 @@ class PaymentSheetFragment :
124125
}
125126

126127
val paymentOptionCallback =
127-
PaymentOptionCallback { paymentOption ->
128+
PaymentOptionResultCallback { paymentOptionResult ->
128129
val result =
129-
paymentOption?.let {
130+
paymentOptionResult.paymentOption?.let {
130131
val bitmap = getBitmapFromVectorDrawable(context, it.drawableResourceId)
131132
val imageString = getBase64FromBitmap(bitmap)
132133
val option: WritableMap = WritableNativeMap()
@@ -272,15 +273,15 @@ class PaymentSheetFragment :
272273
PaymentSheet.FlowController
273274
.Builder(
274275
resultCallback = paymentResultCallback,
275-
paymentOptionCallback = paymentOptionCallback,
276+
paymentOptionResultCallback = paymentOptionCallback,
276277
).createIntentCallback(createIntentCallback)
277278
.confirmCustomPaymentMethodCallback(this)
278279
.build(this)
279280
} else {
280281
PaymentSheet.FlowController
281282
.Builder(
282283
resultCallback = paymentResultCallback,
283-
paymentOptionCallback = paymentOptionCallback,
284+
paymentOptionResultCallback = paymentOptionCallback,
284285
).confirmCustomPaymentMethodCallback(this)
285286
.build(this)
286287
}

example/ios/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ PODS:
16911691
- StripePayments (= 24.19.0)
16921692
- StripePaymentsUI (= 24.19.0)
16931693
- StripeUICore (= 24.19.0)
1694-
- stripe-react-native (0.50.1):
1694+
- stripe-react-native (0.50.3):
16951695
- DoubleConversion
16961696
- glog
16971697
- hermes-engine
@@ -1712,14 +1712,14 @@ PODS:
17121712
- ReactCommon/turbomodule/bridging
17131713
- ReactCommon/turbomodule/core
17141714
- Stripe (~> 24.19.0)
1715-
- stripe-react-native/NewArch (= 0.50.1)
1715+
- stripe-react-native/NewArch (= 0.50.3)
17161716
- StripeApplePay (~> 24.19.0)
17171717
- StripeFinancialConnections (~> 24.19.0)
17181718
- StripePayments (~> 24.19.0)
17191719
- StripePaymentSheet (~> 24.19.0)
17201720
- StripePaymentsUI (~> 24.19.0)
17211721
- Yoga
1722-
- stripe-react-native/NewArch (0.50.1):
1722+
- stripe-react-native/NewArch (0.50.3):
17231723
- DoubleConversion
17241724
- glog
17251725
- hermes-engine
@@ -1746,7 +1746,7 @@ PODS:
17461746
- StripePaymentSheet (~> 24.19.0)
17471747
- StripePaymentsUI (~> 24.19.0)
17481748
- Yoga
1749-
- stripe-react-native/Tests (0.50.1):
1749+
- stripe-react-native/Tests (0.50.3):
17501750
- DoubleConversion
17511751
- glog
17521752
- hermes-engine
@@ -2110,7 +2110,7 @@ SPEC CHECKSUMS:
21102110
RNScreens: 991214b4e69016c1ae32830d9cea31c9c9422367
21112111
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
21122112
Stripe: d1824162e4bcb6ead10401a0dc8e8a3d5ffee41f
2113-
stripe-react-native: 0a175dece5787169285638bb62d071d72f75ec0b
2113+
stripe-react-native: 9c720f5669d0c82f67e1ccab107d13eee4c17aed
21142114
StripeApplePay: eb64705d3c919492b1b28876652fd0aca2db38cc
21152115
StripeCore: b5bee05167f0c8ccce936244a031a9972fdeade8
21162116
StripeFinancialConnections: fd6c661f86f47b1d26a32f588b3a0b09826aba84
@@ -2122,4 +2122,4 @@ SPEC CHECKSUMS:
21222122

21232123
PODFILE CHECKSUM: a2ed964678852d4cc306ff4add3e4fa90be77ea6
21242124

2125-
COCOAPODS: 1.15.2
2125+
COCOAPODS: 1.16.2

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7124,11 +7124,6 @@ yargs@^17.3.1, yargs@^17.5.1, yargs@^17.6.2:
71247124
y18n "^5.0.5"
71257125
yargs-parser "^21.1.1"
71267126

7127-
yarn@^1.22.22:
7128-
version "1.22.22"
7129-
resolved "https://registry.npmjs.org/yarn/-/yarn-1.22.22.tgz"
7130-
integrity sha512-prL3kGtyG7o9Z9Sv8IPfBNrWTDmXB4Qbes8A9rEzt6wkJV8mUvoirjU0Mp3GGAU06Y0XQyA3/2/RQFVuK7MTfg==
7131-
71327127
yn@3.1.1:
71337128
version "3.1.1"
71347129
resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz"

0 commit comments

Comments
 (0)