@stripe/stripe-react-native 0.8.0 → 0.9.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/CHANGELOG.md +18 -0
- package/README.md +2 -2
- package/android/src/main/java/com/reactnativestripesdk/CardChangedEvent.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +3 -0
- package/android/src/main/java/com/reactnativestripesdk/CardFormCompleteEvent.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/Mappers.kt +22 -22
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +36 -5
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +38 -15
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +3 -8
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +6 -10
- package/ios/CardFieldView.swift +1 -0
- package/ios/CardFormView.swift +1 -0
- package/ios/Mappers.swift +2 -0
- package/ios/PaymentMethodFactory.swift +8 -0
- package/ios/StripeSdk.swift +5 -1
- package/ios/pushprovisioning/AddToWalletButtonManager.m +1 -4
- package/ios/pushprovisioning/AddToWalletButtonView.swift +12 -14
- package/lib/commonjs/components/AddToWalletButton.js +1 -1
- package/lib/commonjs/components/AddToWalletButton.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/StripeProvider.js +1 -1
- package/lib/commonjs/components/StripeProvider.js.map +1 -1
- package/lib/commonjs/types/SetupIntent.js.map +1 -1
- package/lib/commonjs/types/components/CardFieldInput.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/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/StripeProvider.js +1 -1
- package/lib/module/components/StripeProvider.js.map +1 -1
- package/lib/module/types/SetupIntent.js.map +1 -1
- package/lib/module/types/components/CardFieldInput.js.map +1 -1
- package/lib/typescript/example/src/App.d.ts +1 -0
- package/lib/typescript/example/src/screens/PayPalScreen.d.ts +1 -0
- package/lib/typescript/src/components/AddToWalletButton.d.ts +18 -11
- package/lib/typescript/src/types/PaymentMethod.d.ts +8 -2
- package/lib/typescript/src/types/SetupIntent.d.ts +1 -1
- package/lib/typescript/src/types/components/CardFieldInput.d.ts +1 -0
- package/lib/typescript/src/types/components/CardFormView.d.ts +1 -0
- package/package.json +2 -2
- package/src/components/AddToWalletButton.tsx +18 -11
- package/src/components/CardField.tsx +2 -1
- package/src/components/CardForm.tsx +2 -1
- package/src/types/PaymentMethod.ts +10 -1
- package/src/types/SetupIntent.ts +18 -1
- package/src/types/components/CardFieldInput.ts +1 -0
- package/src/types/components/CardFormView.ts +1 -0
- package/stripe-react-native.podspec +3 -2
|
@@ -18,7 +18,7 @@ export interface Result {
|
|
|
18
18
|
Upi: UpiResult;
|
|
19
19
|
USBankAccount: USBankAccountResult;
|
|
20
20
|
}
|
|
21
|
-
export declare type CreateParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams;
|
|
21
|
+
export declare type CreateParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams;
|
|
22
22
|
export declare type ConfirmParams = CreateParams;
|
|
23
23
|
export declare type CreateOptions = {
|
|
24
24
|
setupFutureUsage?: FutureUsage;
|
|
@@ -149,6 +149,12 @@ export declare type USBankAccountParams = {
|
|
|
149
149
|
accountType?: BankAcccountType;
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
|
+
export declare type PayPalParams = {
|
|
153
|
+
paymentMethodType: 'PayPal';
|
|
154
|
+
paymentMethodData?: {
|
|
155
|
+
billingDetails?: BillingDetails;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
152
158
|
export interface AuBecsDebitResult {
|
|
153
159
|
fingerprint?: string;
|
|
154
160
|
last4?: string;
|
|
@@ -198,7 +204,7 @@ export declare type USBankAccountResult = {
|
|
|
198
204
|
preferredNetwork?: string;
|
|
199
205
|
supportedNetworks?: string[];
|
|
200
206
|
};
|
|
201
|
-
export declare type Type = 'AfterpayClearpay' | 'Card' | 'Alipay' | 'GrabPay' | 'Ideal' | 'Fpx' | 'CardPresent' | 'SepaDebit' | 'AuBecsDebit' | 'BacsDebit' | 'Giropay' | 'P24' | 'Eps' | 'Bancontact' | 'Oxxo' | 'Sofort' | 'Upi' | 'USBankAccount' | 'Unknown';
|
|
207
|
+
export declare type Type = 'AfterpayClearpay' | 'Card' | 'Alipay' | 'GrabPay' | 'Ideal' | 'Fpx' | 'CardPresent' | 'SepaDebit' | 'AuBecsDebit' | 'BacsDebit' | 'Giropay' | 'P24' | 'Eps' | 'Bancontact' | 'Oxxo' | 'Sofort' | 'Upi' | 'USBankAccount' | 'PayPal' | 'Unknown';
|
|
202
208
|
export declare type CollectBankAccountParams = {
|
|
203
209
|
paymentMethodType: 'USBankAccount';
|
|
204
210
|
paymentMethodData: {
|
|
@@ -15,7 +15,7 @@ export interface Result {
|
|
|
15
15
|
description: string | null;
|
|
16
16
|
nextAction: NextAction | null;
|
|
17
17
|
}
|
|
18
|
-
export declare type ConfirmParams = PaymentMethod.
|
|
18
|
+
export declare type ConfirmParams = PaymentMethod.CardParams | PaymentMethod.IdealParams | PaymentMethod.OxxoParams | PaymentMethod.P24Params | PaymentMethod.AlipayParams | PaymentMethod.GiropayParams | PaymentMethod.SepaParams | PaymentMethod.EpsParams | PaymentMethod.AuBecsDebitParams | PaymentMethod.SofortParams | PaymentMethod.GrabPayParams | PaymentMethod.FPXParams | PaymentMethod.AfterpayClearpayParams | PaymentMethod.KlarnaParams | PaymentMethod.BancontactParams | PaymentMethod.USBankAccountParams;
|
|
19
19
|
export declare type ConfirmOptions = {};
|
|
20
20
|
export declare type FutureUsage = 'Unknown' | 'None' | 'OnSession' | 'OffSession' | 'OneTime';
|
|
21
21
|
export declare enum Status {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"author": "Stripe",
|
|
5
5
|
"description": "Stripe SDK for React Native",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -154,6 +154,6 @@
|
|
|
154
154
|
]
|
|
155
155
|
},
|
|
156
156
|
"dependencies": {
|
|
157
|
-
"@expo/config-plugins": "^
|
|
157
|
+
"@expo/config-plugins": "^4.1.4"
|
|
158
158
|
}
|
|
159
159
|
}
|
|
@@ -29,14 +29,19 @@ export interface Props extends AccessibilityProps {
|
|
|
29
29
|
testID?: string;
|
|
30
30
|
/** Only set to `false` when shipping through TestFlight || App Store */
|
|
31
31
|
testEnv?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
/** Details of the Issued Card you'd like added to the device's wallet */
|
|
33
|
+
cardDetails: {
|
|
34
|
+
/** The `primary_account_identifier` value from the issued card. */
|
|
35
|
+
primaryAccountIdentifier: string | null;
|
|
36
|
+
/** The card holder name (used only on iOS) */
|
|
37
|
+
name: string;
|
|
38
|
+
/** A user-facing description of the card. Required on Android.*/
|
|
39
|
+
description: string;
|
|
40
|
+
/** Last 4 digits of the card, only used on iOS */
|
|
41
|
+
lastFour?: string;
|
|
42
|
+
/** Optional, only used on iOS */
|
|
43
|
+
brand?: Token.CardBrand;
|
|
44
|
+
};
|
|
40
45
|
// Optional, only for Android and only for cards that are in the "yellow path" (as defined by Google- https://developers.google.com/pay/issuers/apis/push-provisioning/android/wallet-operations#resolving_yellow_path). Obtain this value via the `isCardInWallet` method.
|
|
41
46
|
token?: GooglePayCardToken | null;
|
|
42
47
|
/** Used by stripe to securely obtain card info of the card being provisioned. */
|
|
@@ -54,9 +59,11 @@ export interface Props extends AccessibilityProps {
|
|
|
54
59
|
* testEnv={true}
|
|
55
60
|
* style={styles.myButtonStyle}
|
|
56
61
|
* iOSButtonStyle="onLightBackground"
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
62
|
+
* cardDetails={{
|
|
63
|
+
* primaryAccountIdentifier: "V-123",
|
|
64
|
+
* name: "David Wallace",
|
|
65
|
+
* lastFour: "4242",
|
|
66
|
+
* }}
|
|
60
67
|
* ephemeralKey={myEphemeralKey} // This object is retrieved from your server. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#update-your-backend
|
|
61
68
|
* onComplete={(error) => {
|
|
62
69
|
* Alert.alert(
|
|
@@ -98,8 +98,9 @@ export const CardField = forwardRef<CardFieldInput.Methods, Props>(
|
|
|
98
98
|
if (card.hasOwnProperty('postalCode')) {
|
|
99
99
|
data.postalCode = card.postalCode || '';
|
|
100
100
|
}
|
|
101
|
-
if (card.hasOwnProperty('number')) {
|
|
101
|
+
if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {
|
|
102
102
|
data.number = card.number || '';
|
|
103
|
+
data.cvc = card.cvc || '';
|
|
103
104
|
if (__DEV__ && onCardChange && card.complete) {
|
|
104
105
|
console.warn(
|
|
105
106
|
`[stripe-react-native] ⚠️ WARNING: You've enabled \`dangerouslyGetFullCardDetails\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`
|
|
@@ -101,8 +101,9 @@ export const CardForm = forwardRef<CardFormView.Methods, Props>(
|
|
|
101
101
|
postalCode: card.postalCode,
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
if (card.hasOwnProperty('number')) {
|
|
104
|
+
if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {
|
|
105
105
|
data.number = card.number || '';
|
|
106
|
+
data.cvc = card.cvc || '';
|
|
106
107
|
if (__DEV__ && onFormComplete && card.complete) {
|
|
107
108
|
console.warn(
|
|
108
109
|
`[stripe-react-native] ⚠️ WARNING: You've enabled \`dangerouslyGetFullCardDetails\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`
|
|
@@ -41,7 +41,8 @@ export type CreateParams =
|
|
|
41
41
|
| KlarnaParams
|
|
42
42
|
// | WeChatPayParams
|
|
43
43
|
| BancontactParams
|
|
44
|
-
| USBankAccountParams
|
|
44
|
+
| USBankAccountParams
|
|
45
|
+
| PayPalParams;
|
|
45
46
|
|
|
46
47
|
export type ConfirmParams = CreateParams;
|
|
47
48
|
|
|
@@ -191,6 +192,13 @@ export type USBankAccountParams = {
|
|
|
191
192
|
};
|
|
192
193
|
};
|
|
193
194
|
|
|
195
|
+
export type PayPalParams = {
|
|
196
|
+
paymentMethodType: 'PayPal';
|
|
197
|
+
paymentMethodData?: {
|
|
198
|
+
billingDetails?: BillingDetails;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
|
|
194
202
|
export interface AuBecsDebitResult {
|
|
195
203
|
fingerprint?: string;
|
|
196
204
|
last4?: string;
|
|
@@ -268,6 +276,7 @@ export type Type =
|
|
|
268
276
|
| 'Sofort'
|
|
269
277
|
| 'Upi'
|
|
270
278
|
| 'USBankAccount'
|
|
279
|
+
| 'PayPal'
|
|
271
280
|
| 'Unknown';
|
|
272
281
|
|
|
273
282
|
export type CollectBankAccountParams = {
|
package/src/types/SetupIntent.ts
CHANGED
|
@@ -16,7 +16,24 @@ export interface Result {
|
|
|
16
16
|
nextAction: NextAction | null;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export type ConfirmParams =
|
|
19
|
+
export type ConfirmParams =
|
|
20
|
+
| PaymentMethod.CardParams
|
|
21
|
+
| PaymentMethod.IdealParams
|
|
22
|
+
| PaymentMethod.OxxoParams
|
|
23
|
+
| PaymentMethod.P24Params
|
|
24
|
+
| PaymentMethod.AlipayParams
|
|
25
|
+
| PaymentMethod.GiropayParams
|
|
26
|
+
| PaymentMethod.SepaParams
|
|
27
|
+
| PaymentMethod.EpsParams
|
|
28
|
+
| PaymentMethod.AuBecsDebitParams
|
|
29
|
+
| PaymentMethod.SofortParams
|
|
30
|
+
| PaymentMethod.GrabPayParams
|
|
31
|
+
| PaymentMethod.FPXParams
|
|
32
|
+
| PaymentMethod.AfterpayClearpayParams
|
|
33
|
+
| PaymentMethod.KlarnaParams
|
|
34
|
+
| PaymentMethod.BancontactParams
|
|
35
|
+
| PaymentMethod.USBankAccountParams;
|
|
36
|
+
// TODO: Change the above back to PaymentMethod.CreateParams when PayPal is supported through SetupIntents
|
|
20
37
|
|
|
21
38
|
export type ConfirmOptions = {};
|
|
22
39
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'json'
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
stripe_version = '~> 22.3.0'
|
|
4
5
|
|
|
5
6
|
Pod::Spec.new do |s|
|
|
6
7
|
s.name = 'stripe-react-native'
|
|
@@ -16,6 +17,6 @@ Pod::Spec.new do |s|
|
|
|
16
17
|
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
17
18
|
|
|
18
19
|
s.dependency 'React-Core'
|
|
19
|
-
s.dependency 'Stripe',
|
|
20
|
-
s.dependency '
|
|
20
|
+
s.dependency 'Stripe', stripe_version
|
|
21
|
+
s.dependency 'StripeFinancialConnections', stripe_version
|
|
21
22
|
end
|