@stripe/stripe-react-native 0.59.1 → 0.60.0
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/README.md +6 -3
- package/android/gradle.properties +2 -2
- package/android/src/main/java/com/reactnativestripesdk/FakeOnrampSdkModule.kt +2 -7
- package/android/src/main/java/com/reactnativestripesdk/PaymentElementConfig.kt +20 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfig.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +124 -88
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +12 -9
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeOnrampSdkModuleSpec.java +0 -4
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +6 -5
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampMappers.kt +157 -0
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +130 -189
- package/android/src/test/java/com/reactnativestripesdk/PaymentElementConfigTest.kt +72 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfigTest.kt +3 -3
- package/android/src/test/java/com/reactnativestripesdk/mappers/OnrampMappersTest.kt +219 -0
- package/ios/Mappers.swift +10 -0
- package/ios/PaymentMethodMessagingElementConfig.swift +1 -1
- package/ios/StripeOnrampSdk.mm +0 -6
- package/ios/StripeSdkImpl+PaymentSheet.swift +25 -0
- package/ios/StripeSdkImpl.swift +5 -37
- package/jest/mock.js +1 -1
- package/jest/setup.js +0 -1
- package/lib/commonjs/components/AddToWalletButton.js +1 -1
- package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
- package/lib/commonjs/components/AddressSheet.js +1 -1
- package/lib/commonjs/components/AddressSheet.js.map +1 -1
- package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
- package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
- package/lib/commonjs/components/CardField.js +1 -1
- package/lib/commonjs/components/CardField.js.map +1 -1
- package/lib/commonjs/components/CardForm.js +1 -1
- package/lib/commonjs/components/CardForm.js.map +1 -1
- package/lib/commonjs/components/PlatformPayButton.js +1 -1
- package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
- package/lib/commonjs/components/StripeContainer.js +1 -1
- package/lib/commonjs/components/StripeContainer.js.map +1 -1
- package/lib/commonjs/connect/Components.js +1 -1
- package/lib/commonjs/connect/Components.js.map +1 -1
- package/lib/commonjs/connect/ConnectComponentsProvider.js +1 -1
- package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -1
- package/lib/commonjs/connect/EmbeddedComponent.js +1 -1
- package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -1
- package/lib/commonjs/connect/ModalCloseButton.js +1 -1
- package/lib/commonjs/connect/ModalCloseButton.js.map +1 -1
- package/lib/commonjs/connect/NavigationBar.js +1 -1
- package/lib/commonjs/connect/NavigationBar.js.map +1 -1
- package/lib/commonjs/helpers.js +1 -1
- package/lib/commonjs/hooks/useOnramp.js +1 -1
- package/lib/commonjs/hooks/useOnramp.js.map +1 -1
- package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
- package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
- package/lib/commonjs/specs/NativeAuBECSDebitForm.js +1 -1
- package/lib/commonjs/specs/NativeCardField.js +1 -1
- package/lib/commonjs/specs/NativeCardField.js.map +1 -1
- package/lib/commonjs/specs/NativeCardForm.js +1 -1
- package/lib/commonjs/specs/NativeCardForm.js.map +1 -1
- package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js +1 -1
- package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/specs/NativeGooglePayButton.js +1 -1
- package/lib/commonjs/specs/NativeNavigationBar.js +1 -1
- package/lib/commonjs/specs/NativeOnrampSdkModule.js.map +1 -1
- package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js +1 -1
- package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/types/Onramp.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.js +1 -1
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/module/components/AddToWalletButton.js +1 -1
- package/lib/module/components/AddToWalletButton.js.map +1 -1
- package/lib/module/components/AddressSheet.js +1 -1
- package/lib/module/components/AddressSheet.js.map +1 -1
- package/lib/module/components/AuBECSDebitForm.js +1 -1
- package/lib/module/components/AuBECSDebitForm.js.map +1 -1
- package/lib/module/components/CardField.js +1 -1
- package/lib/module/components/CardField.js.map +1 -1
- package/lib/module/components/CardForm.js +1 -1
- package/lib/module/components/CardForm.js.map +1 -1
- package/lib/module/components/PlatformPayButton.js +1 -1
- package/lib/module/components/PlatformPayButton.js.map +1 -1
- package/lib/module/components/StripeContainer.js +1 -1
- package/lib/module/components/StripeContainer.js.map +1 -1
- package/lib/module/connect/Components.js +1 -1
- package/lib/module/connect/Components.js.map +1 -1
- package/lib/module/connect/ConnectComponentsProvider.js +1 -1
- package/lib/module/connect/ConnectComponentsProvider.js.map +1 -1
- package/lib/module/connect/EmbeddedComponent.js +1 -1
- package/lib/module/connect/EmbeddedComponent.js.map +1 -1
- package/lib/module/connect/ModalCloseButton.js +1 -1
- package/lib/module/connect/ModalCloseButton.js.map +1 -1
- package/lib/module/connect/NavigationBar.js +1 -1
- package/lib/module/connect/NavigationBar.js.map +1 -1
- package/lib/module/helpers.js +1 -1
- package/lib/module/hooks/useOnramp.js +1 -1
- package/lib/module/hooks/useOnramp.js.map +1 -1
- package/lib/module/specs/NativeAddToWalletButton.js +1 -1
- package/lib/module/specs/NativeAddressSheet.js +1 -1
- package/lib/module/specs/NativeApplePayButton.js +1 -1
- package/lib/module/specs/NativeAuBECSDebitForm.js +1 -1
- package/lib/module/specs/NativeCardField.js +1 -1
- package/lib/module/specs/NativeCardField.js.map +1 -1
- package/lib/module/specs/NativeCardForm.js +1 -1
- package/lib/module/specs/NativeCardForm.js.map +1 -1
- package/lib/module/specs/NativeConnectAccountOnboardingView.js +1 -1
- package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
- package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
- package/lib/module/specs/NativeGooglePayButton.js +1 -1
- package/lib/module/specs/NativeNavigationBar.js +1 -1
- package/lib/module/specs/NativeOnrampSdkModule.js.map +1 -1
- package/lib/module/specs/NativePaymentMethodMessagingElement.js +1 -1
- package/lib/module/specs/NativeStripeContainer.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/module/types/Onramp.js.map +1 -1
- package/lib/module/types/PaymentSheet.js +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/typescript/src/hooks/useOnramp.d.ts +3 -9
- package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts +0 -1
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/Onramp.d.ts +30 -12
- package/lib/typescript/src/types/Onramp.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +22 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +0 -5
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/hooks/useOnramp.tsx +9 -17
- package/src/specs/NativeOnrampSdkModule.ts +0 -1
- package/src/types/Onramp.ts +32 -15
- package/src/types/PaymentSheet.ts +23 -0
- package/src/types/index.ts +0 -6
- package/stripe-react-native.podspec +1 -1
- package/android/.idea/AndroidProjectSystem.xml +0 -6
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -18
- package/android/.idea/migrations.xml +0 -10
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/runConfigurations.xml +0 -17
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
package/src/types/Onramp.ts
CHANGED
|
@@ -14,6 +14,36 @@ export type Configuration = {
|
|
|
14
14
|
appearance: LinkAppearance;
|
|
15
15
|
/** The identifier of the Stripe crypto customer object. */
|
|
16
16
|
cryptoCustomerId?: string;
|
|
17
|
+
/** Google Pay configuration. Required on Android to enable Google Pay as a payment method. */
|
|
18
|
+
googlePay?: GooglePayConfig;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Configuration for Google Pay within the onramp flow.
|
|
23
|
+
*/
|
|
24
|
+
export type GooglePayConfig = {
|
|
25
|
+
/** Whether to use the test environment. Defaults to false. */
|
|
26
|
+
testEnv?: boolean;
|
|
27
|
+
/** Two-letter ISO 3166-1 alpha-2 country code of the merchant. */
|
|
28
|
+
merchantCountryCode: string;
|
|
29
|
+
/** Merchant name displayed in the Google Pay sheet. */
|
|
30
|
+
merchantName: string;
|
|
31
|
+
/** Whether an existing payment method is required. Defaults to false. */
|
|
32
|
+
existingPaymentMethodRequired?: boolean;
|
|
33
|
+
/** Billing address collection configuration. */
|
|
34
|
+
billingAddressConfig?: GooglePayBillingAddressConfig;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Billing address configuration for Google Pay.
|
|
39
|
+
*/
|
|
40
|
+
export type GooglePayBillingAddressConfig = {
|
|
41
|
+
/** Whether a billing address is required. Defaults to false. */
|
|
42
|
+
isRequired?: boolean;
|
|
43
|
+
/** Format of the billing address. Defaults to 'Min'. */
|
|
44
|
+
format?: 'Min' | 'Full';
|
|
45
|
+
/** Whether a phone number is required. Defaults to false. */
|
|
46
|
+
isPhoneNumberRequired?: boolean;
|
|
17
47
|
};
|
|
18
48
|
|
|
19
49
|
/**
|
|
@@ -215,21 +245,6 @@ export type RegisterLinkUserResult =
|
|
|
215
245
|
error: StripeError<OnrampError>;
|
|
216
246
|
};
|
|
217
247
|
|
|
218
|
-
/**
|
|
219
|
-
* Result of authenticating an existing Link user.
|
|
220
|
-
*/
|
|
221
|
-
export type AuthenticateUserResult =
|
|
222
|
-
| {
|
|
223
|
-
/** The crypto customer ID after successful authentication. */
|
|
224
|
-
customerId: string;
|
|
225
|
-
error?: undefined;
|
|
226
|
-
}
|
|
227
|
-
| {
|
|
228
|
-
customerId?: undefined;
|
|
229
|
-
/** Present if authentication failed with an error. */
|
|
230
|
-
error: StripeError<OnrampError>;
|
|
231
|
-
};
|
|
232
|
-
|
|
233
248
|
/**
|
|
234
249
|
* Describes the payment method currently selected by the user.
|
|
235
250
|
*/
|
|
@@ -243,6 +258,8 @@ export type PaymentMethodDisplayData = {
|
|
|
243
258
|
label: string;
|
|
244
259
|
/** Details about the underlying payment method, e.g., "Visa Credit •••• 4242". */
|
|
245
260
|
sublabel?: string;
|
|
261
|
+
/** The type of payment method */
|
|
262
|
+
type: 'Card' | 'BankAccount' | 'ApplePay' | 'GooglePay';
|
|
246
263
|
};
|
|
247
264
|
|
|
248
265
|
/**
|
|
@@ -97,6 +97,19 @@ export type SetupParamsBase = IntentParams & {
|
|
|
97
97
|
* the card entry form will initialize with the card scanner already open.
|
|
98
98
|
* Defaults to false. */
|
|
99
99
|
opensCardScannerAutomatically?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* A map of payment method types to their terms display configuration.
|
|
102
|
+
* Controls whether legal agreements (e.g. card mandate disclaimers) are shown for each payment method type.
|
|
103
|
+
* Keys are snake_case payment method type strings (e.g. "card", "us_bank_account").
|
|
104
|
+
* See https://docs.stripe.com/api/payment_methods/object#payment_method_object-type for the full list of values.
|
|
105
|
+
* Values are `TermsDisplay.AUTOMATIC` or `TermsDisplay.NEVER`.
|
|
106
|
+
* If not set, defaults to `TermsDisplay.AUTOMATIC` for all payment method types.
|
|
107
|
+
*
|
|
108
|
+
* Example: `{ card: TermsDisplay.NEVER }` to hide the card mandate disclaimer.
|
|
109
|
+
*/
|
|
110
|
+
termsDisplay?: {
|
|
111
|
+
[key: string]: TermsDisplay;
|
|
112
|
+
};
|
|
100
113
|
};
|
|
101
114
|
|
|
102
115
|
export type SetupParams =
|
|
@@ -189,6 +202,16 @@ export enum LinkDisplay {
|
|
|
189
202
|
NEVER = 'never',
|
|
190
203
|
}
|
|
191
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Controls whether legal terms (e.g. mandate disclaimers) are displayed for a payment method.
|
|
207
|
+
*/
|
|
208
|
+
export enum TermsDisplay {
|
|
209
|
+
/** Show legal agreements only when necessary. */
|
|
210
|
+
AUTOMATIC = 'automatic',
|
|
211
|
+
/** Never show legal agreements. */
|
|
212
|
+
NEVER = 'never',
|
|
213
|
+
}
|
|
214
|
+
|
|
192
215
|
/**
|
|
193
216
|
* Used to customize the appearance of your PaymentSheet
|
|
194
217
|
*/
|
package/src/types/index.ts
CHANGED
|
@@ -293,9 +293,3 @@ export type CollectBankAccountForSetupResult =
|
|
|
293
293
|
setupIntent?: undefined;
|
|
294
294
|
error: StripeError<CollectBankAccountError>;
|
|
295
295
|
};
|
|
296
|
-
|
|
297
|
-
export type PaymentOptionData = {
|
|
298
|
-
icon: string; // base64 string
|
|
299
|
-
label: string;
|
|
300
|
-
sublabel?: string;
|
|
301
|
-
};
|
|
@@ -2,7 +2,7 @@ require 'json'
|
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
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 = '~> 25.
|
|
5
|
+
stripe_version = '~> 25.7.0'
|
|
6
6
|
|
|
7
7
|
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
8
8
|
|
package/android/.idea/gradle.xml
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="GradleMigrationSettings" migrationVersion="1" />
|
|
4
|
-
<component name="GradleSettings">
|
|
5
|
-
<option name="linkedExternalProjectsSettings">
|
|
6
|
-
<GradleProjectSettings>
|
|
7
|
-
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
|
8
|
-
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
9
|
-
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
|
10
|
-
<option name="modules">
|
|
11
|
-
<set>
|
|
12
|
-
<option value="$PROJECT_DIR$" />
|
|
13
|
-
</set>
|
|
14
|
-
</option>
|
|
15
|
-
</GradleProjectSettings>
|
|
16
|
-
</option>
|
|
17
|
-
</component>
|
|
18
|
-
</project>
|
package/android/.idea/misc.xml
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
4
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
|
5
|
-
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
6
|
-
</component>
|
|
7
|
-
<component name="ProjectType">
|
|
8
|
-
<option name="id" value="Android" />
|
|
9
|
-
</component>
|
|
10
|
-
</project>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="RunConfigurationProducerService">
|
|
4
|
-
<option name="ignoredProducers">
|
|
5
|
-
<set>
|
|
6
|
-
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
|
7
|
-
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
|
8
|
-
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
|
9
|
-
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
|
10
|
-
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
|
11
|
-
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
|
12
|
-
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
|
13
|
-
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
|
14
|
-
</set>
|
|
15
|
-
</option>
|
|
16
|
-
</component>
|
|
17
|
-
</project>
|
package/android/.idea/vcs.xml
DELETED
package/android/local.properties
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
-
# as it contains information specific to your local configuration.
|
|
3
|
-
#
|
|
4
|
-
# Location of the SDK. This is only used by Gradle.
|
|
5
|
-
# For customization when using a Version Control System, please read the
|
|
6
|
-
# header note.
|
|
7
|
-
#Fri Aug 30 15:10:34 EDT 2024
|
|
8
|
-
sdk.dir=/Users/samer/Library/Android/sdk
|