@stripe/stripe-react-native 0.18.0 → 0.18.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  3. package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
  4. package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
  5. package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
  6. package/android/.gradle/7.1/gc.properties +0 -0
  7. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  8. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  9. package/android/.gradle/checksums/checksums.lock +0 -0
  10. package/android/.gradle/vcs-1/gc.properties +0 -0
  11. package/android/.idea/gradle.xml +13 -0
  12. package/android/.idea/misc.xml +9 -0
  13. package/android/.idea/modules/android.iml +18 -0
  14. package/android/.idea/modules.xml +8 -0
  15. package/android/.idea/vcs.xml +6 -0
  16. package/android/local.properties +8 -0
  17. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +11 -10
  18. package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  19. package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  20. package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/charliecruzan.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  21. package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +22 -0
  22. package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcschemes/xcschememanagement.plist +27 -0
  23. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  24. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  25. package/lib/commonjs/components/ApplePayButton.js +1 -1
  26. package/lib/commonjs/components/ApplePayButton.js.map +1 -1
  27. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  28. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  29. package/lib/commonjs/components/CardField.js +1 -1
  30. package/lib/commonjs/components/CardField.js.map +1 -1
  31. package/lib/commonjs/components/CardForm.js +1 -1
  32. package/lib/commonjs/components/CardForm.js.map +1 -1
  33. package/lib/commonjs/components/GooglePayButton.js +1 -1
  34. package/lib/commonjs/components/GooglePayButton.js.map +1 -1
  35. package/lib/commonjs/components/StripeContainer.js +1 -1
  36. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  37. package/lib/module/components/AddToWalletButton.js +1 -1
  38. package/lib/module/components/AddToWalletButton.js.map +1 -1
  39. package/lib/module/components/ApplePayButton.js +1 -1
  40. package/lib/module/components/ApplePayButton.js.map +1 -1
  41. package/lib/module/components/AuBECSDebitForm.js +1 -1
  42. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  43. package/lib/module/components/CardField.js +1 -1
  44. package/lib/module/components/CardField.js.map +1 -1
  45. package/lib/module/components/CardForm.js +1 -1
  46. package/lib/module/components/CardForm.js.map +1 -1
  47. package/lib/module/components/GooglePayButton.js +1 -1
  48. package/lib/module/components/GooglePayButton.js.map +1 -1
  49. package/lib/module/components/StripeContainer.js +1 -1
  50. package/lib/module/components/StripeContainer.js.map +1 -1
  51. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.18.1 - 2022-08-19
6
+
7
+ ### Breaking changes
8
+
9
+ ### New features
10
+
11
+ ## Fixes
12
+
13
+ - Fixed an issue where some promises on Android would never resolve when using React Native 0.65.x or under. [#1089](https://github.com/stripe/stripe-react-native/pull/1089).
14
+
5
15
  ## 0.18.0 - 2022-08-17
6
16
 
7
17
  ### Breaking changes
@@ -16,6 +26,7 @@
16
26
  ### Fixes
17
27
 
18
28
  - Fixed a bug on Android where `collectBankAccountForPayment`, `collectBankAccountForSetup`, `collectBankAccountToken`, and `collectFinancialConnectionsAccounts` wouldn't work with Stripe Connect accounts. [#1086](https://github.com/stripe/stripe-react-native/pull/1086).
29
+ - Upgraded `stripe-ios` to 22.7.+ and `stripe-android` to 20.9.+.
19
30
 
20
31
  ## 0.17.0 - 2022-08-11
21
32
 
File without changes
@@ -0,0 +1,2 @@
1
+ #Tue Jun 21 15:53:42 EDT 2022
2
+ gradle.version=7.1
File without changes
@@ -0,0 +1,13 @@
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="GRADLE" />
8
+ <option name="distributionType" value="DEFAULT_WRAPPED" />
9
+ <option name="externalProjectPath" value="$PROJECT_DIR$" />
10
+ </GradleProjectSettings>
11
+ </option>
12
+ </component>
13
+ </project>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
4
+ <output url="file://$PROJECT_DIR$/build/classes" />
5
+ </component>
6
+ <component name="ProjectType">
7
+ <option name="id" value="Android" />
8
+ </component>
9
+ </project>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module external.linked.project.id=":" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="android-gradle" name="Android-Gradle">
5
+ <configuration>
6
+ <option name="GRADLE_PROJECT_PATH" value=":" />
7
+ <option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" />
8
+ <option name="LAST_KNOWN_AGP_VERSION" />
9
+ </configuration>
10
+ </facet>
11
+ </component>
12
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
13
+ <exclude-output />
14
+ <content url="file://$MODULE_DIR$/../.." />
15
+ <orderEntry type="inheritedJdk" />
16
+ <orderEntry type="sourceFolder" forTests="false" />
17
+ </component>
18
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/android.iml" filepath="$PROJECT_DIR$/.idea/modules/android.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
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
+ #Tue Jun 21 15:53:06 EDT 2022
8
+ sdk.dir=/Users/charliecruzan/Library/Android/sdk
@@ -37,21 +37,22 @@ class StripeSdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJ
37
37
  private var stripeAccountId: String? = null
38
38
  private var urlScheme: String? = null
39
39
 
40
+ private var confirmPromise: Promise? = null
41
+ private var confirmPaymentClientSecret: String? = null
42
+
40
43
  private var paymentSheetFragment: PaymentSheetFragment? = null
41
44
  private var googlePayFragment: GooglePayFragment? = null
42
45
  private var paymentLauncherFragment: PaymentLauncherFragment? = null
43
46
  private var collectBankAccountLauncherFragment: CollectBankAccountLauncherFragment? = null
44
47
  private var financialConnectionsSheetFragment: FinancialConnectionsSheetFragment? = null
45
- private var allFragments : Array<Fragment?> = arrayOf(
46
- paymentSheetFragment,
47
- googlePayFragment,
48
- paymentLauncherFragment,
49
- collectBankAccountLauncherFragment,
50
- financialConnectionsSheetFragment
51
- )
52
-
53
- private var confirmPromise: Promise? = null
54
- private var confirmPaymentClientSecret: String? = null
48
+ private val allFragments: List<Fragment?>
49
+ get() = listOf(
50
+ paymentSheetFragment,
51
+ googlePayFragment,
52
+ paymentLauncherFragment,
53
+ collectBankAccountLauncherFragment,
54
+ financialConnectionsSheetFragment
55
+ )
55
56
 
56
57
  private val mActivityEventListener = object : BaseActivityEventListener() {
57
58
  override fun onActivityResult(activity: Activity, requestCode: Int, resultCode: Int, data: Intent?) {
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Bucket
3
+ uuid = "18A7FEF5-1FA3-4609-B152-0287F2E115A0"
4
+ type = "1"
5
+ version = "2.0">
6
+ <Breakpoints>
7
+ <BreakpointProxy
8
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9
+ <BreakpointContent
10
+ uuid = "C0FB3E07-7654-41DA-96B5-07363EE2CDC7"
11
+ shouldBeEnabled = "Yes"
12
+ ignoreCount = "0"
13
+ continueAfterRunningActions = "No"
14
+ filePath = "ApplePayButtonManager.m"
15
+ startingColumnNumber = "9223372036854775807"
16
+ endingColumnNumber = "9223372036854775807"
17
+ startingLineNumber = "11"
18
+ endingLineNumber = "11">
19
+ </BreakpointContent>
20
+ </BreakpointProxy>
21
+ </Breakpoints>
22
+ </Bucket>
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>StripeSdk.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ <key>Tests.xcscheme_^#shared#^_</key>
13
+ <dict>
14
+ <key>orderHint</key>
15
+ <integer>1</integer>
16
+ </dict>
17
+ </dict>
18
+ <key>SuppressBuildableAutocreation</key>
19
+ <dict>
20
+ <key>FC55C2D928620B7D00526360</key>
21
+ <dict>
22
+ <key>primary</key>
23
+ <true/>
24
+ </dict>
25
+ </dict>
26
+ </dict>
27
+ </plist>
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddToWalletButtonNative,(0,_extends2.default)({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},__self:this,__source:{fileName:_jsxFileName,lineNumber:84,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddToWalletButtonNative,(0,_extends2.default)({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},__self:this,__source:{fileName:_jsxFileName,lineNumber:84,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AddToWalletButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["AddToWalletButton.tsx"],"names":["AddToWalletButtonNative","AddToWalletButton","onComplete","props","value","nativeEvent"],"mappings":"wXAAA,oDACA,yC,iIAeA,GAAMA,CAAAA,uBAAuB,CAC3B,wCAA4B,mBAA5B,CADF,CAiEO,QAASC,CAAAA,iBAAT,MAA4D,IAA/BC,CAAAA,UAA+B,MAA/BA,UAA+B,CAAhBC,KAAgB,uDACjE,MACE,8BAAC,uBAAD,0BACMA,KADN,EAEE,gBAAgB,CAAE,0BAChBC,KADgB,QAIbF,CAAAA,UAAU,CAACE,KAAK,CAACC,WAAP,CAJG,EAFpB,6EADF,CAUD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n NativeSyntheticEvent,\n ImageSourcePropType,\n} from 'react-native';\nimport type {\n Token,\n CardActionError,\n StripeError,\n GooglePayCardToken,\n} from '../types';\n\nconst AddToWalletButtonNative =\n requireNativeComponent<any>('AddToWalletButton');\n\n/**\n * Add to wallet button component props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Sets the Apple Wallet/Google Pay button style. If the button is placed over a dark background, set this to 'onDarkBackground', otherwise set to 'onLightBackground'. */\n iOSButtonStyle?: 'onDarkBackground' | 'onLightBackground';\n /** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */\n androidAssetSource: ImageSourcePropType;\n testID?: string;\n /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */\n testEnv?: boolean;\n /** Details of the Issued Card you'd like added to the device's wallet */\n cardDetails: {\n /** The `primary_account_identifier` value from the issued card. */\n primaryAccountIdentifier: string | null;\n /** The card holder name (used only on iOS) */\n name: string;\n /** A user-facing description of the card. Required on Android.*/\n description: string;\n /** Last 4 digits of the card, only used on iOS */\n lastFour?: string;\n /** Optional, only used on iOS */\n brand?: Token.CardBrand;\n };\n // 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.\n token?: GooglePayCardToken | null;\n /** Used by stripe to securely obtain card info of the card being provisioned. */\n ephemeralKey: object;\n /** Called when the flow completes. If the `error` field is `null`, then the card was successfully added to the user's native wallet. */\n onComplete(result: { error: StripeError<CardActionError> | null }): void;\n}\n\n/**\n * Add to wallet button\n *\n * @example\n * ```ts\n * <AddToWalletButton\n * testEnv={true}\n * style={styles.myButtonStyle}\n * iOSButtonStyle=\"onLightBackground\"\n * cardDetails={{\n * primaryAccountIdentifier: \"V-123\",\n * name: \"David Wallace\",\n * lastFour: \"4242\",\n * }}\n * ephemeralKey={myEphemeralKey} // This object is retrieved from your server. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#update-your-backend\n * onComplete={(error) => {\n * Alert.alert(\n * error ? error.code : 'Success',\n * error\n * ? error.message\n * : 'Card was successfully added to the wallet.'\n * );\n * }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddToWalletButton({ onComplete, ...props }: Props) {\n return (\n <AddToWalletButtonNative\n {...props}\n onCompleteAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<CardActionError> | null;\n }>\n ) => onComplete(value.nativeEvent)}\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["AddToWalletButton.tsx"],"names":["AddToWalletButtonNative","AddToWalletButton","onComplete","props","value","nativeEvent"],"mappings":"wXAAA,oDACA,yC,qIAeA,GAAMA,CAAAA,uBAAuB,CAC3B,wCAA4B,mBAA5B,CADF,CAiEO,QAASC,CAAAA,iBAAT,MAA4D,IAA/BC,CAAAA,UAA+B,MAA/BA,UAA+B,CAAhBC,KAAgB,uDACjE,MACE,8BAAC,uBAAD,0BACMA,KADN,EAEE,gBAAgB,CAAE,0BAChBC,KADgB,QAIbF,CAAAA,UAAU,CAACE,KAAK,CAACC,WAAP,CAJG,EAFpB,6EADF,CAUD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n NativeSyntheticEvent,\n ImageSourcePropType,\n} from 'react-native';\nimport type {\n Token,\n CardActionError,\n StripeError,\n GooglePayCardToken,\n} from '../types';\n\nconst AddToWalletButtonNative =\n requireNativeComponent<any>('AddToWalletButton');\n\n/**\n * Add to wallet button component props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Sets the Apple Wallet/Google Pay button style. If the button is placed over a dark background, set this to 'onDarkBackground', otherwise set to 'onLightBackground'. */\n iOSButtonStyle?: 'onDarkBackground' | 'onLightBackground';\n /** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */\n androidAssetSource: ImageSourcePropType;\n testID?: string;\n /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */\n testEnv?: boolean;\n /** Details of the Issued Card you'd like added to the device's wallet */\n cardDetails: {\n /** The `primary_account_identifier` value from the issued card. */\n primaryAccountIdentifier: string | null;\n /** The card holder name (used only on iOS) */\n name: string;\n /** A user-facing description of the card. Required on Android.*/\n description: string;\n /** Last 4 digits of the card, only used on iOS */\n lastFour?: string;\n /** Optional, only used on iOS */\n brand?: Token.CardBrand;\n };\n // 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.\n token?: GooglePayCardToken | null;\n /** Used by stripe to securely obtain card info of the card being provisioned. */\n ephemeralKey: object;\n /** Called when the flow completes. If the `error` field is `null`, then the card was successfully added to the user's native wallet. */\n onComplete(result: { error: StripeError<CardActionError> | null }): void;\n}\n\n/**\n * Add to wallet button\n *\n * @example\n * ```ts\n * <AddToWalletButton\n * testEnv={true}\n * style={styles.myButtonStyle}\n * iOSButtonStyle=\"onLightBackground\"\n * cardDetails={{\n * primaryAccountIdentifier: \"V-123\",\n * name: \"David Wallace\",\n * lastFour: \"4242\",\n * }}\n * ephemeralKey={myEphemeralKey} // This object is retrieved from your server. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#update-your-backend\n * onComplete={(error) => {\n * Alert.alert(\n * error ? error.code : 'Success',\n * error\n * ? error.message\n * : 'Card was successfully added to the wallet.'\n * );\n * }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddToWalletButton({ onComplete, ...props }: Props) {\n return (\n <AddToWalletButtonNative\n {...props}\n onCompleteAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<CardActionError> | null;\n }>\n ) => onComplete(value.nativeEvent)}\n />\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ApplePayButton=ApplePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/ApplePayButton.tsx";var _excluded=["onPress","buttonStyle","type","borderRadius"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');function ApplePayButton(_ref){var onPress=_ref.onPress,_ref$buttonStyle=_ref.buttonStyle,buttonStyle=_ref$buttonStyle===void 0?'black':_ref$buttonStyle,_ref$type=_ref.type,type=_ref$type===void 0?'plain':_ref$type,_ref$borderRadius=_ref.borderRadius,borderRadius=_ref$borderRadius===void 0?4:_ref$borderRadius,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var buttonType=(0,_react.useMemo)(function(){return mapButtonType(type);},[type]);var style=(0,_react.useMemo)(function(){return mapButtonStyle(buttonStyle);},[buttonStyle]);return _react.default.createElement(ApplePayButtonNative,(0,_extends2.default)({type:buttonType,buttonStyle:style,borderRadius:borderRadius,onPressAction:onPress},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:5}}));}function mapButtonType(type){switch(type){case'plain':return 0;case'buy':return 1;case'setUp':return 2;case'inStore':return 3;case'donate':return 4;case'checkout':return 5;case'book':return 6;case'subscribe':return 7;case'reload':return 8;case'addMoney':return 9;case'topUp':return 10;case'order':return 11;case'rent':return 12;case'support':return 13;case'contribute':return 14;case'tip':return 15;default:return 0;}}function mapButtonStyle(type){switch(type){case'white':return 0;case'whiteOutline':return 1;case'black':return 2;case'automatic':return 3;default:return 2;}}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ApplePayButton=ApplePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/ApplePayButton.tsx";var _excluded=["onPress","buttonStyle","type","borderRadius"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');function ApplePayButton(_ref){var onPress=_ref.onPress,_ref$buttonStyle=_ref.buttonStyle,buttonStyle=_ref$buttonStyle===void 0?'black':_ref$buttonStyle,_ref$type=_ref.type,type=_ref$type===void 0?'plain':_ref$type,_ref$borderRadius=_ref.borderRadius,borderRadius=_ref$borderRadius===void 0?4:_ref$borderRadius,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var buttonType=(0,_react.useMemo)(function(){return mapButtonType(type);},[type]);var style=(0,_react.useMemo)(function(){return mapButtonStyle(buttonStyle);},[buttonStyle]);return _react.default.createElement(ApplePayButtonNative,(0,_extends2.default)({type:buttonType,buttonStyle:style,borderRadius:borderRadius,onPressAction:onPress},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:5}}));}function mapButtonType(type){switch(type){case'plain':return 0;case'buy':return 1;case'setUp':return 2;case'inStore':return 3;case'donate':return 4;case'checkout':return 5;case'book':return 6;case'subscribe':return 7;case'reload':return 8;case'addMoney':return 9;case'topUp':return 10;case'order':return 11;case'rent':return 12;case'support':return 13;case'contribute':return 14;case'tip':return 15;default:return 0;}}function mapButtonStyle(type){switch(type){case'white':return 0;case'whiteOutline':return 1;case'black':return 2;case'automatic':return 3;default:return 2;}}
2
2
  //# sourceMappingURL=ApplePayButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ApplePayButton.tsx"],"names":["ApplePayButtonNative","ApplePayButton","onPress","buttonStyle","type","borderRadius","props","buttonType","mapButtonType","style","mapButtonStyle"],"mappings":"kXACA,qDACA,yC,ypCAOA,GAAMA,CAAAA,oBAAoB,CACxB,wCAA4D,gBAA5D,CADF,CAgCO,QAASC,CAAAA,cAAT,MAMG,IALRC,CAAAA,OAKQ,MALRA,OAKQ,uBAJRC,WA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R,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,cAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,QACE,MAAO,EAAP,CAVJ,CAYD","sourcesContent":["import type { ApplePayButtonComponent } from '../types';\nimport React, { useMemo } from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nconst ApplePayButtonNative =\n requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');\n\n/**\n * Apple Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?: ApplePayButtonComponent.Type;\n buttonStyle?: ApplePayButtonComponent.Style;\n borderRadius?: number;\n onPress(): void;\n testID?: string;\n}\n\n/**\n * Apple Pay Button Component\n *\n * @example\n * ```ts\n * <ApplePayButton\n * onPress={pay}\n * type=\"plain\"\n * buttonStyle=\"black\"\n * borderRadius={4}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function ApplePayButton({\n onPress,\n buttonStyle = 'black',\n type = 'plain',\n borderRadius = 4,\n ...props\n}: Props) {\n const buttonType = useMemo(() => mapButtonType(type), [type]);\n const style = useMemo(() => mapButtonStyle(buttonStyle), [buttonStyle]);\n\n return (\n <ApplePayButtonNative\n type={buttonType}\n buttonStyle={style}\n borderRadius={borderRadius}\n onPressAction={onPress}\n {...props}\n />\n );\n}\n\nfunction mapButtonType(type: ApplePayButtonComponent.Type) {\n switch (type) {\n case 'plain':\n return 0;\n case 'buy':\n return 1;\n case 'setUp':\n return 2;\n case 'inStore':\n return 3;\n case 'donate':\n return 4;\n case 'checkout':\n return 5;\n case 'book':\n return 6;\n case 'subscribe':\n return 7;\n case 'reload':\n return 8;\n case 'addMoney':\n return 9;\n case 'topUp':\n return 10;\n case 'order':\n return 11;\n case 'rent':\n return 12;\n case 'support':\n return 13;\n case 'contribute':\n return 14;\n case 'tip':\n return 15;\n default:\n return 0;\n }\n}\n\nfunction mapButtonStyle(type: ApplePayButtonComponent.Style) {\n switch (type) {\n case 'white':\n return 0;\n case 'whiteOutline':\n return 1;\n case 'black':\n return 2;\n case 'automatic':\n return 3;\n default:\n return 2;\n }\n}\n"]}
1
+ {"version":3,"sources":["ApplePayButton.tsx"],"names":["ApplePayButtonNative","ApplePayButton","onPress","buttonStyle","type","borderRadius","props","buttonType","mapButtonType","style","mapButtonStyle"],"mappings":"kXACA,qDACA,yC,6pCAOA,GAAMA,CAAAA,oBAAoB,CACxB,wCAA4D,gBAA5D,CADF,CAgCO,QAASC,CAAAA,cAAT,MAMG,IALRC,CAAAA,OAKQ,MALRA,OAKQ,uBAJRC,WAIQ,CAJRA,WAIQ,2BAJM,OAIN,iCAHRC,IAGQ,CAHRA,IAGQ,oBAHD,OAGC,kCAFRC,YAEQ,CAFRA,YAEQ,4BAFO,CAEP,mBADLC,KACK,uDACR,GAAMC,CAAAA,UAAU,CAAG,mBAAQ,iBAAMC,CAAAA,aAAa,CAACJ,IAAD,CAAnB,EAAR,CAAmC,CAACA,IAAD,CAAnC,CAAnB,CACA,GAAMK,CAAAA,KAAK,CAAG,mBAAQ,iBAAMC,CAAAA,cAAc,CAACP,WAAD,CAApB,EAAR,CAA2C,CAACA,WAAD,CAA3C,CAAd,CAEA,MACE,8BAAC,oBAAD,wBACE,IAAI,CAAEI,UADR,CAEE,WAAW,CAAEE,KAFf,CAGE,YAAY,CAAEJ,YAHhB,CAIE,aAAa,CAAEH,OAJjB,EAKMI,KALN,8EADF,CASD,CAED,QAASE,CAAAA,aAAT,CAAuBJ,IAAvB,CAA2D,CACzD,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,KAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,SAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,MAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,MAAL,CACE,MAAO,GAAP,CACF,IAAK,SAAL,CACE,MAAO,GAAP,CACF,IAAK,YAAL,CACE,MAAO,GAAP,CACF,IAAK,KAAL,CACE,MAAO,GAAP,CACF,QACE,MAAO,EAAP,CAlCJ,CAoCD,CAED,QAASM,CAAAA,cAAT,CAAwBN,IAAxB,CAA6D,CAC3D,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,cAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,QACE,MAAO,EAAP,CAVJ,CAYD","sourcesContent":["import type { ApplePayButtonComponent } from '../types';\nimport React, { useMemo } from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nconst ApplePayButtonNative =\n requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');\n\n/**\n * Apple Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?: ApplePayButtonComponent.Type;\n buttonStyle?: ApplePayButtonComponent.Style;\n borderRadius?: number;\n onPress(): void;\n testID?: string;\n}\n\n/**\n * Apple Pay Button Component\n *\n * @example\n * ```ts\n * <ApplePayButton\n * onPress={pay}\n * type=\"plain\"\n * buttonStyle=\"black\"\n * borderRadius={4}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function ApplePayButton({\n onPress,\n buttonStyle = 'black',\n type = 'plain',\n borderRadius = 4,\n ...props\n}: Props) {\n const buttonType = useMemo(() => mapButtonType(type), [type]);\n const style = useMemo(() => mapButtonStyle(buttonStyle), [buttonStyle]);\n\n return (\n <ApplePayButtonNative\n type={buttonType}\n buttonStyle={style}\n borderRadius={borderRadius}\n onPressAction={onPress}\n {...props}\n />\n );\n}\n\nfunction mapButtonType(type: ApplePayButtonComponent.Type) {\n switch (type) {\n case 'plain':\n return 0;\n case 'buy':\n return 1;\n case 'setUp':\n return 2;\n case 'inStore':\n return 3;\n case 'donate':\n return 4;\n case 'checkout':\n return 5;\n case 'book':\n return 6;\n case 'subscribe':\n return 7;\n case 'reload':\n return 8;\n case 'addMoney':\n return 9;\n case 'topUp':\n return 10;\n case 'order':\n return 11;\n case 'rent':\n return 12;\n case 'support':\n return 13;\n case 'contribute':\n return 14;\n case 'tip':\n return 15;\n default:\n return 0;\n }\n}\n\nfunction mapButtonStyle(type: ApplePayButtonComponent.Style) {\n switch (type) {\n case 'white':\n return 0;\n case 'whiteOutline':\n return 1;\n case 'black':\n return 2;\n case 'automatic':\n return 3;\n default:\n return 2;\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];var AuBECSDebitFormNative=(0,_reactNative.requireNativeComponent)('AuBECSDebitForm');function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AuBECSDebitFormNative,(0,_extends2.default)({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];var AuBECSDebitFormNative=(0,_reactNative.requireNativeComponent)('AuBECSDebitForm');function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AuBECSDebitFormNative,(0,_extends2.default)({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AuBECSDebitForm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["AuBECSDebitForm.tsx"],"names":["AuBECSDebitFormNative","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"mappings":"oXAAA,oDACA,yC,yJAQA,GAAMA,CAAAA,qBAAqB,CACzB,wCACE,iBADF,CADF,CA+BO,QAASC,CAAAA,eAAT,MAKG,IAJRC,CAAAA,UAIQ,MAJRA,UAIQ,CAHRC,WAGQ,MAHRA,WAGQ,CAFRC,SAEQ,MAFRA,SAEQ,CADLC,KACK,uDACR,MACE,8BAAC,qBAAD,wBACE,gBAAgB,CAAE,0BAACC,KAAD,QAAWJ,CAAAA,UAAU,CAACI,KAAK,CAACC,WAAP,CAArB,EADpB,CAEE,WAAW,CAAEJ,WAFf,CAGE,SAAS,kBAAOC,SAAP,CAHX,EAIMC,KAJN,8EADF,CAQD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type { AuBECSDebitFormComponent } from '../types';\n\nconst AuBECSDebitFormNative =\n requireNativeComponent<AuBECSDebitFormComponent.NativeProps>(\n 'AuBECSDebitForm'\n );\n\n/**\n * BECS Debit Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n companyName: string;\n onComplete(value: AuBECSDebitFormComponent.FormDetails): void;\n formStyle?: AuBECSDebitFormComponent.Styles;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * BECS Debit form component\n *\n * @example\n * ```ts\n * <AuBECSDebitForm\n * companyName=\"Example Company Inc.\"\n * onComplete={value => onComplete(value)}\n * style={{ width: '100%', height: 500 }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AuBECSDebitForm({\n onComplete,\n companyName,\n formStyle,\n ...props\n}: Props) {\n return (\n <AuBECSDebitFormNative\n onCompleteAction={(value) => onComplete(value.nativeEvent)}\n companyName={companyName}\n formStyle={{ ...formStyle }}\n {...props}\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["AuBECSDebitForm.tsx"],"names":["AuBECSDebitFormNative","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"mappings":"oXAAA,oDACA,yC,6JAQA,GAAMA,CAAAA,qBAAqB,CACzB,wCACE,iBADF,CADF,CA+BO,QAASC,CAAAA,eAAT,MAKG,IAJRC,CAAAA,UAIQ,MAJRA,UAIQ,CAHRC,WAGQ,MAHRA,WAGQ,CAFRC,SAEQ,MAFRA,SAEQ,CADLC,KACK,uDACR,MACE,8BAAC,qBAAD,wBACE,gBAAgB,CAAE,0BAACC,KAAD,QAAWJ,CAAAA,UAAU,CAACI,KAAK,CAACC,WAAP,CAArB,EADpB,CAEE,WAAW,CAAEJ,WAFf,CAGE,SAAS,kBAAOC,SAAP,CAHX,EAIMC,KAJN,8EADF,CAQD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type { AuBECSDebitFormComponent } from '../types';\n\nconst AuBECSDebitFormNative =\n requireNativeComponent<AuBECSDebitFormComponent.NativeProps>(\n 'AuBECSDebitForm'\n );\n\n/**\n * BECS Debit Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n companyName: string;\n onComplete(value: AuBECSDebitFormComponent.FormDetails): void;\n formStyle?: AuBECSDebitFormComponent.Styles;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * BECS Debit form component\n *\n * @example\n * ```ts\n * <AuBECSDebitForm\n * companyName=\"Example Company Inc.\"\n * onComplete={value => onComplete(value)}\n * style={{ width: '100%', height: 500 }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AuBECSDebitForm({\n onComplete,\n companyName,\n formStyle,\n ...props\n}: Props) {\n return (\n <AuBECSDebitFormNative\n onCompleteAction={(value) => onComplete(value.nativeEvent)}\n companyName={companyName}\n formStyle={{ ...formStyle }}\n {...props}\n />\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode"];var _this=this,_jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/CardField.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFieldNative=(0,_reactNative.requireNativeComponent)('CardField');var CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,postalCodeEnabled=_ref.postalCodeEnabled,countryCode=_ref.countryCode,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F 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");}}onCardChange==null?void 0:onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null?void 0:onFocus(focusedField);}else{onBlur==null?void 0:onBlur();}},[onFocus,onBlur]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};var clear=function clear(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'clear',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFieldNative,(0,_extends2.default)({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,countryCode:countryCode!=null?countryCode:null,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode}},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:177,columnNumber:7}}));});exports.CardField=CardField;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode"];var _this=this,_jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/CardField.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFieldNative=(0,_reactNative.requireNativeComponent)('CardField');var CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,postalCodeEnabled=_ref.postalCodeEnabled,countryCode=_ref.countryCode,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F 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");}}onCardChange==null?void 0:onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null?void 0:onFocus(focusedField);}else{onBlur==null?void 0:onBlur();}},[onFocus,onBlur]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};var clear=function clear(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'clear',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFieldNative,(0,_extends2.default)({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,countryCode:countryCode!=null?countryCode:null,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode}},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:177,columnNumber:7}}));});exports.CardField=CardField;
2
2
  //# sourceMappingURL=CardField.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["CardField.tsx"],"names":["CardFieldNative","CardField","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode","props","inputRef","onCardChangeHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","hasOwnProperty","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","current","focus","UIManager","dispatchViewManagerCommand","blur","clear","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontF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Y,CAAEqB,GAHP,CAIZF,UAAU,CAAEnB,YAAF,cAAEA,YAAY,CAAEmB,UAJd,CAlBhB,EAwBMhB,KAxBN,gFADF,CA4BD,CArIsB,CAAlB,C","sourcesContent":["import type { CardFieldInput } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFieldNative =\n requireNativeComponent<CardFieldInput.NativeProps>('CardField');\n\n/**\n * Card Field Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Controls if a postal code entry field can be displayed to the user. Defaults to false. If true, the type of code entry shown is controlled by the set countryCode prop. Some country codes may result in no postal code entry being shown if those countries do not commonly use postal codes. If false, no postal code entry will ever be displayed. */\n postalCodeEnabled?: boolean;\n /** Controls the postal code entry shown (if the postalCodeEnabled prop is set to true). Defaults to the device's default locale. */\n countryCode?: string;\n cardStyle?: CardFieldInput.Styles;\n placeholders?: CardFieldInput.Placeholders;\n autofocus?: boolean;\n onCardChange?(card: CardFieldInput.Details): void;\n onBlur?(): void;\n onFocus?(focusedField: CardFieldInput.FieldName | null): void;\n testID?: string;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Field Component\n *\n * @example\n * ```ts\n * <CardField\n * postalCodeEnabled={false}\n * onCardChange={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 50}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardField = forwardRef<CardFieldInput.Methods, Props>(\n (\n {\n onCardChange,\n onFocus,\n onBlur,\n cardStyle,\n placeholders,\n postalCodeEnabled,\n countryCode,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onCardChangeHandler = useCallback(\n (event: NativeSyntheticEvent<CardFieldInput.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFieldInput.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n validExpiryDate: card.validExpiryDate,\n validNumber: card.validNumber,\n validCVC: card.validCVC,\n };\n\n if (card.hasOwnProperty('postalCode')) {\n data.postalCode = card.postalCode || '';\n }\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onCardChange && card.complete) {\n console.warn(\n `[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`\n );\n }\n }\n onCardChange?.(data);\n },\n [onCardChange]\n );\n\n const onFocusHandler = useCallback(\n (event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n onFocus?.(focusedField);\n } else {\n onBlur?.();\n }\n },\n [onFocus, onBlur]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n const clear = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'clear' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n clear,\n }));\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFieldNative\n ref={inputRef}\n onCardChange={onCardChangeHandler}\n onFocusChange={onFocusHandler}\n postalCodeEnabled={postalCodeEnabled ?? true}\n countryCode={countryCode ?? null}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n }}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n {...props}\n />\n );\n }\n);\n"]}
1
+ {"version":3,"sources":["CardField.tsx"],"names":["CardFieldNative","CardField","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode","props","inputRef","onCardChangeHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","hasOwnProperty","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","current","focus","UIManager","dispatchViewManagerCommand","blur","clear","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"qWACA,qDAOA,yCASA,mC,otCAOA,GAAMA,CAAAA,eAAe,CACnB,wCAAmD,WAAnD,CADF,CA8CO,GAAMC,CAAAA,SAAS,CAAG,sBACvB,cAWEC,GAXF,CAYK,IAVDC,CAAAA,YAUC,MAVDA,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\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFieldNative =\n requireNativeComponent<CardFieldInput.NativeProps>('CardField');\n\n/**\n * Card Field Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Controls if a postal code entry field can be displayed to the user. Defaults to false. If true, the type of code entry shown is controlled by the set countryCode prop. Some country codes may result in no postal code entry being shown if those countries do not commonly use postal codes. If false, no postal code entry will ever be displayed. */\n postalCodeEnabled?: boolean;\n /** Controls the postal code entry shown (if the postalCodeEnabled prop is set to true). Defaults to the device's default locale. */\n countryCode?: string;\n cardStyle?: CardFieldInput.Styles;\n placeholders?: CardFieldInput.Placeholders;\n autofocus?: boolean;\n onCardChange?(card: CardFieldInput.Details): void;\n onBlur?(): void;\n onFocus?(focusedField: CardFieldInput.FieldName | null): void;\n testID?: string;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Field Component\n *\n * @example\n * ```ts\n * <CardField\n * postalCodeEnabled={false}\n * onCardChange={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 50}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardField = forwardRef<CardFieldInput.Methods, Props>(\n (\n {\n onCardChange,\n onFocus,\n onBlur,\n cardStyle,\n placeholders,\n postalCodeEnabled,\n countryCode,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onCardChangeHandler = useCallback(\n (event: NativeSyntheticEvent<CardFieldInput.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFieldInput.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n validExpiryDate: card.validExpiryDate,\n validNumber: card.validNumber,\n validCVC: card.validCVC,\n };\n\n if (card.hasOwnProperty('postalCode')) {\n data.postalCode = card.postalCode || '';\n }\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onCardChange && card.complete) {\n console.warn(\n `[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`\n );\n }\n }\n onCardChange?.(data);\n },\n [onCardChange]\n );\n\n const onFocusHandler = useCallback(\n (event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n onFocus?.(focusedField);\n } else {\n onBlur?.();\n }\n },\n [onFocus, onBlur]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n const clear = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'clear' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n clear,\n }));\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFieldNative\n ref={inputRef}\n onCardChange={onCardChangeHandler}\n onFocusChange={onFocusHandler}\n postalCodeEnabled={postalCodeEnabled ?? true}\n countryCode={countryCode ?? null}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n }}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n {...props}\n />\n );\n }\n);\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues"];var _this=this,_jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/CardForm.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFormNative=(0,_reactNative.requireNativeComponent)('CardForm');var CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,country:card.country,postalCode:card.postalCode};if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onFormComplete&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F 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");}}onFormComplete==null?void 0:onFormComplete(data);},[onFormComplete]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur};});var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);}else{}},[]);(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFormNative,(0,_extends2.default)({ref:inputRef,onFormComplete:onFormCompleteHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},defaultValues:Object.assign({},defaultValues!=null?defaultValues:{}),onFocusChange:onFocusHandler},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:167,columnNumber:7}}));});exports.CardForm=CardForm;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues"];var _this=this,_jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/CardForm.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFormNative=(0,_reactNative.requireNativeComponent)('CardForm');var CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,country:card.country,postalCode:card.postalCode};if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onFormComplete&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F 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");}}onFormComplete==null?void 0:onFormComplete(data);},[onFormComplete]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur};});var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);}else{}},[]);(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFormNative,(0,_extends2.default)({ref:inputRef,onFormComplete:onFormCompleteHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},defaultValues:Object.assign({},defaultValues!=null?defaultValues:{}),onFocusChange:onFocusHandler},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:167,columnNumber:7}}));});exports.CardForm=CardForm;
2
2
  //# sourceMappingURL=CardForm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["CardForm.tsx"],"names":["CardFormNative","CardForm","ref","onFormComplete","cardStyle","placeholders","defaultValues","props","inputRef","onFormCompleteHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","country","postalCode","hasOwnProperty","number","cvc","__DEV__","console","warn","focus","UIManager","dispatchViewManagerCommand","current","blur","onFocusHandler","focusedField","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"oWACA,qDAOA,yCASA,mC,4qCAOA,GAAMA,CAAAA,cAAc,CAClB,wCAAiD,UAAjD,CADF,CAmDO,GAAMC,CAAAA,QAAQ,CAAG,sBACtB,cAYEC,GAZF,CAaK,IAXDC,CAAAA,cAWC,MAXDA,cAWC,CAVDC,SAUC,MAVDA,SAUC,CALDC,YAKC,MALDA,YAKC,CAJDC,aAIC,MAJDA,aAIC,CAHEC,KAGF,uDACH,GAAMC,CAAAA,QAAQ,CAAG,kBAAY,IAAZ,CAAjB,CAEA,GAAMC,CAAAA,qBAAqB,CAAG,uBAC5B,SAACC,KAAD,CAAuD,CACrD,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACE,WAAnB,CAEA,GAAMC,CAAAA,IAA0B,CAAG,CACjCC,KAAK,CAAEH,IAAI,CAACG,KADqB,CAEjCC,WAAW,CAAEJ,IAAI,CAACI,WAFe,CAGjCC,UAAU,CAAEL,IAAI,CAACK,UAHgB,CAIjCC,QAAQ,CAAEN,IAAI,CAACM,QAJkB,CAKjCC,KAAK,CAAEP,IAAI,CAACO,KALqB,CAMjCC,OAAO,CAAER,IAAI,CAACQ,OANmB,CAOjCC,UAAU,CAAET,IAAI,CAACS,UAPgB,CAAnC,CAUA,GAAIT,IAAI,CAACU,cAAL,CAAoB,QAApB,GAAiCV,IAAI,CAACU,cAAL,CAAoB,KAApB,CAArC,CAAiE,CAC/DR,IAAI,CAACS,MAAL,CAAcX,IAAI,CAACW,MAAL,EAAe,EAA7B,CACAT,IAAI,CAACU,GAAL,CAAWZ,IAAI,CAACY,GAAL,EAAY,EAAvB,C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AAG,CAAEA,QADP,CAEE,cAAc,CAAEC,qBAFlB,CAGE,SAAS,CAAE,CACT0B,eAAe,CAAE/B,SAAF,cAAEA,SAAS,CAAE+B,eADnB,CAETC,WAAW,CAAEhC,SAAF,cAAEA,SAAS,CAAEgC,WAFf,CAGTC,WAAW,CAAEjC,SAAF,cAAEA,SAAS,CAAEiC,WAHf,CAITC,YAAY,CAAElC,SAAF,cAAEA,SAAS,CAAEkC,YAJhB,CAKTC,WAAW,CAAEnC,SAAF,cAAEA,SAAS,CAAEmC,WALf,CAMTC,QAAQ,CAAEpC,SAAF,cAAEA,SAAS,CAAEoC,QANZ,CAOTC,gBAAgB,CAAErC,SAAF,cAAEA,SAAS,CAAEqC,gBAPpB,CAQTC,SAAS,CAAEtC,SAAF,cAAEA,SAAS,CAAEsC,SARb,CASTC,cAAc,CAAEvC,SAAF,cAAEA,SAAS,CAAEuC,cATlB,CAUTC,UAAU,CAAExC,SAAF,cAAEA,SAAS,CAAEwC,UAVd,CAHb,CAkBE,YAAY,CAAE,CACZtB,MAAM,CAAEjB,YAAF,cAAEA,YAAY,CAAEiB,MADV,CAEZuB,UAAU,CAAExC,YAAF,cAAEA,YAAY,CAAEwC,UAFd,CAGZtB,GAAG,CAAElB,YAAF,cAAEA,YAAY,CAAEkB,GAHP,CAIZH,UAAU,CAAEf,YAAF,cAAEA,YAAY,CAAEe,UAJd,CAlBhB,CAwBE,aAAa,kBACPd,aADO,OACPA,aADO,CACU,EADV,CAxBf,CA2BE,aAAa,CAAE0B,cA3BjB,EA6BMzB,KA7BN,gFADF,CAiCD,CA3HqB,CAAjB,C","sourcesContent":["import type { CardFormView } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFormNative =\n requireNativeComponent<CardFormView.NativeProps>('CardForm');\n\n/**\n * Card Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n autofocus?: boolean;\n testID?: string;\n\n /** All styles except backgroundColor, cursorColor, borderColor, and borderRadius are Android only */\n cardStyle?: CardFormView.Styles;\n // isUserInteractionEnabled?: boolean;\n\n // TODO: will make it public when iOS SDK allows for this\n // postalCodeEnabled?: boolean;\n\n /** Android only */\n placeholders?: CardFormView.Placeholders;\n /** Android only */\n defaultValues?: CardFormView.DefaultValues;\n // onBlur?(): void;\n // onFocus?(focusedField: CardFormView.FieldNames | null): void;\n onFormComplete?(card: CardFormView.Details): void;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onFormComplete` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Form Component\n *\n * @example\n * ```ts\n * <CardForm\n * onFormComplete={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 200}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardForm = forwardRef<CardFormView.Methods, Props>(\n (\n {\n onFormComplete,\n cardStyle,\n // isUserInteractionEnabled = true,\n // postalCodeEnabled = true,\n // onFocus,\n // onBlur,\n placeholders,\n defaultValues,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onFormCompleteHandler = useCallback(\n (event: NativeSyntheticEvent<CardFormView.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFormView.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n country: card.country,\n postalCode: card.postalCode,\n };\n\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onFormComplete && card.complete) {\n console.warn(\n `[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`\n );\n }\n }\n onFormComplete?.(data);\n },\n [onFormComplete]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n }));\n\n const onFocusHandler = useCallback((event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n // onFocus?.(focusedField);\n } else {\n // onBlur?.();\n }\n }, []);\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFormNative\n ref={inputRef}\n onFormComplete={onFormCompleteHandler}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n // disabledBackgroundColor: cardStyle?.disabledBackgroundColor,\n // type: cardStyle?.type,\n }}\n // isUserInteractionEnabledValue={isUserInteractionEnabled}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n defaultValues={{\n ...(defaultValues ?? {}),\n }}\n onFocusChange={onFocusHandler}\n // postalCodeEnabled={postalCodeEnabled}\n {...props}\n />\n );\n }\n);\n"]}
1
+ {"version":3,"sources":["CardForm.tsx"],"names":["CardFormNative","CardForm","ref","onFormComplete","cardStyle","placeholders","defaultValues","props","inputRef","onFormCompleteHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","country","postalCode","hasOwnProperty","number","cvc","__DEV__","console","warn","focus","UIManager","dispatchViewManagerCommand","current","blur","onFocusHandler","focusedField","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"oWACA,qDAOA,yCASA,mC,grCAOA,GAAMA,CAAAA,cAAc,CAClB,wCAAiD,UAAjD,CADF,CAmDO,GAAMC,CAAAA,QAAQ,CAAG,sBACtB,cAYEC,GAZF,CAaK,IAXDC,CAAAA,cAWC,MAXDA,cAWC,CAVDC,SAUC,MAVDA,SAUC,CALDC,YAKC,MALDA,YAKC,CAJDC,aAIC,MAJDA,aAIC,CAHEC,KAGF,uDACH,GAAMC,CAAAA,QAAQ,CAAG,kBAAY,IAAZ,CAAjB,CAEA,GAAMC,CAAAA,qBAAqB,CAAG,uBAC5B,SAACC,KAAD,CAAuD,CACrD,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACE,WAAnB,CAEA,GAAMC,CAAAA,IAA0B,CAAG,CACjCC,KAAK,CAAEH,IAAI,CAACG,KADqB,CAEjCC,WAAW,CAAEJ,IAAI,CAACI,WAFe,CAGjCC,UAAU,CAAEL,IAAI,CAACK,UAHgB,CAIjCC,QAAQ,CAAEN,IAAI,CAACM,QAJkB,CAKjCC,KAAK,CAAEP,IAAI,CAACO,KALqB,CAMjCC,OAAO,CAAER,IAAI,C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B,EA6BMzB,KA7BN,gFADF,CAiCD,CA3HqB,CAAjB,C","sourcesContent":["import type { CardFormView } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFormNative =\n requireNativeComponent<CardFormView.NativeProps>('CardForm');\n\n/**\n * Card Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n autofocus?: boolean;\n testID?: string;\n\n /** All styles except backgroundColor, cursorColor, borderColor, and borderRadius are Android only */\n cardStyle?: CardFormView.Styles;\n // isUserInteractionEnabled?: boolean;\n\n // TODO: will make it public when iOS SDK allows for this\n // postalCodeEnabled?: boolean;\n\n /** Android only */\n placeholders?: CardFormView.Placeholders;\n /** Android only */\n defaultValues?: CardFormView.DefaultValues;\n // onBlur?(): void;\n // onFocus?(focusedField: CardFormView.FieldNames | null): void;\n onFormComplete?(card: CardFormView.Details): void;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onFormComplete` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Form Component\n *\n * @example\n * ```ts\n * <CardForm\n * onFormComplete={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 200}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardForm = forwardRef<CardFormView.Methods, Props>(\n (\n {\n onFormComplete,\n cardStyle,\n // isUserInteractionEnabled = true,\n // postalCodeEnabled = true,\n // onFocus,\n // onBlur,\n placeholders,\n defaultValues,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onFormCompleteHandler = useCallback(\n (event: NativeSyntheticEvent<CardFormView.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFormView.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n country: card.country,\n postalCode: card.postalCode,\n };\n\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onFormComplete && card.complete) {\n console.warn(\n `[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`\n );\n }\n }\n onFormComplete?.(data);\n },\n [onFormComplete]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n }));\n\n const onFocusHandler = useCallback((event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n // onFocus?.(focusedField);\n } else {\n // onBlur?.();\n }\n }, []);\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFormNative\n ref={inputRef}\n onFormComplete={onFormCompleteHandler}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n // disabledBackgroundColor: cardStyle?.disabledBackgroundColor,\n // type: cardStyle?.type,\n }}\n // isUserInteractionEnabledValue={isUserInteractionEnabled}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n defaultValues={{\n ...(defaultValues ?? {}),\n }}\n onFocusChange={onFocusHandler}\n // postalCodeEnabled={postalCodeEnabled}\n {...props}\n />\n );\n }\n);\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.GooglePayButton=GooglePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/GooglePayButton.tsx";var _excluded=["type","onPress","disabled"];var GooglePayButtonNative=(0,_reactNative.requireNativeComponent)('GooglePayButton');function GooglePayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?'pay':_ref$type,onPress=_ref.onPress,disabled=_ref.disabled,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:1,onPress:onPress,style:disabled?styles.disabled:{},__self:this,__source:{fileName:_jsxFileName,lineNumber:51,columnNumber:5}},_react.default.createElement(GooglePayButtonNative,(0,_extends2.default)({buttonType:type},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:57,columnNumber:7}})));}var styles=_reactNative.StyleSheet.create({disabled:{opacity:0.3}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.GooglePayButton=GooglePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/GooglePayButton.tsx";var _excluded=["type","onPress","disabled"];var GooglePayButtonNative=(0,_reactNative.requireNativeComponent)('GooglePayButton');function GooglePayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?'pay':_ref$type,onPress=_ref.onPress,disabled=_ref.disabled,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:1,onPress:onPress,style:disabled?styles.disabled:{},__self:this,__source:{fileName:_jsxFileName,lineNumber:51,columnNumber:5}},_react.default.createElement(GooglePayButtonNative,(0,_extends2.default)({buttonType:type},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:57,columnNumber:7}})));}var styles=_reactNative.StyleSheet.create({disabled:{opacity:0.3}});
2
2
  //# sourceMappingURL=GooglePayButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["GooglePayButton.tsx"],"names":["GooglePayButtonNative","GooglePayButton","type","onPress","disabled","props","styles","StyleSheet","create","opacity"],"mappings":"oXAAA,oDACA,yC,8IASA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAiCO,QAASC,CAAAA,eAAT,MAKG,oBAJRC,IAIQ,CAJRA,IAIQ,oBAJD,KAIC,WAHRC,OAGQ,MAHRA,OAGQ,CAFRC,QAEQ,MAFRA,QAEQ,CADLC,KACK,uDACR,MACE,8BAAC,6BAAD,EACE,QAAQ,CAAED,QADZ,CAEE,aAAa,CAAE,CAFjB,CAGE,OAAO,CAAED,OAHX,CAIE,KAAK,CAAEC,QAAQ,CAAGE,MAAM,CAACF,QAAV,CAAqB,EAJtC,4EAME,6BAAC,qBAAD,wBAAuB,UAAU,CAAEF,IAAnC,EAA6CG,KAA7C,8EANF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGC,wBAAWC,MAAX,CAAkB,CAC/BJ,QAAQ,CAAE,CACRK,OAAO,CAAE,GADD,CADqB,CAAlB,CAAf","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n TouchableOpacity,\n StyleSheet,\n} from 'react-native';\n\nconst GooglePayButtonNative = requireNativeComponent<any>('GooglePayButton');\n\n/**\n * Google Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?:\n | 'pay'\n | 'pay_shadow'\n | 'standard'\n | 'standard_shadow'\n | 'pay_dark'\n | 'standard_dark';\n onPress(): void;\n disabled?: boolean;\n testID?: string;\n}\n\n/**\n * Google Pay Button Component\n *\n * @example\n * ```ts\n * <GooglePayButton\n * onPress={pay}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function GooglePayButton({\n type = 'pay',\n onPress,\n disabled,\n ...props\n}: Props) {\n return (\n <TouchableOpacity\n disabled={disabled}\n activeOpacity={1}\n onPress={onPress}\n style={disabled ? styles.disabled : {}}\n >\n <GooglePayButtonNative buttonType={type} {...props} />\n </TouchableOpacity>\n );\n}\n\nconst styles = StyleSheet.create({\n disabled: {\n opacity: 0.3,\n },\n});\n"]}
1
+ {"version":3,"sources":["GooglePayButton.tsx"],"names":["GooglePayButtonNative","GooglePayButton","type","onPress","disabled","props","styles","StyleSheet","create","opacity"],"mappings":"oXAAA,oDACA,yC,kJASA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAiCO,QAASC,CAAAA,eAAT,MAKG,oBAJRC,IAIQ,CAJRA,IAIQ,oBAJD,KAIC,WAHRC,OAGQ,MAHRA,OAGQ,CAFRC,QAEQ,MAFRA,QAEQ,CADLC,KACK,uDACR,MACE,8BAAC,6BAAD,EACE,QAAQ,CAAED,QADZ,CAEE,aAAa,CAAE,CAFjB,CAGE,OAAO,CAAED,OAHX,CAIE,KAAK,CAAEC,QAAQ,CAAGE,MAAM,CAACF,QAAV,CAAqB,EAJtC,4EAME,6BAAC,qBAAD,wBAAuB,UAAU,CAAEF,IAAnC,EAA6CG,KAA7C,8EANF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGC,wBAAWC,MAAX,CAAkB,CAC/BJ,QAAQ,CAAE,CACRK,OAAO,CAAE,GADD,CADqB,CAAlB,CAAf","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n TouchableOpacity,\n StyleSheet,\n} from 'react-native';\n\nconst GooglePayButtonNative = requireNativeComponent<any>('GooglePayButton');\n\n/**\n * Google Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?:\n | 'pay'\n | 'pay_shadow'\n | 'standard'\n | 'standard_shadow'\n | 'pay_dark'\n | 'standard_dark';\n onPress(): void;\n disabled?: boolean;\n testID?: string;\n}\n\n/**\n * Google Pay Button Component\n *\n * @example\n * ```ts\n * <GooglePayButton\n * onPress={pay}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function GooglePayButton({\n type = 'pay',\n onPress,\n disabled,\n ...props\n}: Props) {\n return (\n <TouchableOpacity\n disabled={disabled}\n activeOpacity={1}\n onPress={onPress}\n style={disabled ? styles.disabled : {}}\n >\n <GooglePayButtonNative buttonType={type} {...props} />\n </TouchableOpacity>\n );\n}\n\nconst styles = StyleSheet.create({\n disabled: {\n opacity: 0.3,\n },\n});\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StripeContainer=StripeContainer;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/StripeContainer.tsx";var StripeContainerNative=(0,_reactNative.requireNativeComponent)('StripeContainer');function StripeContainer(_ref){var keyboardShouldPersistTaps=_ref.keyboardShouldPersistTaps,children=_ref.children;return _react.default.createElement(StripeContainerNative,{keyboardShouldPersistTaps:keyboardShouldPersistTaps,style:styles.container,__self:this,__source:{fileName:_jsxFileName,lineNumber:34,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:styles.container,accessible:false,__self:this,__source:{fileName:_jsxFileName,lineNumber:38,columnNumber:7}},children));}var styles=_reactNative.StyleSheet.create({container:{flex:1}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StripeContainer=StripeContainer;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/StripeContainer.tsx";var StripeContainerNative=(0,_reactNative.requireNativeComponent)('StripeContainer');function StripeContainer(_ref){var keyboardShouldPersistTaps=_ref.keyboardShouldPersistTaps,children=_ref.children;return _react.default.createElement(StripeContainerNative,{keyboardShouldPersistTaps:keyboardShouldPersistTaps,style:styles.container,__self:this,__source:{fileName:_jsxFileName,lineNumber:34,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:styles.container,accessible:false,__self:this,__source:{fileName:_jsxFileName,lineNumber:38,columnNumber:7}},children));}var styles=_reactNative.StyleSheet.create({container:{flex:1}});
2
2
  //# sourceMappingURL=StripeContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["StripeContainer.tsx"],"names":["StripeContainerNative","StripeContainer","keyboardShouldPersistTaps","children","styles","container","StyleSheet","create","flex"],"mappings":"oLAAA,oDAEA,yC,kGAQA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAkBO,QAASC,CAAAA,eAAT,MAGG,IAFRC,CAAAA,yBAEQ,MAFRA,yBAEQ,CADRC,QACQ,MADRA,QACQ,CACR,MACE,8BAAC,qBAAD,EACE,yBAAyB,CAAED,yBAD7B,CAEE,KAAK,CAAEE,MAAM,CAACC,SAFhB,4EAIE,6BAAC,iBAAD,EAAM,KAAK,CAAED,MAAM,CAACC,SAApB,CAA+B,UAAU,CAAE,KAA3C,4EACGF,QADH,CAJF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGE,wBAAWC,MAAX,CAAkB,CAC/BF,SAAS,CAAE,CACTG,IAAI,CAAE,CADG,CADoB,CAAlB,CAAf","sourcesContent":["import React from 'react';\n\nimport {\n requireNativeComponent,\n StyleProp,\n StyleSheet,\n ViewStyle,\n View,\n} from 'react-native';\n\nconst StripeContainerNative = requireNativeComponent<any>('StripeContainer');\n\n/**\n * Stripe Container Component Props\n */\nexport interface Props {\n children: React.ReactElement | React.ReactElement[];\n keyboardShouldPersistTaps?: boolean;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * StripeContainer Component\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function StripeContainer({\n keyboardShouldPersistTaps,\n children,\n}: Props) {\n return (\n <StripeContainerNative\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n style={styles.container}\n >\n <View style={styles.container} accessible={false}>\n {children}\n </View>\n </StripeContainerNative>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
1
+ {"version":3,"sources":["StripeContainer.tsx"],"names":["StripeContainerNative","StripeContainer","keyboardShouldPersistTaps","children","styles","container","StyleSheet","create","flex"],"mappings":"oLAAA,oDAEA,yC,sGAQA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAkBO,QAASC,CAAAA,eAAT,MAGG,IAFRC,CAAAA,yBAEQ,MAFRA,yBAEQ,CADRC,QACQ,MADRA,QACQ,CACR,MACE,8BAAC,qBAAD,EACE,yBAAyB,CAAED,yBAD7B,CAEE,KAAK,CAAEE,MAAM,CAACC,SAFhB,4EAIE,6BAAC,iBAAD,EAAM,KAAK,CAAED,MAAM,CAACC,SAApB,CAA+B,UAAU,CAAE,KAA3C,4EACGF,QADH,CAJF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGE,wBAAWC,MAAX,CAAkB,CAC/BF,SAAS,CAAE,CACTG,IAAI,CAAE,CADG,CADoB,CAAlB,CAAf","sourcesContent":["import React from 'react';\n\nimport {\n requireNativeComponent,\n StyleProp,\n StyleSheet,\n ViewStyle,\n View,\n} from 'react-native';\n\nconst StripeContainerNative = requireNativeComponent<any>('StripeContainer');\n\n/**\n * Stripe Container Component Props\n */\nexport interface Props {\n children: React.ReactElement | React.ReactElement[];\n keyboardShouldPersistTaps?: boolean;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * StripeContainer Component\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function StripeContainer({\n keyboardShouldPersistTaps,\n children,\n}: Props) {\n return (\n <StripeContainerNative\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n style={styles.container}\n >\n <View style={styles.container} accessible={false}>\n {children}\n </View>\n </StripeContainerNative>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddToWalletButtonNative,(0,_extends2.default)({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},__self:this,__source:{fileName:_jsxFileName,lineNumber:84,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddToWalletButtonNative,(0,_extends2.default)({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},__self:this,__source:{fileName:_jsxFileName,lineNumber:84,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AddToWalletButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["AddToWalletButton.tsx"],"names":["AddToWalletButtonNative","AddToWalletButton","onComplete","props","value","nativeEvent"],"mappings":"wXAAA,oDACA,yC,iIAeA,GAAMA,CAAAA,uBAAuB,CAC3B,wCAA4B,mBAA5B,CADF,CAiEO,QAASC,CAAAA,iBAAT,MAA4D,IAA/BC,CAAAA,UAA+B,MAA/BA,UAA+B,CAAhBC,KAAgB,uDACjE,MACE,8BAAC,uBAAD,0BACMA,KADN,EAEE,gBAAgB,CAAE,0BAChBC,KADgB,QAIbF,CAAAA,UAAU,CAACE,KAAK,CAACC,WAAP,CAJG,EAFpB,6EADF,CAUD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n NativeSyntheticEvent,\n ImageSourcePropType,\n} from 'react-native';\nimport type {\n Token,\n CardActionError,\n StripeError,\n GooglePayCardToken,\n} from '../types';\n\nconst AddToWalletButtonNative =\n requireNativeComponent<any>('AddToWalletButton');\n\n/**\n * Add to wallet button component props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Sets the Apple Wallet/Google Pay button style. If the button is placed over a dark background, set this to 'onDarkBackground', otherwise set to 'onLightBackground'. */\n iOSButtonStyle?: 'onDarkBackground' | 'onLightBackground';\n /** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */\n androidAssetSource: ImageSourcePropType;\n testID?: string;\n /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */\n testEnv?: boolean;\n /** Details of the Issued Card you'd like added to the device's wallet */\n cardDetails: {\n /** The `primary_account_identifier` value from the issued card. */\n primaryAccountIdentifier: string | null;\n /** The card holder name (used only on iOS) */\n name: string;\n /** A user-facing description of the card. Required on Android.*/\n description: string;\n /** Last 4 digits of the card, only used on iOS */\n lastFour?: string;\n /** Optional, only used on iOS */\n brand?: Token.CardBrand;\n };\n // 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.\n token?: GooglePayCardToken | null;\n /** Used by stripe to securely obtain card info of the card being provisioned. */\n ephemeralKey: object;\n /** Called when the flow completes. If the `error` field is `null`, then the card was successfully added to the user's native wallet. */\n onComplete(result: { error: StripeError<CardActionError> | null }): void;\n}\n\n/**\n * Add to wallet button\n *\n * @example\n * ```ts\n * <AddToWalletButton\n * testEnv={true}\n * style={styles.myButtonStyle}\n * iOSButtonStyle=\"onLightBackground\"\n * cardDetails={{\n * primaryAccountIdentifier: \"V-123\",\n * name: \"David Wallace\",\n * lastFour: \"4242\",\n * }}\n * ephemeralKey={myEphemeralKey} // This object is retrieved from your server. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#update-your-backend\n * onComplete={(error) => {\n * Alert.alert(\n * error ? error.code : 'Success',\n * error\n * ? error.message\n * : 'Card was successfully added to the wallet.'\n * );\n * }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddToWalletButton({ onComplete, ...props }: Props) {\n return (\n <AddToWalletButtonNative\n {...props}\n onCompleteAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<CardActionError> | null;\n }>\n ) => onComplete(value.nativeEvent)}\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["AddToWalletButton.tsx"],"names":["AddToWalletButtonNative","AddToWalletButton","onComplete","props","value","nativeEvent"],"mappings":"wXAAA,oDACA,yC,qIAeA,GAAMA,CAAAA,uBAAuB,CAC3B,wCAA4B,mBAA5B,CADF,CAiEO,QAASC,CAAAA,iBAAT,MAA4D,IAA/BC,CAAAA,UAA+B,MAA/BA,UAA+B,CAAhBC,KAAgB,uDACjE,MACE,8BAAC,uBAAD,0BACMA,KADN,EAEE,gBAAgB,CAAE,0BAChBC,KADgB,QAIbF,CAAAA,UAAU,CAACE,KAAK,CAACC,WAAP,CAJG,EAFpB,6EADF,CAUD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n NativeSyntheticEvent,\n ImageSourcePropType,\n} from 'react-native';\nimport type {\n Token,\n CardActionError,\n StripeError,\n GooglePayCardToken,\n} from '../types';\n\nconst AddToWalletButtonNative =\n requireNativeComponent<any>('AddToWalletButton');\n\n/**\n * Add to wallet button component props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Sets the Apple Wallet/Google Pay button style. If the button is placed over a dark background, set this to 'onDarkBackground', otherwise set to 'onLightBackground'. */\n iOSButtonStyle?: 'onDarkBackground' | 'onLightBackground';\n /** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */\n androidAssetSource: ImageSourcePropType;\n testID?: string;\n /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */\n testEnv?: boolean;\n /** Details of the Issued Card you'd like added to the device's wallet */\n cardDetails: {\n /** The `primary_account_identifier` value from the issued card. */\n primaryAccountIdentifier: string | null;\n /** The card holder name (used only on iOS) */\n name: string;\n /** A user-facing description of the card. Required on Android.*/\n description: string;\n /** Last 4 digits of the card, only used on iOS */\n lastFour?: string;\n /** Optional, only used on iOS */\n brand?: Token.CardBrand;\n };\n // 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.\n token?: GooglePayCardToken | null;\n /** Used by stripe to securely obtain card info of the card being provisioned. */\n ephemeralKey: object;\n /** Called when the flow completes. If the `error` field is `null`, then the card was successfully added to the user's native wallet. */\n onComplete(result: { error: StripeError<CardActionError> | null }): void;\n}\n\n/**\n * Add to wallet button\n *\n * @example\n * ```ts\n * <AddToWalletButton\n * testEnv={true}\n * style={styles.myButtonStyle}\n * iOSButtonStyle=\"onLightBackground\"\n * cardDetails={{\n * primaryAccountIdentifier: \"V-123\",\n * name: \"David Wallace\",\n * lastFour: \"4242\",\n * }}\n * ephemeralKey={myEphemeralKey} // This object is retrieved from your server. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#update-your-backend\n * onComplete={(error) => {\n * Alert.alert(\n * error ? error.code : 'Success',\n * error\n * ? error.message\n * : 'Card was successfully added to the wallet.'\n * );\n * }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddToWalletButton({ onComplete, ...props }: Props) {\n return (\n <AddToWalletButtonNative\n {...props}\n onCompleteAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<CardActionError> | null;\n }>\n ) => onComplete(value.nativeEvent)}\n />\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ApplePayButton=ApplePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/ApplePayButton.tsx";var _excluded=["onPress","buttonStyle","type","borderRadius"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');function ApplePayButton(_ref){var onPress=_ref.onPress,_ref$buttonStyle=_ref.buttonStyle,buttonStyle=_ref$buttonStyle===void 0?'black':_ref$buttonStyle,_ref$type=_ref.type,type=_ref$type===void 0?'plain':_ref$type,_ref$borderRadius=_ref.borderRadius,borderRadius=_ref$borderRadius===void 0?4:_ref$borderRadius,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var buttonType=(0,_react.useMemo)(function(){return mapButtonType(type);},[type]);var style=(0,_react.useMemo)(function(){return mapButtonStyle(buttonStyle);},[buttonStyle]);return _react.default.createElement(ApplePayButtonNative,(0,_extends2.default)({type:buttonType,buttonStyle:style,borderRadius:borderRadius,onPressAction:onPress},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:5}}));}function mapButtonType(type){switch(type){case'plain':return 0;case'buy':return 1;case'setUp':return 2;case'inStore':return 3;case'donate':return 4;case'checkout':return 5;case'book':return 6;case'subscribe':return 7;case'reload':return 8;case'addMoney':return 9;case'topUp':return 10;case'order':return 11;case'rent':return 12;case'support':return 13;case'contribute':return 14;case'tip':return 15;default:return 0;}}function mapButtonStyle(type){switch(type){case'white':return 0;case'whiteOutline':return 1;case'black':return 2;case'automatic':return 3;default:return 2;}}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ApplePayButton=ApplePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/ApplePayButton.tsx";var _excluded=["onPress","buttonStyle","type","borderRadius"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');function ApplePayButton(_ref){var onPress=_ref.onPress,_ref$buttonStyle=_ref.buttonStyle,buttonStyle=_ref$buttonStyle===void 0?'black':_ref$buttonStyle,_ref$type=_ref.type,type=_ref$type===void 0?'plain':_ref$type,_ref$borderRadius=_ref.borderRadius,borderRadius=_ref$borderRadius===void 0?4:_ref$borderRadius,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var buttonType=(0,_react.useMemo)(function(){return mapButtonType(type);},[type]);var style=(0,_react.useMemo)(function(){return mapButtonStyle(buttonStyle);},[buttonStyle]);return _react.default.createElement(ApplePayButtonNative,(0,_extends2.default)({type:buttonType,buttonStyle:style,borderRadius:borderRadius,onPressAction:onPress},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:5}}));}function mapButtonType(type){switch(type){case'plain':return 0;case'buy':return 1;case'setUp':return 2;case'inStore':return 3;case'donate':return 4;case'checkout':return 5;case'book':return 6;case'subscribe':return 7;case'reload':return 8;case'addMoney':return 9;case'topUp':return 10;case'order':return 11;case'rent':return 12;case'support':return 13;case'contribute':return 14;case'tip':return 15;default:return 0;}}function mapButtonStyle(type){switch(type){case'white':return 0;case'whiteOutline':return 1;case'black':return 2;case'automatic':return 3;default:return 2;}}
2
2
  //# sourceMappingURL=ApplePayButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ApplePayButton.tsx"],"names":["ApplePayButtonNative","ApplePayButton","onPress","buttonStyle","type","borderRadius","props","buttonType","mapButtonType","style","mapButtonStyle"],"mappings":"kXACA,qDACA,yC,ypCAOA,GAAMA,CAAAA,oBAAoB,CACxB,wCAA4D,gBAA5D,CADF,CAgCO,QAASC,CAAAA,cAAT,MAMG,IALRC,CAAAA,OAKQ,MALRA,OAKQ,uBAJRC,WAIQ,CAJRA,WAIQ,2BAJM,OAIN,iCAHRC,IAGQ,CAHRA,IAGQ,oBAHD,OAGC,kCAFRC,YAEQ,CAFRA,YAEQ,4BAFO,CAEP,mBADLC,KACK,uDACR,GAAMC,CAAAA,UAAU,CAAG,mBAAQ,iBAAMC,CAAAA,aAAa,CAACJ,IAAD,CAAnB,EAAR,CAAmC,CAACA,IAAD,CAAnC,CAAnB,CACA,GAAMK,CAAAA,KAAK,CAAG,mBAAQ,iBAAMC,CAAAA,cAAc,CAACP,WAAD,CAApB,EAAR,CAA2C,CAACA,WAAD,CAA3C,CAAd,CAEA,MACE,8BAAC,oBAAD,wBACE,IAAI,CAAEI,UADR,CAEE,WAAW,CAAEE,KAFf,CAGE,YAAY,CAAEJ,YAHhB,CAIE,aAAa,CAAEH,OAJjB,EAKMI,KALN,8EADF,CASD,CAED,QAASE,CAAAA,aAAT,CAAuBJ,IAAvB,CAA2D,CACzD,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,KAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,SAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,MAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,MAAL,CACE,MAAO,GAAP,CACF,IAAK,SAAL,CACE,MAAO,GAAP,CACF,IAAK,YAAL,CACE,MAAO,GAAP,CACF,IAAK,KAAL,CACE,MAAO,GAAP,CACF,QACE,MAAO,EAAP,CAlCJ,CAoCD,CAED,QAASM,CAAAA,cAAT,CAAwBN,IAAxB,CAA6D,CAC3D,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,cAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,QACE,MAAO,EAAP,CAVJ,CAYD","sourcesContent":["import type { ApplePayButtonComponent } from '../types';\nimport React, { useMemo } from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nconst ApplePayButtonNative =\n requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');\n\n/**\n * Apple Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?: ApplePayButtonComponent.Type;\n buttonStyle?: ApplePayButtonComponent.Style;\n borderRadius?: number;\n onPress(): void;\n testID?: string;\n}\n\n/**\n * Apple Pay Button Component\n *\n * @example\n * ```ts\n * <ApplePayButton\n * onPress={pay}\n * type=\"plain\"\n * buttonStyle=\"black\"\n * borderRadius={4}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function ApplePayButton({\n onPress,\n buttonStyle = 'black',\n type = 'plain',\n borderRadius = 4,\n ...props\n}: Props) {\n const buttonType = useMemo(() => mapButtonType(type), [type]);\n const style = useMemo(() => mapButtonStyle(buttonStyle), [buttonStyle]);\n\n return (\n <ApplePayButtonNative\n type={buttonType}\n buttonStyle={style}\n borderRadius={borderRadius}\n onPressAction={onPress}\n {...props}\n />\n );\n}\n\nfunction mapButtonType(type: ApplePayButtonComponent.Type) {\n switch (type) {\n case 'plain':\n return 0;\n case 'buy':\n return 1;\n case 'setUp':\n return 2;\n case 'inStore':\n return 3;\n case 'donate':\n return 4;\n case 'checkout':\n return 5;\n case 'book':\n return 6;\n case 'subscribe':\n return 7;\n case 'reload':\n return 8;\n case 'addMoney':\n return 9;\n case 'topUp':\n return 10;\n case 'order':\n return 11;\n case 'rent':\n return 12;\n case 'support':\n return 13;\n case 'contribute':\n return 14;\n case 'tip':\n return 15;\n default:\n return 0;\n }\n}\n\nfunction mapButtonStyle(type: ApplePayButtonComponent.Style) {\n switch (type) {\n case 'white':\n return 0;\n case 'whiteOutline':\n return 1;\n case 'black':\n return 2;\n case 'automatic':\n return 3;\n default:\n return 2;\n }\n}\n"]}
1
+ {"version":3,"sources":["ApplePayButton.tsx"],"names":["ApplePayButtonNative","ApplePayButton","onPress","buttonStyle","type","borderRadius","props","buttonType","mapButtonType","style","mapButtonStyle"],"mappings":"kXACA,qDACA,yC,6pCAOA,GAAMA,CAAAA,oBAAoB,CACxB,wCAA4D,gBAA5D,CADF,CAgCO,QAASC,CAAAA,cAAT,MAMG,IALRC,CAAAA,OAKQ,MALRA,OAKQ,uBAJRC,WAIQ,CAJRA,WAIQ,2BAJM,OAIN,iCAHRC,IAGQ,CAHRA,IAGQ,oBAHD,OAGC,kCAFRC,YAEQ,CAFRA,YAEQ,4BAFO,CAEP,mBADLC,KACK,uDACR,GAAMC,CAAAA,UAAU,CAAG,mBAAQ,iBAAMC,CAAAA,aAAa,CAACJ,IAAD,CAAnB,EAAR,CAAmC,CAACA,IAAD,CAAnC,CAAnB,CACA,GAAMK,CAAAA,KAAK,CAAG,mBAAQ,iBAAMC,CAAAA,cAAc,CAACP,WAAD,CAApB,EAAR,CAA2C,CAACA,WAAD,CAA3C,CAAd,CAEA,MACE,8BAAC,oBAAD,wBACE,IAAI,CAAEI,UADR,CAEE,WAAW,CAAEE,KAFf,CAGE,YAAY,CAAEJ,YAHhB,CAIE,aAAa,CAAEH,OAJjB,EAKMI,KALN,8EADF,CASD,CAED,QAASE,CAAAA,aAAT,CAAuBJ,IAAvB,CAA2D,CACzD,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,KAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,SAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,MAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,IAAK,QAAL,CACE,MAAO,EAAP,CACF,IAAK,UAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,OAAL,CACE,MAAO,GAAP,CACF,IAAK,MAAL,CACE,MAAO,GAAP,CACF,IAAK,SAAL,CACE,MAAO,GAAP,CACF,IAAK,YAAL,CACE,MAAO,GAAP,CACF,IAAK,KAAL,CACE,MAAO,GAAP,CACF,QACE,MAAO,EAAP,CAlCJ,CAoCD,CAED,QAASM,CAAAA,cAAT,CAAwBN,IAAxB,CAA6D,CAC3D,OAAQA,IAAR,EACE,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,cAAL,CACE,MAAO,EAAP,CACF,IAAK,OAAL,CACE,MAAO,EAAP,CACF,IAAK,WAAL,CACE,MAAO,EAAP,CACF,QACE,MAAO,EAAP,CAVJ,CAYD","sourcesContent":["import type { ApplePayButtonComponent } from '../types';\nimport React, { useMemo } from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nconst ApplePayButtonNative =\n requireNativeComponent<ApplePayButtonComponent.NativeProps>('ApplePayButton');\n\n/**\n * Apple Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?: ApplePayButtonComponent.Type;\n buttonStyle?: ApplePayButtonComponent.Style;\n borderRadius?: number;\n onPress(): void;\n testID?: string;\n}\n\n/**\n * Apple Pay Button Component\n *\n * @example\n * ```ts\n * <ApplePayButton\n * onPress={pay}\n * type=\"plain\"\n * buttonStyle=\"black\"\n * borderRadius={4}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function ApplePayButton({\n onPress,\n buttonStyle = 'black',\n type = 'plain',\n borderRadius = 4,\n ...props\n}: Props) {\n const buttonType = useMemo(() => mapButtonType(type), [type]);\n const style = useMemo(() => mapButtonStyle(buttonStyle), [buttonStyle]);\n\n return (\n <ApplePayButtonNative\n type={buttonType}\n buttonStyle={style}\n borderRadius={borderRadius}\n onPressAction={onPress}\n {...props}\n />\n );\n}\n\nfunction mapButtonType(type: ApplePayButtonComponent.Type) {\n switch (type) {\n case 'plain':\n return 0;\n case 'buy':\n return 1;\n case 'setUp':\n return 2;\n case 'inStore':\n return 3;\n case 'donate':\n return 4;\n case 'checkout':\n return 5;\n case 'book':\n return 6;\n case 'subscribe':\n return 7;\n case 'reload':\n return 8;\n case 'addMoney':\n return 9;\n case 'topUp':\n return 10;\n case 'order':\n return 11;\n case 'rent':\n return 12;\n case 'support':\n return 13;\n case 'contribute':\n return 14;\n case 'tip':\n return 15;\n default:\n return 0;\n }\n}\n\nfunction mapButtonStyle(type: ApplePayButtonComponent.Style) {\n switch (type) {\n case 'white':\n return 0;\n case 'whiteOutline':\n return 1;\n case 'black':\n return 2;\n case 'automatic':\n return 3;\n default:\n return 2;\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];var AuBECSDebitFormNative=(0,_reactNative.requireNativeComponent)('AuBECSDebitForm');function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AuBECSDebitFormNative,(0,_extends2.default)({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];var AuBECSDebitFormNative=(0,_reactNative.requireNativeComponent)('AuBECSDebitForm');function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AuBECSDebitFormNative,(0,_extends2.default)({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}}));}
2
2
  //# sourceMappingURL=AuBECSDebitForm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["AuBECSDebitForm.tsx"],"names":["AuBECSDebitFormNative","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"mappings":"oXAAA,oDACA,yC,yJAQA,GAAMA,CAAAA,qBAAqB,CACzB,wCACE,iBADF,CADF,CA+BO,QAASC,CAAAA,eAAT,MAKG,IAJRC,CAAAA,UAIQ,MAJRA,UAIQ,CAHRC,WAGQ,MAHRA,WAGQ,CAFRC,SAEQ,MAFRA,SAEQ,CADLC,KACK,uDACR,MACE,8BAAC,qBAAD,wBACE,gBAAgB,CAAE,0BAACC,KAAD,QAAWJ,CAAAA,UAAU,CAACI,KAAK,CAACC,WAAP,CAArB,EADpB,CAEE,WAAW,CAAEJ,WAFf,CAGE,SAAS,kBAAOC,SAAP,CAHX,EAIMC,KAJN,8EADF,CAQD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type { AuBECSDebitFormComponent } from '../types';\n\nconst AuBECSDebitFormNative =\n requireNativeComponent<AuBECSDebitFormComponent.NativeProps>(\n 'AuBECSDebitForm'\n );\n\n/**\n * BECS Debit Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n companyName: string;\n onComplete(value: AuBECSDebitFormComponent.FormDetails): void;\n formStyle?: AuBECSDebitFormComponent.Styles;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * BECS Debit form component\n *\n * @example\n * ```ts\n * <AuBECSDebitForm\n * companyName=\"Example Company Inc.\"\n * onComplete={value => onComplete(value)}\n * style={{ width: '100%', height: 500 }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AuBECSDebitForm({\n onComplete,\n companyName,\n formStyle,\n ...props\n}: Props) {\n return (\n <AuBECSDebitFormNative\n onCompleteAction={(value) => onComplete(value.nativeEvent)}\n companyName={companyName}\n formStyle={{ ...formStyle }}\n {...props}\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["AuBECSDebitForm.tsx"],"names":["AuBECSDebitFormNative","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"mappings":"oXAAA,oDACA,yC,6JAQA,GAAMA,CAAAA,qBAAqB,CACzB,wCACE,iBADF,CADF,CA+BO,QAASC,CAAAA,eAAT,MAKG,IAJRC,CAAAA,UAIQ,MAJRA,UAIQ,CAHRC,WAGQ,MAHRA,WAGQ,CAFRC,SAEQ,MAFRA,SAEQ,CADLC,KACK,uDACR,MACE,8BAAC,qBAAD,wBACE,gBAAgB,CAAE,0BAACC,KAAD,QAAWJ,CAAAA,UAAU,CAACI,KAAK,CAACC,WAAP,CAArB,EADpB,CAEE,WAAW,CAAEJ,WAFf,CAGE,SAAS,kBAAOC,SAAP,CAHX,EAIMC,KAJN,8EADF,CAQD","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type { AuBECSDebitFormComponent } from '../types';\n\nconst AuBECSDebitFormNative =\n requireNativeComponent<AuBECSDebitFormComponent.NativeProps>(\n 'AuBECSDebitForm'\n );\n\n/**\n * BECS Debit Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n companyName: string;\n onComplete(value: AuBECSDebitFormComponent.FormDetails): void;\n formStyle?: AuBECSDebitFormComponent.Styles;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * BECS Debit form component\n *\n * @example\n * ```ts\n * <AuBECSDebitForm\n * companyName=\"Example Company Inc.\"\n * onComplete={value => onComplete(value)}\n * style={{ width: '100%', height: 500 }}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AuBECSDebitForm({\n onComplete,\n companyName,\n formStyle,\n ...props\n}: Props) {\n return (\n <AuBECSDebitFormNative\n onCompleteAction={(value) => onComplete(value.nativeEvent)}\n companyName={companyName}\n formStyle={{ ...formStyle }}\n {...props}\n />\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode"];var _this=this,_jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/CardField.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFieldNative=(0,_reactNative.requireNativeComponent)('CardField');var CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,postalCodeEnabled=_ref.postalCodeEnabled,countryCode=_ref.countryCode,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F 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");}}onCardChange==null?void 0:onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null?void 0:onFocus(focusedField);}else{onBlur==null?void 0:onBlur();}},[onFocus,onBlur]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};var clear=function clear(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'clear',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFieldNative,(0,_extends2.default)({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,countryCode:countryCode!=null?countryCode:null,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode}},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:177,columnNumber:7}}));});exports.CardField=CardField;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode"];var _this=this,_jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/CardField.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFieldNative=(0,_reactNative.requireNativeComponent)('CardField');var CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,postalCodeEnabled=_ref.postalCodeEnabled,countryCode=_ref.countryCode,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F 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");}}onCardChange==null?void 0:onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null?void 0:onFocus(focusedField);}else{onBlur==null?void 0:onBlur();}},[onFocus,onBlur]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};var clear=function clear(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'clear',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFieldNative,(0,_extends2.default)({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,countryCode:countryCode!=null?countryCode:null,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode}},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:177,columnNumber:7}}));});exports.CardField=CardField;
2
2
  //# sourceMappingURL=CardField.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["CardField.tsx"],"names":["CardFieldNative","CardField","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode","props","inputRef","onCardChangeHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","hasOwnProperty","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","current","focus","UIManager","dispatchViewManagerCommand","blur","clear","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"qWACA,qDAOA,yCASA,mC,gtCAOA,GAAMA,CAAAA,eAAe,CACnB,wCAAmD,WAAnD,CADF,CA8CO,GAAMC,CAAAA,SAAS,CAAG,sBACvB,cAWEC,GAXF,CAYK,IAVDC,CAAAA,YAUC,MAVDA,YAUC,CATDC,OASC,MATDA,OASC,CARDC,MAQC,MARDA,MAQC,CAPDC,SAOC,MAPDA,SAOC,CANDC,YAMC,MANDA,YAMC,CALDC,iBAKC,MALDA,iBAKC,CAJDC,WAIC,MAJDA,WAIC,CAHEC,KAGF,uDACH,GAAMC,CAAAA,QAAQ,CAAG,kBAAY,IAAZ,CAAjB,CAEA,GAAMC,CAAAA,mBAAmB,CAAG,uBAC1B,SAACC,KAAD,CAAyD,CACvD,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACE,WAAnB,CAEA,GAAMC,CAAAA,IAA4B,CAAG,CACnCC,KAAK,CAAEH,IAAI,CAACG,KADuB,CAEnCC,WAAW,CAAEJ,IAAI,CAACI,WAFiB,CAGnCC,UAAU,CAAEL,IAAI,CAACK,UAHkB,CAInCC,QAAQ,CAAEN,IAAI,CAACM,QAJoB,CAKnCC,KAAK,CAAEP,IAAI,CAACO,KALuB,CAMnCC,eAAe,CAAER,IAAI,CAACQ,eANa,CAOnCC,WAAW,CAAET,IAAI,CAACS,WAPiB,CAQnCC,QAA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B,CAAEzC,SAAF,cAAEA,SAAS,CAAEyC,gBAPpB,CAQTC,SAAS,CAAE1C,SAAF,cAAEA,SAAS,CAAE0C,SARb,CASTC,cAAc,CAAE3C,SAAF,cAAEA,SAAS,CAAE2C,cATlB,CAUTC,UAAU,CAAE5C,SAAF,cAAEA,SAAS,CAAE4C,UAVd,CANb,CAkBE,YAAY,CAAE,CACZvB,MAAM,CAAEpB,YAAF,cAAEA,YAAY,CAAEoB,MADV,CAEZwB,UAAU,CAAE5C,YAAF,cAAEA,YAAY,CAAE4C,UAFd,CAGZvB,GAAG,CAAErB,YAAF,cAAEA,YAAY,CAAEqB,GAHP,CAIZF,UAAU,CAAEnB,YAAF,cAAEA,YAAY,CAAEmB,UAJd,CAlBhB,EAwBMhB,KAxBN,gFADF,CA4BD,CArIsB,CAAlB,C","sourcesContent":["import type { CardFieldInput } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFieldNative =\n requireNativeComponent<CardFieldInput.NativeProps>('CardField');\n\n/**\n * Card Field Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Controls if a postal code entry field can be displayed to the user. Defaults to false. If true, the type of code entry shown is controlled by the set countryCode prop. Some country codes may result in no postal code entry being shown if those countries do not commonly use postal codes. If false, no postal code entry will ever be displayed. */\n postalCodeEnabled?: boolean;\n /** Controls the postal code entry shown (if the postalCodeEnabled prop is set to true). Defaults to the device's default locale. */\n countryCode?: string;\n cardStyle?: CardFieldInput.Styles;\n placeholders?: CardFieldInput.Placeholders;\n autofocus?: boolean;\n onCardChange?(card: CardFieldInput.Details): void;\n onBlur?(): void;\n onFocus?(focusedField: CardFieldInput.FieldName | null): void;\n testID?: string;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Field Component\n *\n * @example\n * ```ts\n * <CardField\n * postalCodeEnabled={false}\n * onCardChange={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 50}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardField = forwardRef<CardFieldInput.Methods, Props>(\n (\n {\n onCardChange,\n onFocus,\n onBlur,\n cardStyle,\n placeholders,\n postalCodeEnabled,\n countryCode,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onCardChangeHandler = useCallback(\n (event: NativeSyntheticEvent<CardFieldInput.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFieldInput.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n validExpiryDate: card.validExpiryDate,\n validNumber: card.validNumber,\n validCVC: card.validCVC,\n };\n\n if (card.hasOwnProperty('postalCode')) {\n data.postalCode = card.postalCode || '';\n }\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onCardChange && card.complete) {\n console.warn(\n `[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`\n );\n }\n }\n onCardChange?.(data);\n },\n [onCardChange]\n );\n\n const onFocusHandler = useCallback(\n (event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n onFocus?.(focusedField);\n } else {\n onBlur?.();\n }\n },\n [onFocus, onBlur]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n const clear = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'clear' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n clear,\n }));\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFieldNative\n ref={inputRef}\n onCardChange={onCardChangeHandler}\n onFocusChange={onFocusHandler}\n postalCodeEnabled={postalCodeEnabled ?? true}\n countryCode={countryCode ?? null}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n }}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n {...props}\n />\n );\n }\n);\n"]}
1
+ {"version":3,"sources":["CardField.tsx"],"names":["CardFieldNative","CardField","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","postalCodeEnabled","countryCode","props","inputRef","onCardChangeHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","hasOwnProperty","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","current","focus","UIManager","dispatchViewManagerCommand","blur","clear","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"qWACA,qDAOA,yCASA,mC,otCAOA,GAAMA,CAAAA,eAAe,CACnB,wCAAmD,WAAnD,CADF,CA8CO,GAAMC,CAAAA,SAAS,CAAG,sBACvB,cAWEC,GAXF,CAYK,IAVDC,CAAAA,YAUC,MAVDA,YAUC,CATDC,OASC,MATDA,OASC,CARDC,MAQC,MARDA,MAQC,CAPDC,SAOC,MAPDA,SAOC,CANDC,YAMC,MANDA,YAMC,CALDC,iBAKC,MALDA,iBAKC,CAJDC,WAIC,MAJDA,WAIC,CAHEC,KAGF,uDACH,GAAMC,CAAAA,QAAQ,CAAG,kBAAY,IAAZ,CAAjB,CAEA,GAAMC,CAAAA,mBAAmB,CAAG,uBAC1B,SAACC,KAAD,CAAyD,CACvD,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACE,WAAnB,CAEA,GAAMC,CAAAA,IAA4B,CAAG,CACnCC,KAAK,CAAEH,IAAI,CAACG,KADuB,CAEnCC,WAAW,CAAEJ,IAAI,CAACI,WAFiB,CAGnCC,UAAU,CAAEL,IAAI,CAACK,UAHkB,CAInCC,QAAQ,CAAEN,IAAI,CAACM,QAJoB,CAKnCC,KAAK,CAAEP,IAAI,CAACO,KALuB,CAMnCC,eAAe,CAAER,IAAI,CAACQ,eANa,CAOnCC,WAAW,CAAET,IAAI,CAACS,WAPiB,CAQnCC,QAAQ,CAAEV,IAAI,CAACU,QARoB,CAArC,CAWA,GAAIV,IAAI,CAACW,cAAL,CAAoB,YAApB,CAAJ,CAAuC,CACrCT,IAAI,CAACU,UAAL,CAAkBZ,IAAI,CAACY,UAAL,EAAmB,EAArC,CACD,CACD,GAAIZ,IAAI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cAAEA,SAAS,CAAE4C,UAVd,CANb,CAkBE,YAAY,CAAE,CACZvB,MAAM,CAAEpB,YAAF,cAAEA,YAAY,CAAEoB,MADV,CAEZwB,UAAU,CAAE5C,YAAF,cAAEA,YAAY,CAAE4C,UAFd,CAGZvB,GAAG,CAAErB,YAAF,cAAEA,YAAY,CAAEqB,GAHP,CAIZF,UAAU,CAAEnB,YAAF,cAAEA,YAAY,CAAEmB,UAJd,CAlBhB,EAwBMhB,KAxBN,gFADF,CA4BD,CArIsB,CAAlB,C","sourcesContent":["import type { CardFieldInput } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFieldNative =\n requireNativeComponent<CardFieldInput.NativeProps>('CardField');\n\n/**\n * Card Field Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n /** Controls if a postal code entry field can be displayed to the user. Defaults to false. If true, the type of code entry shown is controlled by the set countryCode prop. Some country codes may result in no postal code entry being shown if those countries do not commonly use postal codes. If false, no postal code entry will ever be displayed. */\n postalCodeEnabled?: boolean;\n /** Controls the postal code entry shown (if the postalCodeEnabled prop is set to true). Defaults to the device's default locale. */\n countryCode?: string;\n cardStyle?: CardFieldInput.Styles;\n placeholders?: CardFieldInput.Placeholders;\n autofocus?: boolean;\n onCardChange?(card: CardFieldInput.Details): void;\n onBlur?(): void;\n onFocus?(focusedField: CardFieldInput.FieldName | null): void;\n testID?: string;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Field Component\n *\n * @example\n * ```ts\n * <CardField\n * postalCodeEnabled={false}\n * onCardChange={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 50}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardField = forwardRef<CardFieldInput.Methods, Props>(\n (\n {\n onCardChange,\n onFocus,\n onBlur,\n cardStyle,\n placeholders,\n postalCodeEnabled,\n countryCode,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onCardChangeHandler = useCallback(\n (event: NativeSyntheticEvent<CardFieldInput.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFieldInput.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n validExpiryDate: card.validExpiryDate,\n validNumber: card.validNumber,\n validCVC: card.validCVC,\n };\n\n if (card.hasOwnProperty('postalCode')) {\n data.postalCode = card.postalCode || '';\n }\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onCardChange && card.complete) {\n console.warn(\n `[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`\n );\n }\n }\n onCardChange?.(data);\n },\n [onCardChange]\n );\n\n const onFocusHandler = useCallback(\n (event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n onFocus?.(focusedField);\n } else {\n onBlur?.();\n }\n },\n [onFocus, onBlur]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n const clear = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'clear' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n clear,\n }));\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFieldNative\n ref={inputRef}\n onCardChange={onCardChangeHandler}\n onFocusChange={onFocusHandler}\n postalCodeEnabled={postalCodeEnabled ?? true}\n countryCode={countryCode ?? null}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n }}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n {...props}\n />\n );\n }\n);\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues"];var _this=this,_jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/CardForm.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFormNative=(0,_reactNative.requireNativeComponent)('CardForm');var CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,country:card.country,postalCode:card.postalCode};if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onFormComplete&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F 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");}}onFormComplete==null?void 0:onFormComplete(data);},[onFormComplete]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur};});var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);}else{}},[]);(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFormNative,(0,_extends2.default)({ref:inputRef,onFormComplete:onFormCompleteHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},defaultValues:Object.assign({},defaultValues!=null?defaultValues:{}),onFocusChange:onFocusHandler},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:167,columnNumber:7}}));});exports.CardForm=CardForm;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _helpers=require("../helpers");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues"];var _this=this,_jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/CardForm.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var CardFormNative=(0,_reactNative.requireNativeComponent)('CardForm');var CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,country:card.country,postalCode:card.postalCode};if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onFormComplete&&card.complete){console.warn("[stripe-react-native] \u26A0\uFE0F 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");}}onFormComplete==null?void 0:onFormComplete(data);},[onFormComplete]);var focus=function focus(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'focus',[]);};var blur=function blur(){_reactNative.UIManager.dispatchViewManagerCommand((0,_reactNative.findNodeHandle)(inputRef.current),'blur',[]);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur};});var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);}else{}},[]);(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return _react.default.createElement(CardFormNative,(0,_extends2.default)({ref:inputRef,onFormComplete:onFormCompleteHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},defaultValues:Object.assign({},defaultValues!=null?defaultValues:{}),onFocusChange:onFocusHandler},props,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:167,columnNumber:7}}));});exports.CardForm=CardForm;
2
2
  //# sourceMappingURL=CardForm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["CardForm.tsx"],"names":["CardFormNative","CardForm","ref","onFormComplete","cardStyle","placeholders","defaultValues","props","inputRef","onFormCompleteHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","country","postalCode","hasOwnProperty","number","cvc","__DEV__","console","warn","focus","UIManager","dispatchViewManagerCommand","current","blur","onFocusHandler","focusedField","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"oWACA,qDAOA,yCASA,mC,4qCAOA,GAAMA,CAAAA,cAAc,CAClB,wCAAiD,UAAjD,CADF,CAmDO,GAAMC,CAAAA,QAAQ,CAAG,sBACtB,cAYEC,GAZF,CAaK,IAXDC,CAAAA,cAWC,MAXDA,cAWC,CAVDC,SAUC,MAVDA,SAUC,CALDC,YAKC,MALDA,YAKC,CAJDC,aAIC,MAJDA,aAIC,CAHEC,KAGF,uDACH,GAAMC,CAAAA,QAAQ,CAAG,kBAAY,IAAZ,CAAjB,CAEA,GAAMC,CAAAA,qBAAqB,CAAG,uBAC5B,SAACC,KAAD,CAAuD,CACrD,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACE,WAAnB,CAEA,GAAMC,CAAAA,IAA0B,CAAG,CACjCC,KAAK,CAAEH,IAAI,CAACG,KADqB,CAEjCC,WAAW,CAAEJ,IAAI,CAACI,WAFe,CAGjCC,UAAU,CAAEL,IAAI,CAACK,UAHgB,CAIjCC,QAA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e,UAJd,CAlBhB,CAwBE,aAAa,kBACPd,aADO,OACPA,aADO,CACU,EADV,CAxBf,CA2BE,aAAa,CAAE0B,cA3BjB,EA6BMzB,KA7BN,gFADF,CAiCD,CA3HqB,CAAjB,C","sourcesContent":["import type { CardFormView } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFormNative =\n requireNativeComponent<CardFormView.NativeProps>('CardForm');\n\n/**\n * Card Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n autofocus?: boolean;\n testID?: string;\n\n /** All styles except backgroundColor, cursorColor, borderColor, and borderRadius are Android only */\n cardStyle?: CardFormView.Styles;\n // isUserInteractionEnabled?: boolean;\n\n // TODO: will make it public when iOS SDK allows for this\n // postalCodeEnabled?: boolean;\n\n /** Android only */\n placeholders?: CardFormView.Placeholders;\n /** Android only */\n defaultValues?: CardFormView.DefaultValues;\n // onBlur?(): void;\n // onFocus?(focusedField: CardFormView.FieldNames | null): void;\n onFormComplete?(card: CardFormView.Details): void;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onFormComplete` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Form Component\n *\n * @example\n * ```ts\n * <CardForm\n * onFormComplete={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 200}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardForm = forwardRef<CardFormView.Methods, Props>(\n (\n {\n onFormComplete,\n cardStyle,\n // isUserInteractionEnabled = true,\n // postalCodeEnabled = true,\n // onFocus,\n // onBlur,\n placeholders,\n defaultValues,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onFormCompleteHandler = useCallback(\n (event: NativeSyntheticEvent<CardFormView.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFormView.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n country: card.country,\n postalCode: card.postalCode,\n };\n\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onFormComplete && card.complete) {\n console.warn(\n `[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`\n );\n }\n }\n onFormComplete?.(data);\n },\n [onFormComplete]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n }));\n\n const onFocusHandler = useCallback((event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n // onFocus?.(focusedField);\n } else {\n // onBlur?.();\n }\n }, []);\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFormNative\n ref={inputRef}\n onFormComplete={onFormCompleteHandler}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n // disabledBackgroundColor: cardStyle?.disabledBackgroundColor,\n // type: cardStyle?.type,\n }}\n // isUserInteractionEnabledValue={isUserInteractionEnabled}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n defaultValues={{\n ...(defaultValues ?? {}),\n }}\n onFocusChange={onFocusHandler}\n // postalCodeEnabled={postalCodeEnabled}\n {...props}\n />\n );\n }\n);\n"]}
1
+ {"version":3,"sources":["CardForm.tsx"],"names":["CardFormNative","CardForm","ref","onFormComplete","cardStyle","placeholders","defaultValues","props","inputRef","onFormCompleteHandler","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","country","postalCode","hasOwnProperty","number","cvc","__DEV__","console","warn","focus","UIManager","dispatchViewManagerCommand","current","blur","onFocusHandler","focusedField","inputRefValue","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"mappings":"oWACA,qDAOA,yCASA,mC,grCAOA,GAAMA,CAAAA,cAAc,CAClB,wCAAiD,UAAjD,CADF,CAmDO,GAAMC,CAAAA,QAAQ,CAAG,sBACtB,cAYEC,GAZF,CAaK,IAXDC,CAAAA,cAWC,MAXDA,cAWC,CAVDC,SAUC,MAVDA,SAUC,CALDC,YAKC,MALDA,YAKC,CAJDC,aAIC,MAJDA,aAIC,CAHEC,KAGF,uDACH,GAAMC,CAAAA,QAAQ,CAAG,kBAAY,IAAZ,CA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UTC,UAAU,CAAExC,SAAF,cAAEA,SAAS,CAAEwC,UAVd,CAHb,CAkBE,YAAY,CAAE,CACZtB,MAAM,CAAEjB,YAAF,cAAEA,YAAY,CAAEiB,MADV,CAEZuB,UAAU,CAAExC,YAAF,cAAEA,YAAY,CAAEwC,UAFd,CAGZtB,GAAG,CAAElB,YAAF,cAAEA,YAAY,CAAEkB,GAHP,CAIZH,UAAU,CAAEf,YAAF,cAAEA,YAAY,CAAEe,UAJd,CAlBhB,CAwBE,aAAa,kBACPd,aADO,OACPA,aADO,CACU,EADV,CAxBf,CA2BE,aAAa,CAAE0B,cA3BjB,EA6BMzB,KA7BN,gFADF,CAiCD,CA3HqB,CAAjB,C","sourcesContent":["import type { CardFormView } from '../types';\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport {\n AccessibilityProps,\n NativeSyntheticEvent,\n requireNativeComponent,\n UIManager,\n StyleProp,\n findNodeHandle,\n ViewStyle,\n} from 'react-native';\nimport {\n currentlyFocusedInput,\n focusInput,\n registerInput,\n unregisterInput,\n} from '../helpers';\n\nconst CardFormNative =\n requireNativeComponent<CardFormView.NativeProps>('CardForm');\n\n/**\n * Card Form Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n autofocus?: boolean;\n testID?: string;\n\n /** All styles except backgroundColor, cursorColor, borderColor, and borderRadius are Android only */\n cardStyle?: CardFormView.Styles;\n // isUserInteractionEnabled?: boolean;\n\n // TODO: will make it public when iOS SDK allows for this\n // postalCodeEnabled?: boolean;\n\n /** Android only */\n placeholders?: CardFormView.Placeholders;\n /** Android only */\n defaultValues?: CardFormView.DefaultValues;\n // onBlur?(): void;\n // onFocus?(focusedField: CardFormView.FieldNames | null): void;\n onFormComplete?(card: CardFormView.Details): void;\n /**\n * WARNING: If set to `true` the full card number will be returned in the `onFormComplete` handler.\n * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.\n * Make sure that you're not mistakenly logging or storing full card details!\n * See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance\n */\n dangerouslyGetFullCardDetails?: boolean;\n}\n\n/**\n * Card Form Component\n *\n * @example\n * ```ts\n * <CardForm\n * onFormComplete={(cardDetails) => {\n * console.log('card details', cardDetails);\n * setCard(cardDetails);\n * }}\n * style={{height: 200}}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport const CardForm = forwardRef<CardFormView.Methods, Props>(\n (\n {\n onFormComplete,\n cardStyle,\n // isUserInteractionEnabled = true,\n // postalCodeEnabled = true,\n // onFocus,\n // onBlur,\n placeholders,\n defaultValues,\n ...props\n },\n ref\n ) => {\n const inputRef = useRef<any>(null);\n\n const onFormCompleteHandler = useCallback(\n (event: NativeSyntheticEvent<CardFormView.Details>) => {\n const card = event.nativeEvent;\n\n const data: CardFormView.Details = {\n last4: card.last4,\n expiryMonth: card.expiryMonth,\n expiryYear: card.expiryYear,\n complete: card.complete,\n brand: card.brand,\n country: card.country,\n postalCode: card.postalCode,\n };\n\n if (card.hasOwnProperty('number') || card.hasOwnProperty('cvc')) {\n data.number = card.number || '';\n data.cvc = card.cvc || '';\n if (__DEV__ && onFormComplete && card.complete) {\n console.warn(\n `[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`\n );\n }\n }\n onFormComplete?.(data);\n },\n [onFormComplete]\n );\n\n const focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'focus' as any,\n []\n );\n };\n\n const blur = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(inputRef.current),\n 'blur' as any,\n []\n );\n };\n\n useImperativeHandle(ref, () => ({\n focus,\n blur,\n }));\n\n const onFocusHandler = useCallback((event) => {\n const { focusedField } = event.nativeEvent;\n if (focusedField) {\n focusInput(inputRef.current);\n // onFocus?.(focusedField);\n } else {\n // onBlur?.();\n }\n }, []);\n\n useLayoutEffect(() => {\n const inputRefValue = inputRef.current;\n if (inputRefValue !== null) {\n registerInput(inputRefValue);\n return () => {\n unregisterInput(inputRefValue);\n if (currentlyFocusedInput() === inputRefValue) {\n inputRefValue.blur();\n }\n };\n }\n return () => {};\n }, [inputRef]);\n\n return (\n <CardFormNative\n ref={inputRef}\n onFormComplete={onFormCompleteHandler}\n cardStyle={{\n backgroundColor: cardStyle?.backgroundColor,\n borderColor: cardStyle?.borderColor,\n borderWidth: cardStyle?.borderWidth,\n borderRadius: cardStyle?.borderRadius,\n cursorColor: cardStyle?.cursorColor,\n fontSize: cardStyle?.fontSize,\n placeholderColor: cardStyle?.placeholderColor,\n textColor: cardStyle?.textColor,\n textErrorColor: cardStyle?.textErrorColor,\n fontFamily: cardStyle?.fontFamily,\n // disabledBackgroundColor: cardStyle?.disabledBackgroundColor,\n // type: cardStyle?.type,\n }}\n // isUserInteractionEnabledValue={isUserInteractionEnabled}\n placeholders={{\n number: placeholders?.number,\n expiration: placeholders?.expiration,\n cvc: placeholders?.cvc,\n postalCode: placeholders?.postalCode,\n }}\n defaultValues={{\n ...(defaultValues ?? {}),\n }}\n onFocusChange={onFocusHandler}\n // postalCodeEnabled={postalCodeEnabled}\n {...props}\n />\n );\n }\n);\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.GooglePayButton=GooglePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/GooglePayButton.tsx";var _excluded=["type","onPress","disabled"];var GooglePayButtonNative=(0,_reactNative.requireNativeComponent)('GooglePayButton');function GooglePayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?'pay':_ref$type,onPress=_ref.onPress,disabled=_ref.disabled,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:1,onPress:onPress,style:disabled?styles.disabled:{},__self:this,__source:{fileName:_jsxFileName,lineNumber:51,columnNumber:5}},_react.default.createElement(GooglePayButtonNative,(0,_extends2.default)({buttonType:type},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:57,columnNumber:7}})));}var styles=_reactNative.StyleSheet.create({disabled:{opacity:0.3}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.GooglePayButton=GooglePayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/GooglePayButton.tsx";var _excluded=["type","onPress","disabled"];var GooglePayButtonNative=(0,_reactNative.requireNativeComponent)('GooglePayButton');function GooglePayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?'pay':_ref$type,onPress=_ref.onPress,disabled=_ref.disabled,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:1,onPress:onPress,style:disabled?styles.disabled:{},__self:this,__source:{fileName:_jsxFileName,lineNumber:51,columnNumber:5}},_react.default.createElement(GooglePayButtonNative,(0,_extends2.default)({buttonType:type},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:57,columnNumber:7}})));}var styles=_reactNative.StyleSheet.create({disabled:{opacity:0.3}});
2
2
  //# sourceMappingURL=GooglePayButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["GooglePayButton.tsx"],"names":["GooglePayButtonNative","GooglePayButton","type","onPress","disabled","props","styles","StyleSheet","create","opacity"],"mappings":"oXAAA,oDACA,yC,8IASA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAiCO,QAASC,CAAAA,eAAT,MAKG,oBAJRC,IAIQ,CAJRA,IAIQ,oBAJD,KAIC,WAHRC,OAGQ,MAHRA,OAGQ,CAFRC,QAEQ,MAFRA,QAEQ,CADLC,KACK,uDACR,MACE,8BAAC,6BAAD,EACE,QAAQ,CAAED,QADZ,CAEE,aAAa,CAAE,CAFjB,CAGE,OAAO,CAAED,OAHX,CAIE,KAAK,CAAEC,QAAQ,CAAGE,MAAM,CAACF,QAAV,CAAqB,EAJtC,4EAME,6BAAC,qBAAD,wBAAuB,UAAU,CAAEF,IAAnC,EAA6CG,KAA7C,8EANF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGC,wBAAWC,MAAX,CAAkB,CAC/BJ,QAAQ,CAAE,CACRK,OAAO,CAAE,GADD,CADqB,CAAlB,CAAf","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n TouchableOpacity,\n StyleSheet,\n} from 'react-native';\n\nconst GooglePayButtonNative = requireNativeComponent<any>('GooglePayButton');\n\n/**\n * Google Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?:\n | 'pay'\n | 'pay_shadow'\n | 'standard'\n | 'standard_shadow'\n | 'pay_dark'\n | 'standard_dark';\n onPress(): void;\n disabled?: boolean;\n testID?: string;\n}\n\n/**\n * Google Pay Button Component\n *\n * @example\n * ```ts\n * <GooglePayButton\n * onPress={pay}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function GooglePayButton({\n type = 'pay',\n onPress,\n disabled,\n ...props\n}: Props) {\n return (\n <TouchableOpacity\n disabled={disabled}\n activeOpacity={1}\n onPress={onPress}\n style={disabled ? styles.disabled : {}}\n >\n <GooglePayButtonNative buttonType={type} {...props} />\n </TouchableOpacity>\n );\n}\n\nconst styles = StyleSheet.create({\n disabled: {\n opacity: 0.3,\n },\n});\n"]}
1
+ {"version":3,"sources":["GooglePayButton.tsx"],"names":["GooglePayButtonNative","GooglePayButton","type","onPress","disabled","props","styles","StyleSheet","create","opacity"],"mappings":"oXAAA,oDACA,yC,kJASA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAiCO,QAASC,CAAAA,eAAT,MAKG,oBAJRC,IAIQ,CAJRA,IAIQ,oBAJD,KAIC,WAHRC,OAGQ,MAHRA,OAGQ,CAFRC,QAEQ,MAFRA,QAEQ,CADLC,KACK,uDACR,MACE,8BAAC,6BAAD,EACE,QAAQ,CAAED,QADZ,CAEE,aAAa,CAAE,CAFjB,CAGE,OAAO,CAAED,OAHX,CAIE,KAAK,CAAEC,QAAQ,CAAGE,MAAM,CAACF,QAAV,CAAqB,EAJtC,4EAME,6BAAC,qBAAD,wBAAuB,UAAU,CAAEF,IAAnC,EAA6CG,KAA7C,8EANF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGC,wBAAWC,MAAX,CAAkB,CAC/BJ,QAAQ,CAAE,CACRK,OAAO,CAAE,GADD,CADqB,CAAlB,CAAf","sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n requireNativeComponent,\n TouchableOpacity,\n StyleSheet,\n} from 'react-native';\n\nconst GooglePayButtonNative = requireNativeComponent<any>('GooglePayButton');\n\n/**\n * Google Pay Button Component Props\n */\nexport interface Props extends AccessibilityProps {\n style?: StyleProp<ViewStyle>;\n type?:\n | 'pay'\n | 'pay_shadow'\n | 'standard'\n | 'standard_shadow'\n | 'pay_dark'\n | 'standard_dark';\n onPress(): void;\n disabled?: boolean;\n testID?: string;\n}\n\n/**\n * Google Pay Button Component\n *\n * @example\n * ```ts\n * <GooglePayButton\n * onPress={pay}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function GooglePayButton({\n type = 'pay',\n onPress,\n disabled,\n ...props\n}: Props) {\n return (\n <TouchableOpacity\n disabled={disabled}\n activeOpacity={1}\n onPress={onPress}\n style={disabled ? styles.disabled : {}}\n >\n <GooglePayButtonNative buttonType={type} {...props} />\n </TouchableOpacity>\n );\n}\n\nconst styles = StyleSheet.create({\n disabled: {\n opacity: 0.3,\n },\n});\n"]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StripeContainer=StripeContainer;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/ianjabour/stripe/stripe-react-native/src/components/StripeContainer.tsx";var StripeContainerNative=(0,_reactNative.requireNativeComponent)('StripeContainer');function StripeContainer(_ref){var keyboardShouldPersistTaps=_ref.keyboardShouldPersistTaps,children=_ref.children;return _react.default.createElement(StripeContainerNative,{keyboardShouldPersistTaps:keyboardShouldPersistTaps,style:styles.container,__self:this,__source:{fileName:_jsxFileName,lineNumber:34,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:styles.container,accessible:false,__self:this,__source:{fileName:_jsxFileName,lineNumber:38,columnNumber:7}},children));}var styles=_reactNative.StyleSheet.create({container:{flex:1}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StripeContainer=StripeContainer;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/StripeContainer.tsx";var StripeContainerNative=(0,_reactNative.requireNativeComponent)('StripeContainer');function StripeContainer(_ref){var keyboardShouldPersistTaps=_ref.keyboardShouldPersistTaps,children=_ref.children;return _react.default.createElement(StripeContainerNative,{keyboardShouldPersistTaps:keyboardShouldPersistTaps,style:styles.container,__self:this,__source:{fileName:_jsxFileName,lineNumber:34,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:styles.container,accessible:false,__self:this,__source:{fileName:_jsxFileName,lineNumber:38,columnNumber:7}},children));}var styles=_reactNative.StyleSheet.create({container:{flex:1}});
2
2
  //# sourceMappingURL=StripeContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["StripeContainer.tsx"],"names":["StripeContainerNative","StripeContainer","keyboardShouldPersistTaps","children","styles","container","StyleSheet","create","flex"],"mappings":"oLAAA,oDAEA,yC,kGAQA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAkBO,QAASC,CAAAA,eAAT,MAGG,IAFRC,CAAAA,yBAEQ,MAFRA,yBAEQ,CADRC,QACQ,MADRA,QACQ,CACR,MACE,8BAAC,qBAAD,EACE,yBAAyB,CAAED,yBAD7B,CAEE,KAAK,CAAEE,MAAM,CAACC,SAFhB,4EAIE,6BAAC,iBAAD,EAAM,KAAK,CAAED,MAAM,CAACC,SAApB,CAA+B,UAAU,CAAE,KAA3C,4EACGF,QADH,CAJF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGE,wBAAWC,MAAX,CAAkB,CAC/BF,SAAS,CAAE,CACTG,IAAI,CAAE,CADG,CADoB,CAAlB,CAAf","sourcesContent":["import React from 'react';\n\nimport {\n requireNativeComponent,\n StyleProp,\n StyleSheet,\n ViewStyle,\n View,\n} from 'react-native';\n\nconst StripeContainerNative = requireNativeComponent<any>('StripeContainer');\n\n/**\n * Stripe Container Component Props\n */\nexport interface Props {\n children: React.ReactElement | React.ReactElement[];\n keyboardShouldPersistTaps?: boolean;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * StripeContainer Component\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function StripeContainer({\n keyboardShouldPersistTaps,\n children,\n}: Props) {\n return (\n <StripeContainerNative\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n style={styles.container}\n >\n <View style={styles.container} accessible={false}>\n {children}\n </View>\n </StripeContainerNative>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
1
+ {"version":3,"sources":["StripeContainer.tsx"],"names":["StripeContainerNative","StripeContainer","keyboardShouldPersistTaps","children","styles","container","StyleSheet","create","flex"],"mappings":"oLAAA,oDAEA,yC,sGAQA,GAAMA,CAAAA,qBAAqB,CAAG,wCAA4B,iBAA5B,CAA9B,CAkBO,QAASC,CAAAA,eAAT,MAGG,IAFRC,CAAAA,yBAEQ,MAFRA,yBAEQ,CADRC,QACQ,MADRA,QACQ,CACR,MACE,8BAAC,qBAAD,EACE,yBAAyB,CAAED,yBAD7B,CAEE,KAAK,CAAEE,MAAM,CAACC,SAFhB,4EAIE,6BAAC,iBAAD,EAAM,KAAK,CAAED,MAAM,CAACC,SAApB,CAA+B,UAAU,CAAE,KAA3C,4EACGF,QADH,CAJF,CADF,CAUD,CAED,GAAMC,CAAAA,MAAM,CAAGE,wBAAWC,MAAX,CAAkB,CAC/BF,SAAS,CAAE,CACTG,IAAI,CAAE,CADG,CADoB,CAAlB,CAAf","sourcesContent":["import React from 'react';\n\nimport {\n requireNativeComponent,\n StyleProp,\n StyleSheet,\n ViewStyle,\n View,\n} from 'react-native';\n\nconst StripeContainerNative = requireNativeComponent<any>('StripeContainer');\n\n/**\n * Stripe Container Component Props\n */\nexport interface Props {\n children: React.ReactElement | React.ReactElement[];\n keyboardShouldPersistTaps?: boolean;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * StripeContainer Component\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function StripeContainer({\n keyboardShouldPersistTaps,\n children,\n}: Props) {\n return (\n <StripeContainerNative\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n style={styles.container}\n >\n <View style={styles.container} accessible={false}>\n {children}\n </View>\n </StripeContainerNative>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-react-native",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "author": "Stripe",
5
5
  "description": "Stripe SDK for React Native",
6
6
  "main": "lib/commonjs/index",