@stripe/stripe-react-native 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -1
- package/README.md +1 -1
- package/android/gradle.properties +2 -1
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +3 -2
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +14 -5
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +1 -1
- package/android/src/main/res/drawable/googlepay_button_content.xml +48 -0
- package/package.json +1 -1
- package/stripe-react-native.podspec +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.27.1 - 2023-05-03
|
|
6
|
+
|
|
7
|
+
> Note: [Xcode 13 is no longer supported by Apple](https://developer.apple.com/news/upcoming-requirements/). Please upgrade to Xcode 14.1 or later.
|
|
8
|
+
|
|
9
|
+
## Fixes
|
|
10
|
+
|
|
11
|
+
- Fixed the type of `created` on `Token.Result` on Android (was a number, should be a string). [#1369](https://github.com/stripe/stripe-react-native/pull/1369)
|
|
12
|
+
- Fixed `AddToWalletButton` not properly resolving the `androidAssetSource` in release mode. [#1373](https://github.com/stripe/stripe-react-native/pull/1373)
|
|
13
|
+
- Fixed `isPlatformPaySupported` not respecting `existingPaymentMethodRequired` or `testEnv` on Android. [#1374](https://github.com/stripe/stripe-react-native/pull/1374)
|
|
5
14
|
|
|
6
15
|
## 0.27.0 - 2023-04-21
|
|
7
16
|
|
|
8
17
|
### Features
|
|
9
18
|
|
|
10
|
-
- Added `billingDetailsCollectionConfiguration` to `initPaymentSheet` parameters. Use this to configure the collection of email, phone, name, or address in the Payment Sheet. [#1361](https://github.com/stripe/stripe-react-native/pull/1361)
|
|
19
|
+
- Added `billingDetailsCollectionConfiguration` to `initPaymentSheet` parameters. Use this to configure the collection of email, phone, name, or address in the Payment Sheet. [See the docs here](https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#collect-billing-details) [#1361](https://github.com/stripe/stripe-react-native/pull/1361)
|
|
11
20
|
|
|
12
21
|
### Fixes
|
|
13
22
|
|
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ implementation 'com.google.android.material:material:<version>'
|
|
|
96
96
|
|
|
97
97
|
#### iOS
|
|
98
98
|
|
|
99
|
-
The Stripe React Native SDK requires Xcode
|
|
99
|
+
The Stripe React Native SDK requires Xcode 14.1 or later and is compatible with apps targeting iOS 13 or above. For iOS 12 support, please use [`@stripe/stripe-react-native@0.19.0`](https://github.com/stripe/stripe-react-native/releases/tag/v0.19.0).
|
|
100
100
|
|
|
101
101
|
The SDK uses TypeScript features available in Babel version `7.9.0` and above.
|
|
102
102
|
Alternatively use the `plugin-transform-typescript` plugin in your project.
|
|
@@ -528,10 +528,11 @@ class StripeSdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJ
|
|
|
528
528
|
|
|
529
529
|
@ReactMethod
|
|
530
530
|
fun isPlatformPaySupported(params: ReadableMap?, promise: Promise) {
|
|
531
|
+
val googlePayParams = params?.getMap("googlePay")
|
|
531
532
|
val fragment = GooglePayPaymentMethodLauncherFragment(
|
|
532
533
|
reactApplicationContext,
|
|
533
|
-
getBooleanOrFalse(
|
|
534
|
-
getBooleanOrFalse(
|
|
534
|
+
getBooleanOrFalse(googlePayParams, "testEnv"),
|
|
535
|
+
getBooleanOrFalse(googlePayParams, "existingPaymentMethodRequired"),
|
|
535
536
|
promise
|
|
536
537
|
)
|
|
537
538
|
|
package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt
CHANGED
|
@@ -5,6 +5,7 @@ import android.graphics.Color
|
|
|
5
5
|
import android.graphics.drawable.Drawable
|
|
6
6
|
import android.graphics.drawable.RippleDrawable
|
|
7
7
|
import android.view.MotionEvent
|
|
8
|
+
import android.webkit.URLUtil
|
|
8
9
|
import androidx.appcompat.widget.AppCompatImageView
|
|
9
10
|
import com.bumptech.glide.RequestManager
|
|
10
11
|
import com.bumptech.glide.load.DataSource
|
|
@@ -27,7 +28,7 @@ class AddToWalletButtonView(private val context: ThemedReactContext, private val
|
|
|
27
28
|
private var token: ReadableMap? = null
|
|
28
29
|
|
|
29
30
|
private var eventDispatcher: EventDispatcher? = context.getNativeModule(UIManagerModule::class.java)?.eventDispatcher
|
|
30
|
-
private var loadedSource:
|
|
31
|
+
private var loadedSource: Any? = null
|
|
31
32
|
private var heightOverride: Int = 0
|
|
32
33
|
private var widthOverride: Int = 0
|
|
33
34
|
|
|
@@ -66,7 +67,7 @@ class AddToWalletButtonView(private val context: ThemedReactContext, private val
|
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
fun onAfterUpdateTransaction() {
|
|
69
|
-
val sourceToLoad =
|
|
70
|
+
val sourceToLoad = getUrlOrResourceId(sourceMap)
|
|
70
71
|
if (sourceToLoad == null) {
|
|
71
72
|
requestManager.clear(this)
|
|
72
73
|
setImageDrawable(null)
|
|
@@ -99,9 +100,17 @@ class AddToWalletButtonView(private val context: ThemedReactContext, private val
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
private fun
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
private fun getUrlOrResourceId(sourceMap: ReadableMap?): Any? {
|
|
104
|
+
sourceMap?.getString("uri")?.let {
|
|
105
|
+
return if (URLUtil.isValidUrl(it)) {
|
|
106
|
+
// Debug mode, Image.resolveAssetSource resolves to local http:// URL
|
|
107
|
+
GlideUrl(it)
|
|
108
|
+
} else {
|
|
109
|
+
// Release mode, Image.resolveAssetSource resolves to a drawable resource
|
|
110
|
+
context.resources.getIdentifier(it, "drawable", context.packageName)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return null
|
|
105
114
|
}
|
|
106
115
|
|
|
107
116
|
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
|
@@ -314,7 +314,7 @@ internal fun mapFromCard(card: Card?): WritableMap? {
|
|
|
314
314
|
internal fun mapFromToken(token: Token): WritableMap {
|
|
315
315
|
val tokenMap: WritableMap = WritableNativeMap()
|
|
316
316
|
tokenMap.putString("id", token.id)
|
|
317
|
-
tokenMap.
|
|
317
|
+
tokenMap.putString("created", token.created.time.toString())
|
|
318
318
|
tokenMap.putString("type", mapTokenType(token.type))
|
|
319
319
|
tokenMap.putBoolean("livemode", token.livemode)
|
|
320
320
|
tokenMap.putMap("bankAccount", mapFromBankAccount(token.bankAccount))
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
android:width="41dp"
|
|
3
|
+
android:height="17dp"
|
|
4
|
+
android:viewportWidth="41.0"
|
|
5
|
+
android:viewportHeight="17.0">
|
|
6
|
+
<path
|
|
7
|
+
android:pathData="M19.526,2.635L19.526,6.718L22.044,6.718C22.644,6.718 23.14,6.516 23.532,6.113C23.935,5.711 24.137,5.231 24.137,4.676C24.137,4.132 23.935,3.658 23.532,3.254C23.14,2.841 22.644,2.634 22.044,2.634L19.526,2.634L19.526,2.635ZM19.526,8.155L19.526,12.891L18.022,12.891L18.022,1.198L22.011,1.198C23.025,1.198 23.885,1.535 24.594,2.21C25.314,2.885 25.674,3.707 25.674,4.676C25.674,5.667 25.314,6.495 24.594,7.158C23.897,7.823 23.035,8.154 22.011,8.154L19.526,8.154L19.526,8.155Z"
|
|
8
|
+
android:strokeColor="#00000000"
|
|
9
|
+
android:fillType="evenOdd"
|
|
10
|
+
android:fillColor="#FFFFFF"
|
|
11
|
+
android:strokeWidth="1"/>
|
|
12
|
+
<path
|
|
13
|
+
android:pathData="M27.194,10.442C27.194,10.834 27.36,11.16 27.693,11.422C28.025,11.683 28.415,11.813 28.861,11.813C29.494,11.813 30.057,11.579 30.553,11.112C31.05,10.643 31.297,10.093 31.297,9.463C30.828,9.092 30.174,8.907 29.335,8.907C28.724,8.907 28.215,9.055 27.807,9.349C27.398,9.643 27.194,10.006 27.194,10.442M29.14,4.627C30.252,4.627 31.129,4.924 31.773,5.518C32.415,6.111 32.737,6.925 32.737,7.959L32.737,12.891L31.298,12.891L31.298,11.781L31.233,11.781C30.611,12.695 29.783,13.153 28.747,13.153C27.865,13.153 27.126,12.891 26.532,12.369C25.938,11.846 25.641,11.193 25.641,10.409C25.641,9.581 25.954,8.923 26.581,8.433C27.208,7.943 28.044,7.698 29.09,7.698C29.983,7.698 30.72,7.861 31.297,8.188L31.297,7.844C31.297,7.322 31.09,6.878 30.676,6.513C30.261,6.149 29.777,5.967 29.221,5.967C28.381,5.967 27.717,6.32 27.226,7.029L25.902,6.195C26.632,5.15 27.711,4.627 29.14,4.627"
|
|
14
|
+
android:strokeColor="#00000000"
|
|
15
|
+
android:fillType="evenOdd"
|
|
16
|
+
android:fillColor="#FFFFFF"
|
|
17
|
+
android:strokeWidth="1"/>
|
|
18
|
+
<path
|
|
19
|
+
android:pathData="M40.993,4.889l-5.02,11.531l-1.553,0l1.864,-4.035l-3.303,-7.496l1.635,0l2.387,5.749l0.033,0l2.322,-5.749z"
|
|
20
|
+
android:strokeColor="#00000000"
|
|
21
|
+
android:fillType="evenOdd"
|
|
22
|
+
android:fillColor="#FFFFFF"
|
|
23
|
+
android:strokeWidth="1"/>
|
|
24
|
+
<path
|
|
25
|
+
android:pathData="M13.448,7.134C13.448,6.661 13.408,6.205 13.332,5.768L6.988,5.768L6.988,8.356L10.622,8.356C10.466,9.199 9.994,9.917 9.278,10.398L9.278,12.079L11.447,12.079C12.716,10.908 13.448,9.179 13.448,7.134"
|
|
26
|
+
android:strokeColor="#00000000"
|
|
27
|
+
android:fillType="evenOdd"
|
|
28
|
+
android:fillColor="#4285F4"
|
|
29
|
+
android:strokeWidth="1"/>
|
|
30
|
+
<path
|
|
31
|
+
android:pathData="M6.988,13.701C8.804,13.701 10.332,13.105 11.447,12.079L9.278,10.398C8.675,10.804 7.897,11.041 6.988,11.041C5.234,11.041 3.744,9.859 3.212,8.267L0.978,8.267L0.978,9.998C2.085,12.193 4.36,13.701 6.988,13.701"
|
|
32
|
+
android:strokeColor="#00000000"
|
|
33
|
+
android:fillType="evenOdd"
|
|
34
|
+
android:fillColor="#34A853"
|
|
35
|
+
android:strokeWidth="1"/>
|
|
36
|
+
<path
|
|
37
|
+
android:pathData="M3.212,8.267C3.076,7.861 3.001,7.428 3.001,6.981C3.001,6.534 3.076,6.101 3.212,5.695L3.212,3.964L0.978,3.964C0.52,4.871 0.261,5.896 0.261,6.981C0.261,8.066 0.52,9.091 0.978,9.998L3.212,8.267Z"
|
|
38
|
+
android:strokeColor="#00000000"
|
|
39
|
+
android:fillType="evenOdd"
|
|
40
|
+
android:fillColor="#FABB05"
|
|
41
|
+
android:strokeWidth="1"/>
|
|
42
|
+
<path
|
|
43
|
+
android:pathData="M6.988,2.921C7.98,2.921 8.868,3.262 9.569,3.929L9.569,3.93L11.489,2.012C10.323,0.928 8.803,0.261 6.988,0.261C4.36,0.261 2.085,1.769 0.978,3.964L3.212,5.695C3.744,4.103 5.234,2.921 6.988,2.921"
|
|
44
|
+
android:strokeColor="#00000000"
|
|
45
|
+
android:fillType="evenOdd"
|
|
46
|
+
android:fillColor="#E94235"
|
|
47
|
+
android:strokeWidth="1"/>
|
|
48
|
+
</vector>
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
require 'json'
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
-
stripe_version
|
|
4
|
+
# Keep stripe_version in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/stripe-identity-react-native.podspec
|
|
5
|
+
stripe_version = '~> 23.7.0'
|
|
5
6
|
|
|
6
7
|
Pod::Spec.new do |s|
|
|
7
8
|
s.name = 'stripe-react-native'
|