@stripe/stripe-react-native 0.45.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/README.md +0 -3
  3. package/android/.gradle/8.11.1/checksums/checksums.lock +0 -0
  4. package/android/.gradle/8.11.1/checksums/md5-checksums.bin +0 -0
  5. package/android/.gradle/8.11.1/checksums/sha1-checksums.bin +0 -0
  6. package/android/.gradle/8.11.1/executionHistory/executionHistory.bin +0 -0
  7. package/android/.gradle/8.11.1/executionHistory/executionHistory.lock +0 -0
  8. package/android/.gradle/8.11.1/fileChanges/last-build.bin +0 -0
  9. package/android/.gradle/8.11.1/fileHashes/fileHashes.bin +0 -0
  10. package/android/.gradle/8.11.1/fileHashes/fileHashes.lock +0 -0
  11. package/android/.gradle/8.11.1/gc.properties +0 -0
  12. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  13. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  14. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  15. package/android/.gradle/config.properties +2 -0
  16. package/android/.gradle/file-system.probe +0 -0
  17. package/android/.gradle/vcs-1/gc.properties +0 -0
  18. package/android/.idea/caches/deviceStreaming.xml +619 -0
  19. package/android/.idea/compiler.xml +6 -0
  20. package/android/.idea/gradle.xml +19 -0
  21. package/android/.idea/migrations.xml +10 -0
  22. package/android/.idea/misc.xml +10 -0
  23. package/android/.idea/runConfigurations.xml +17 -0
  24. package/android/.idea/vcs.xml +6 -0
  25. package/android/build.gradle +1 -0
  26. package/android/local.properties +8 -0
  27. package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +31 -34
  28. package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +52 -10
  29. package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +15 -8
  30. package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +3 -21
  31. package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherFragment.kt +3 -17
  32. package/android/src/main/java/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt +20 -6
  33. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +63 -44
  34. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +17 -20
  35. package/android/src/main/java/com/reactnativestripesdk/StripeAbstractComposeView.kt +113 -0
  36. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +74 -6
  37. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressLauncherFragment.kt +3 -17
  38. package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt +3 -21
  39. package/android/src/main/java/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt +2 -2
  40. package/android/src/main/java/com/reactnativestripesdk/utils/StripeFragment.kt +52 -0
  41. package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +1 -2
  42. package/ios/EmbeddedPaymentElementView.swift +3 -2
  43. package/ios/NewArch/EmbeddedPaymentElementViewComponentView.h +10 -0
  44. package/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm +81 -0
  45. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  46. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  47. package/lib/commonjs/components/AddressSheet.js +1 -1
  48. package/lib/commonjs/components/AddressSheet.js.map +1 -1
  49. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  50. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  51. package/lib/commonjs/components/CardField.js +1 -1
  52. package/lib/commonjs/components/CardField.js.map +1 -1
  53. package/lib/commonjs/components/CardForm.js +1 -1
  54. package/lib/commonjs/components/CardForm.js.map +1 -1
  55. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  56. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  57. package/lib/commonjs/components/StripeContainer.js +1 -1
  58. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  59. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
  60. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  61. package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
  62. package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
  63. package/lib/module/components/AddToWalletButton.js +1 -1
  64. package/lib/module/components/AddToWalletButton.js.map +1 -1
  65. package/lib/module/components/AddressSheet.js +1 -1
  66. package/lib/module/components/AddressSheet.js.map +1 -1
  67. package/lib/module/components/AuBECSDebitForm.js +1 -1
  68. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  69. package/lib/module/components/CardField.js +1 -1
  70. package/lib/module/components/CardField.js.map +1 -1
  71. package/lib/module/components/CardForm.js +1 -1
  72. package/lib/module/components/CardForm.js.map +1 -1
  73. package/lib/module/components/PlatformPayButton.js +1 -1
  74. package/lib/module/components/PlatformPayButton.js.map +1 -1
  75. package/lib/module/components/StripeContainer.js +1 -1
  76. package/lib/module/components/StripeContainer.js.map +1 -1
  77. package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
  78. package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  79. package/lib/module/types/EmbeddedPaymentElement.js +1 -1
  80. package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
  81. package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts +0 -5
  82. package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts.map +1 -1
  83. package/package.json +3 -2
  84. package/src/specs/NativeEmbeddedPaymentElement.ts +1 -10
  85. package/src/types/EmbeddedPaymentElement.tsx +2 -2
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.__INTERNAL_VIEW_CONFIG=exports.Commands=void 0;var _codegenNativeComponent=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));var _codegenNativeCommands=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));var NativeComponentRegistry=require('react-native/Libraries/NativeComponent/NativeComponentRegistry');var _require=require('react-native/Libraries/NativeComponent/ViewConfigIgnore'),ConditionallyIgnoredEventHandlers=_require.ConditionallyIgnoredEventHandlers;var _require2=require("react-native/Libraries/ReactNative/RendererProxy"),dispatchCommand=_require2.dispatchCommand;var nativeComponentName='EmbeddedPaymentElementView';var __INTERNAL_VIEW_CONFIG=exports.__INTERNAL_VIEW_CONFIG={uiViewClassName:'EmbeddedPaymentElementView',directEventTypes:{topEmbeddedPaymentElementDidUpdateHeight:{registrationName:'onEmbeddedPaymentElementDidUpdateHeight'}},validAttributes:Object.assign({configuration:true,intentConfiguration:true},ConditionallyIgnoredEventHandlers({onEmbeddedPaymentElementDidUpdateHeight:true}))};var _default=exports.default=NativeComponentRegistry.get(nativeComponentName,function(){return __INTERNAL_VIEW_CONFIG;});var Commands=exports.Commands={confirm:function confirm(ref){dispatchCommand(ref,"confirm",[]);},clearPaymentOption:function clearPaymentOption(ref){dispatchCommand(ref,"clearPaymentOption",[]);}};
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.__INTERNAL_VIEW_CONFIG=exports.Commands=void 0;var _codegenNativeCommands=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));var _codegenNativeComponent=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));var NativeComponentRegistry=require('react-native/Libraries/NativeComponent/NativeComponentRegistry');var _require=require("react-native/Libraries/ReactNative/RendererProxy"),dispatchCommand=_require.dispatchCommand;var nativeComponentName='EmbeddedPaymentElementView';var __INTERNAL_VIEW_CONFIG=exports.__INTERNAL_VIEW_CONFIG={uiViewClassName:'EmbeddedPaymentElementView',validAttributes:{configuration:true,intentConfiguration:true}};var _default=exports.default=NativeComponentRegistry.get(nativeComponentName,function(){return __INTERNAL_VIEW_CONFIG;});var Commands=exports.Commands={confirm:function confirm(ref){dispatchCommand(ref,"confirm",[]);},clearPaymentOption:function clearPaymentOption(ref){dispatchCommand(ref,"clearPaymentOption",[]);}};
2
2
  //# sourceMappingURL=NativeEmbeddedPaymentElement.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","_codegenNativeCommands","NativeComponentRegistry","_require","ConditionallyIgnoredEventHandlers","_require2","dispatchCommand","nativeComponentName","__INTERNAL_VIEW_CONFIG","exports","uiViewClassName","directEventTypes","topEmbeddedPaymentElementDidUpdateHeight","registrationName","validAttributes","Object","assign","configuration","intentConfiguration","onEmbeddedPaymentElementDidUpdateHeight","_default","default","get","Commands","confirm","ref","clearPaymentOption"],"sourceRoot":"../../../src","sources":["specs/NativeEmbeddedPaymentElement.ts"],"mappings":"mNAKA,IAAAA,uBAAA,CAAAC,sBAAA,CAAAC,OAAA,6DAIA,IAAAC,sBAAA,CAAAF,sBAAA,CAAAC,OAAA,4DAyBA,IAAAE,uBAEmB,CAFnBF,OAEmB,CAFnB,gEAEkB,CAAC,CAFnB,IAAAG,QAAA,CAAAH,OAEmB,CAFnB,yDAEkB,CAAC,CAFnBI,iCAEmB,CAAAD,QAAA,CAFnBC,iCAEmB,CAFnB,IAAAC,SAAA,CAAAL,OAEmB,CAFnB,kDAEkB,CAAC,CAFnBM,eAEmB,CAAAD,SAAA,CAFnBC,eAEmB,CAFnB,IAAAC,mBAEmB,CAFnB,4BAEmB,CAFnB,IAAAC,sBAEmB,CAAAC,OAAA,CAAAD,sBAAA,CAFnB,CAAAE,eAEmB,CAFnB,4BAEmB,CAFnBC,gBAEmB,CAFnB,CAAAC,wCAEmB,CAFnB,CAAAC,gBAEmB,CAFnB,yCAEkB,EAAC,CAFnBC,eAEmB,CAAAC,MAAA,CAAAC,MAAA,EAFnBC,aAEmB,CAFnB,IAEmB,CAFnBC,mBAEmB,CAFnB,IAEmB,EAFnBd,iCAEmB,CAFnB,CAAAe,uCAEmB,CAFnB,IAEkB,EAAC,CAAD,CAAC,KAAAC,QAAA,CAAAX,OAAA,CAAAY,OAAA,CAFnBnB,uBAEmB,CAFnBoB,GAEmB,CAFnBf,mBAEmB,CAFnB,kBAAAC,sBAEmB,EAAD,CAAC,CAFnB,IAAAe,QAEmB,CAAAd,OAAA,CAAAc,QAAA,CAFnB,CAAAC,OAEmB,SAFnB,CAAAA,OAEmBA,CAFnBC,GAEmB,CAFnB,CAAAnB,eAEmB,CAFnBmB,GAEmB,CAFnB,SAEmB,CAFnB,EAEkB,CAAC,CAAD,CAAC,CAFnBC,kBAEmB,SAFnB,CAAAA,kBAEmBA,CAFnBD,GAEmB,CAFnB,CAAAnB,eAEmB,CAFnBmB,GAEmB,CAFnB,oBAEmB,CAFnB,EAEkB,CAAC,CAAD,EAAC","ignoreList":[]}
1
+ {"version":3,"names":["_codegenNativeCommands","_interopRequireDefault","require","_codegenNativeComponent","NativeComponentRegistry","_require","dispatchCommand","nativeComponentName","__INTERNAL_VIEW_CONFIG","exports","uiViewClassName","validAttributes","configuration","intentConfiguration","_default","default","get","Commands","confirm","ref","clearPaymentOption"],"sourceRoot":"../../../src","sources":["specs/NativeEmbeddedPaymentElement.ts"],"mappings":"mNACA,IAAAA,sBAAA,CAAAC,sBAAA,CAAAC,OAAA,4DACA,IAAAC,uBAAA,CAAAF,sBAAA,CAAAC,OAAA,6DAuBA,IAAAE,uBAEmB,CAFnBF,OAEmB,CAFnB,gEAEkB,CAAC,CAFnB,IAAAG,QAAA,CAAAH,OAEmB,CAFnB,kDAEkB,CAAC,CAFnBI,eAEmB,CAAAD,QAAA,CAFnBC,eAEmB,CAFnB,IAAAC,mBAEmB,CAFnB,4BAEmB,CAFnB,IAAAC,sBAEmB,CAAAC,OAAA,CAAAD,sBAAA,CAFnB,CAAAE,eAEmB,CAFnB,4BAEmB,CAFnBC,eAEmB,CAFnB,CAAAC,aAEmB,CAFnB,IAEmB,CAFnBC,mBAEmB,CAFnB,IAEkB,EAAC,KAAAC,QAAA,CAAAL,OAAA,CAAAM,OAAA,CAFnBX,uBAEmB,CAFnBY,GAEmB,CAFnBT,mBAEmB,CAFnB,kBAAAC,sBAEmB,EAAD,CAAC,CAFnB,IAAAS,QAEmB,CAAAR,OAAA,CAAAQ,QAAA,CAFnB,CAAAC,OAEmB,SAFnB,CAAAA,OAEmBA,CAFnBC,GAEmB,CAFnB,CAAAb,eAEmB,CAFnBa,GAEmB,CAFnB,SAEmB,CAFnB,EAEkB,CAAC,CAAD,CAAC,CAFnBC,kBAEmB,SAFnB,CAAAA,kBAEmBA,CAFnBD,GAEmB,CAFnB,CAAAb,eAEmB,CAFnBa,GAEmB,CAFnB,oBAEmB,CAFnB,EAEkB,CAAC,CAAD,EAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useEmbeddedPaymentElement=useEmbeddedPaymentElement;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _reactNative=require("react-native");var _NativeStripeSdkModule=_interopRequireDefault(require("../specs/NativeStripeSdkModule"));var _react=_interopRequireWildcard(require("react"));var _events=require("../events");var _NativeEmbeddedPaymentElement=_interopRequireWildcard(require("../specs/NativeEmbeddedPaymentElement"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/davidestes/stripe/stripe-react-native/src/types/EmbeddedPaymentElement.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var EmbeddedPaymentElement=function(){function EmbeddedPaymentElement(){(0,_classCallCheck2.default)(this,EmbeddedPaymentElement);}return(0,_createClass2.default)(EmbeddedPaymentElement,[{key:"update",value:(function(){var _update=(0,_asyncToGenerator2.default)(function*(intentConfig){var result=yield _NativeStripeSdkModule.default.updateEmbeddedPaymentElement(intentConfig);return result;});function update(_x){return _update.apply(this,arguments);}return update;}())},{key:"confirm",value:(function(){var _confirm=(0,_asyncToGenerator2.default)(function*(){var result=yield _NativeStripeSdkModule.default.confirmEmbeddedPaymentElement(-1);return result;});function confirm(){return _confirm.apply(this,arguments);}return confirm;}())},{key:"clearPaymentOption",value:function clearPaymentOption(){_NativeStripeSdkModule.default.clearEmbeddedPaymentOption(-1);}}]);}();var confirmHandlerCallback=null;var formSheetActionConfirmCallback=null;function createEmbeddedPaymentElement(_x2,_x3){return _createEmbeddedPaymentElement.apply(this,arguments);}function _createEmbeddedPaymentElement(){_createEmbeddedPaymentElement=(0,_asyncToGenerator2.default)(function*(intentConfig,configuration){setupConfirmHandlers(intentConfig,configuration);yield _NativeStripeSdkModule.default.createEmbeddedPaymentElement(intentConfig,configuration);return new EmbeddedPaymentElement();});return _createEmbeddedPaymentElement.apply(this,arguments);}function setupConfirmHandlers(intentConfig,configuration){var _configuration$formSh;var confirmHandler=intentConfig.confirmHandler;if(confirmHandler){var _confirmHandlerCallba;(_confirmHandlerCallba=confirmHandlerCallback)==null||_confirmHandlerCallba.remove();confirmHandlerCallback=(0,_events.addListener)('onConfirmHandlerCallback',function(_ref){var paymentMethod=_ref.paymentMethod,shouldSavePaymentMethod=_ref.shouldSavePaymentMethod;confirmHandler(paymentMethod,shouldSavePaymentMethod,_NativeStripeSdkModule.default.intentCreationCallback);});}if(((_configuration$formSh=configuration.formSheetAction)==null?void 0:_configuration$formSh.type)==='confirm'){var confirmFormSheetHandler=configuration.formSheetAction.onFormSheetConfirmComplete;if(confirmFormSheetHandler){var _formSheetActionConfi;(_formSheetActionConfi=formSheetActionConfirmCallback)==null||_formSheetActionConfi.remove();formSheetActionConfirmCallback=(0,_events.addListener)('embeddedPaymentElementFormSheetConfirmComplete',function(result){confirmFormSheetHandler(result);});}}}function useEmbeddedPaymentElement(intentConfig,configuration){var _this=this;var isAndroid=_reactNative.Platform.OS==='android';var elementRef=(0,_react.useRef)(null);var _useState=(0,_react.useState)(null),_useState2=(0,_slicedToArray2.default)(_useState,2),element=_useState2[0],setElement=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),paymentOption=_useState4[0],setPaymentOption=_useState4[1];var _useState5=(0,_react.useState)(),_useState6=(0,_slicedToArray2.default)(_useState5,2),height=_useState6[0],setHeight=_useState6[1];var viewRef=(0,_react.useRef)(null);var _useState7=(0,_react.useState)(null),_useState8=(0,_slicedToArray2.default)(_useState7,2),loadingError=_useState8[0],setLoadingError=_useState8[1];function getElementOrThrow(ref){if(!ref.current){throw new Error('EmbeddedPaymentElement is not ready yet – wait until it finishes loading before calling this API.');}return ref.current;}(0,_react.useEffect)(function(){var active=true;(0,_asyncToGenerator2.default)(function*(){var el=yield createEmbeddedPaymentElement(intentConfig,configuration);if(!active)return;elementRef.current=el;setElement(el);})();var getCurrentRef=function getCurrentRef(){return viewRef.current;};return function(){var _elementRef$current;active=false;(_elementRef$current=elementRef.current)==null||_elementRef$current.clearPaymentOption();elementRef.current=null;var currentRef=getCurrentRef();if(isAndroid&&currentRef){_NativeEmbeddedPaymentElement.Commands.clearPaymentOption(currentRef);}setElement(null);};},[intentConfig,configuration,viewRef,isAndroid]);(0,_react.useEffect)(function(){var sub=(0,_events.addListener)('embeddedPaymentElementDidUpdatePaymentOption',function(_ref3){var opt=_ref3.paymentOption;return setPaymentOption(opt!=null?opt:null);});return function(){return sub.remove();};});(0,_react.useEffect)(function(){var sub=(0,_events.addListener)('embeddedPaymentElementDidUpdateHeight',function(_ref4){var h=_ref4.height;if(h>0){_reactNative.LayoutAnimation.configureNext(_reactNative.LayoutAnimation.Presets.easeInEaseOut);setHeight(h);}});return function(){return sub.remove();};},[]);(0,_react.useEffect)(function(){var sub=(0,_events.addListener)('embeddedPaymentElementLoadingFailed',function(nativeError){setLoadingError(new Error(nativeError.message));});return function(){return sub.remove();};},[]);var embeddedPaymentElementView=(0,_react.useMemo)(function(){if(isAndroid&&configuration&&intentConfig){return(0,_jsxRuntime.jsx)(_NativeEmbeddedPaymentElement.default,{ref:viewRef,style:[{width:'100%',height:height}],configuration:configuration,intentConfiguration:intentConfig});}if(!element)return null;return(0,_jsxRuntime.jsx)(_NativeEmbeddedPaymentElement.default,{ref:viewRef,style:{width:'100%',height:height},configuration:configuration,intentConfiguration:intentConfig});},[configuration,element,height,intentConfig,isAndroid]);var confirm=(0,_react.useCallback)(function(){var currentRef=viewRef.current;if(isAndroid){if(currentRef){var promise=new Promise(function(resolve){var sub=(0,_events.addListener)('embeddedPaymentElementFormSheetConfirmComplete',function(result){sub.remove();resolve(result);});});_NativeEmbeddedPaymentElement.Commands.confirm(currentRef);return promise;}else{return Promise.reject(new Error('Unable to find Android embedded payment element view!'));}}return getElementOrThrow(elementRef).confirm();},[isAndroid]);var update=(0,_react.useCallback)(function(cfg){return getElementOrThrow(elementRef).update(cfg);},[]);var clearPaymentOption=(0,_react.useCallback)(function(){if(isAndroid){var tag=(0,_reactNative.findNodeHandle)(viewRef.current);if(tag==null){return Promise.reject(new Error('Unable to find Android view handle'));}return _NativeStripeSdkModule.default.clearEmbeddedPaymentOption(tag);}getElementOrThrow(elementRef).clearPaymentOption();return Promise.resolve();},[isAndroid]);return{embeddedPaymentElementView:embeddedPaymentElementView,paymentOption:paymentOption,confirm:confirm,update:update,clearPaymentOption:clearPaymentOption,loadingError:loadingError};}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useEmbeddedPaymentElement=useEmbeddedPaymentElement;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _reactNative=require("react-native");var _NativeStripeSdkModule=_interopRequireDefault(require("../specs/NativeStripeSdkModule"));var _react=_interopRequireWildcard(require("react"));var _events=require("../events");var _NativeEmbeddedPaymentElement=_interopRequireWildcard(require("../specs/NativeEmbeddedPaymentElement"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/porter/stripe/stripe-react-native/src/types/EmbeddedPaymentElement.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var EmbeddedPaymentElement=function(){function EmbeddedPaymentElement(){(0,_classCallCheck2.default)(this,EmbeddedPaymentElement);}return(0,_createClass2.default)(EmbeddedPaymentElement,[{key:"update",value:(function(){var _update=(0,_asyncToGenerator2.default)(function*(intentConfig){var result=yield _NativeStripeSdkModule.default.updateEmbeddedPaymentElement(intentConfig);return result;});function update(_x){return _update.apply(this,arguments);}return update;}())},{key:"confirm",value:(function(){var _confirm=(0,_asyncToGenerator2.default)(function*(){var result=yield _NativeStripeSdkModule.default.confirmEmbeddedPaymentElement(-1);return result;});function confirm(){return _confirm.apply(this,arguments);}return confirm;}())},{key:"clearPaymentOption",value:function clearPaymentOption(){_NativeStripeSdkModule.default.clearEmbeddedPaymentOption(-1);}}]);}();var confirmHandlerCallback=null;var formSheetActionConfirmCallback=null;function createEmbeddedPaymentElement(_x2,_x3){return _createEmbeddedPaymentElement.apply(this,arguments);}function _createEmbeddedPaymentElement(){_createEmbeddedPaymentElement=(0,_asyncToGenerator2.default)(function*(intentConfig,configuration){setupConfirmHandlers(intentConfig,configuration);yield _NativeStripeSdkModule.default.createEmbeddedPaymentElement(intentConfig,configuration);return new EmbeddedPaymentElement();});return _createEmbeddedPaymentElement.apply(this,arguments);}function setupConfirmHandlers(intentConfig,configuration){var _configuration$formSh;var confirmHandler=intentConfig.confirmHandler;if(confirmHandler){var _confirmHandlerCallba;(_confirmHandlerCallba=confirmHandlerCallback)==null||_confirmHandlerCallba.remove();confirmHandlerCallback=(0,_events.addListener)('onConfirmHandlerCallback',function(_ref){var paymentMethod=_ref.paymentMethod,shouldSavePaymentMethod=_ref.shouldSavePaymentMethod;confirmHandler(paymentMethod,shouldSavePaymentMethod,_NativeStripeSdkModule.default.intentCreationCallback);});}if(((_configuration$formSh=configuration.formSheetAction)==null?void 0:_configuration$formSh.type)==='confirm'){var confirmFormSheetHandler=configuration.formSheetAction.onFormSheetConfirmComplete;if(confirmFormSheetHandler){var _formSheetActionConfi;(_formSheetActionConfi=formSheetActionConfirmCallback)==null||_formSheetActionConfi.remove();formSheetActionConfirmCallback=(0,_events.addListener)('embeddedPaymentElementFormSheetConfirmComplete',function(result){confirmFormSheetHandler(result);});}}}function useEmbeddedPaymentElement(intentConfig,configuration){var _this=this;var isAndroid=_reactNative.Platform.OS==='android';var elementRef=(0,_react.useRef)(null);var _useState=(0,_react.useState)(null),_useState2=(0,_slicedToArray2.default)(_useState,2),element=_useState2[0],setElement=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),paymentOption=_useState4[0],setPaymentOption=_useState4[1];var _useState5=(0,_react.useState)(),_useState6=(0,_slicedToArray2.default)(_useState5,2),height=_useState6[0],setHeight=_useState6[1];var viewRef=(0,_react.useRef)(null);var _useState7=(0,_react.useState)(null),_useState8=(0,_slicedToArray2.default)(_useState7,2),loadingError=_useState8[0],setLoadingError=_useState8[1];function getElementOrThrow(ref){if(!ref.current){throw new Error('EmbeddedPaymentElement is not ready yet – wait until it finishes loading before calling this API.');}return ref.current;}(0,_react.useEffect)(function(){var active=true;(0,_asyncToGenerator2.default)(function*(){var el=yield createEmbeddedPaymentElement(intentConfig,configuration);if(!active)return;elementRef.current=el;setElement(el);})();var getCurrentRef=function getCurrentRef(){return viewRef.current;};return function(){var _elementRef$current;active=false;(_elementRef$current=elementRef.current)==null||_elementRef$current.clearPaymentOption();elementRef.current=null;var currentRef=getCurrentRef();if(isAndroid&&currentRef){_NativeEmbeddedPaymentElement.Commands.clearPaymentOption(currentRef);}setElement(null);};},[intentConfig,configuration,viewRef,isAndroid]);(0,_react.useEffect)(function(){var sub=(0,_events.addListener)('embeddedPaymentElementDidUpdatePaymentOption',function(_ref3){var opt=_ref3.paymentOption;return setPaymentOption(opt!=null?opt:null);});return function(){return sub.remove();};});(0,_react.useEffect)(function(){var sub=(0,_events.addListener)('embeddedPaymentElementDidUpdateHeight',function(_ref4){var h=_ref4.height;if(h>0||isAndroid&&h===0){_reactNative.LayoutAnimation.configureNext(_reactNative.LayoutAnimation.Presets.easeInEaseOut);setHeight(h);}});return function(){return sub.remove();};},[isAndroid]);(0,_react.useEffect)(function(){var sub=(0,_events.addListener)('embeddedPaymentElementLoadingFailed',function(nativeError){setLoadingError(new Error(nativeError.message));});return function(){return sub.remove();};},[]);var embeddedPaymentElementView=(0,_react.useMemo)(function(){if(isAndroid&&configuration&&intentConfig){return(0,_jsxRuntime.jsx)(_NativeEmbeddedPaymentElement.default,{ref:viewRef,style:[{width:'100%',height:height}],configuration:configuration,intentConfiguration:intentConfig});}if(!element)return null;return(0,_jsxRuntime.jsx)(_NativeEmbeddedPaymentElement.default,{ref:viewRef,style:{width:'100%',height:height},configuration:configuration,intentConfiguration:intentConfig});},[configuration,element,height,intentConfig,isAndroid]);var confirm=(0,_react.useCallback)(function(){var currentRef=viewRef.current;if(isAndroid){if(currentRef){var promise=new Promise(function(resolve){var sub=(0,_events.addListener)('embeddedPaymentElementFormSheetConfirmComplete',function(result){sub.remove();resolve(result);});});_NativeEmbeddedPaymentElement.Commands.confirm(currentRef);return promise;}else{return Promise.reject(new Error('Unable to find Android embedded payment element view!'));}}return getElementOrThrow(elementRef).confirm();},[isAndroid]);var update=(0,_react.useCallback)(function(cfg){return getElementOrThrow(elementRef).update(cfg);},[]);var clearPaymentOption=(0,_react.useCallback)(function(){if(isAndroid){var tag=(0,_reactNative.findNodeHandle)(viewRef.current);if(tag==null){return Promise.reject(new Error('Unable to find Android view handle'));}return _NativeStripeSdkModule.default.clearEmbeddedPaymentOption(tag);}getElementOrThrow(elementRef).clearPaymentOption();return Promise.resolve();},[isAndroid]);return{embeddedPaymentElementView:embeddedPaymentElementView,paymentOption:paymentOption,confirm:confirm,update:update,clearPaymentOption:clearPaymentOption,loadingError:loadingError};}
2
2
  //# sourceMappingURL=EmbeddedPaymentElement.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_NativeStripeSdkModule","_interopRequireDefault","_react","_interopRequireWildcard","_events","_NativeEmbeddedPaymentElement","_jsxRuntime","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","EmbeddedPaymentElement","_classCallCheck2","_createClass2","key","value","_update","_asyncToGenerator2","intentConfig","result","NativeStripeSdkModule","updateEmbeddedPaymentElement","update","_x","apply","arguments","_confirm","confirmEmbeddedPaymentElement","confirm","clearPaymentOption","clearEmbeddedPaymentOption","confirmHandlerCallback","formSheetActionConfirmCallback","createEmbeddedPaymentElement","_x2","_x3","_createEmbeddedPaymentElement","configuration","setupConfirmHandlers","_configuration$formSh","confirmHandler","_confirmHandlerCallba","remove","addListener","_ref","paymentMethod","shouldSavePaymentMethod","intentCreationCallback","formSheetAction","type","confirmFormSheetHandler","onFormSheetConfirmComplete","_formSheetActionConfi","useEmbeddedPaymentElement","_this","isAndroid","Platform","OS","elementRef","useRef","_useState","useState","_useState2","_slicedToArray2","element","setElement","_useState3","_useState4","paymentOption","setPaymentOption","_useState5","_useState6","height","setHeight","viewRef","_useState7","_useState8","loadingError","setLoadingError","getElementOrThrow","ref","current","Error","useEffect","active","el","getCurrentRef","_elementRef$current","currentRef","Commands","sub","_ref3","opt","_ref4","h","LayoutAnimation","configureNext","Presets","easeInEaseOut","nativeError","message","embeddedPaymentElementView","useMemo","jsx","style","width","intentConfiguration","useCallback","promise","Promise","resolve","reject","cfg","tag","findNodeHandle"],"sourceRoot":"../../../src","sources":["types/EmbeddedPaymentElement.tsx"],"mappings":"4jBACA,IAAAA,YAAA,CAAAC,OAAA,iBAeA,IAAAC,sBAAA,CAAAC,sBAAA,CAAAF,OAAA,oCACA,IAAAG,MAAA,CAAAC,uBAAA,CAAAJ,OAAA,WAUA,IAAAK,OAAA,CAAAL,OAAA,cACA,IAAAM,6BAAA,CAAAF,uBAAA,CAAAJ,OAAA,2CAG+C,IAAAO,WAAA,CAAAP,OAAA,0BAAAQ,YAAA,8FAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG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N,MAAM,CAANA,MAAM,CACNO,kBAAkB,CAAlBA,kBAAkB,CAClBgD,YAAY,CAAZA,YACF,CAAC,CACH","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_NativeStripeSdkModule","_interopRequireDefault","_react","_interopRequireWildcard","_events","_NativeEmbeddedPaymentElement","_jsxRuntime","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","EmbeddedPaymentElement","_classCallCheck2","_createClass2","key","value","_update","_asyncToGenerator2","intentConfig","result","NativeStripeSdkModule","updateEmbeddedPaymentElement","update","_x","apply","arguments","_confirm","confirmEmbeddedPaymentElement","confirm","clearPaymentOption","clearEmbeddedPaymentOption","confirmHandlerCallback","formSheetActionConfirmCallback","createEmbeddedPaymentElement","_x2","_x3","_createEmbeddedPaymentElement","configuration","setupConfirmHandlers","_configuration$formSh","confirmHandler","_confirmHandlerCallba","remove","addListener","_ref","paymentMethod","shouldSavePaymentMethod","intentCreationCallback","formSheetAction","type","confirmFormSheetHandler","onFormSheetConfirmComplete","_formSheetActionConfi","useEmbeddedPaymentElement","_this","isAndroid","Platform","OS","elementRef","useRef","_useState","useState","_useState2","_slicedToArray2","element","setElement","_useState3","_useState4","paymentOption","setPaymentOption","_useState5","_useState6","height","setHeight","viewRef","_useState7","_useState8","loadingError","setLoadingError","getElementOrThrow","ref","current","Error","useEffect","active","el","getCurrentRef","_elementRef$current","currentRef","Commands","sub","_ref3","opt","_ref4","h","LayoutAnimation","configureNext","Presets","easeInEaseOut","nativeError","message","embeddedPaymentElementView","useMemo","jsx","style","width","intentConfiguration","useCallback","promise","Promise","resolve","reject","cfg","tag","findNodeHandle"],"sourceRoot":"../../../src","sources":["types/EmbeddedPaymentElement.tsx"],"mappings":"4jBACA,IAAAA,YAAA,CAAAC,OAAA,iBAeA,IAAAC,sBAAA,CAAAC,sBAAA,CAAAF,OAAA,oCACA,IAAA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AAK,CAAC,oCAAoC,CAAC,CAAC,CACxE,CACA,MAAO,CAAA9D,8BAAqB,CAACU,0BAA0B,CAACmF,GAAG,CAAC,CAC9D,CAGAlC,iBAAiB,CAACrB,UAAU,CAAC,CAAC7B,kBAAkB,CAAC,CAAC,CAClD,MAAO,CAAAgF,OAAO,CAACC,OAAO,CAAC,CAAC,CAC1B,CAAC,CAAE,CAACvD,SAAS,CAAC,CAAC,CAEf,MAAO,CACL8C,0BAA0B,CAA1BA,0BAA0B,CAC1BjC,aAAa,CAAbA,aAAa,CACbxC,OAAO,CAAPA,OAAO,CACPN,MAAM,CAANA,MAAM,CACNO,kBAAkB,CAAlBA,kBAAkB,CAClBgD,YAAY,CAAZA,YACF,CAAC,CACH","ignoreList":[]}
@@ -1,15 +1,10 @@
1
1
  import type { HostComponent, ViewProps } from 'react-native';
2
- import type { DirectEventHandler, Double } from 'react-native/Libraries/Types/CodegenTypes';
3
2
  import { EmbeddedPaymentElementConfiguration } from '../types/EmbeddedPaymentElement';
4
3
  import { IntentConfiguration } from '../types/PaymentSheet';
5
4
  import type { UnsafeMixed } from './utils';
6
- type OnEmbeddedPaymentElementDidUpdateHeightEvent = Readonly<{
7
- height: Double;
8
- }>;
9
5
  export interface NativeProps extends ViewProps {
10
6
  configuration: UnsafeMixed<EmbeddedPaymentElementConfiguration>;
11
7
  intentConfiguration: UnsafeMixed<IntentConfiguration>;
12
- onEmbeddedPaymentElementDidUpdateHeight?: DirectEventHandler<OnEmbeddedPaymentElementDidUpdateHeightEvent>;
13
8
  }
14
9
  export interface NativeCommands {
15
10
  confirm: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeEmbeddedPaymentElement.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeEmbeddedPaymentElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,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,WAAW,WAAY,SAAQ,SAAS;IAC5C,aAAa,EAAE,WAAW,CAAC,mCAAmC,CAAC,CAAC;IAChE,mBAAmB,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC;IACzE,kBAAkB,EAAE,CAClB,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,KAClD,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,EAAE,cAErB,CAAC;AAEH,KAAK,aAAa,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;wBAI3C,aAAa;AAFlB,wBAEmB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-react-native",
3
- "version": "0.45.0",
3
+ "version": "0.46.0",
4
4
  "author": "Stripe",
5
5
  "description": "Stripe SDK for React Native",
6
6
  "main": "lib/commonjs/index",
@@ -21,7 +21,7 @@
21
21
  "bootstrap-no-pods": "yarn example && yarn",
22
22
  "docs": "yarn typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --readme none --sort source-order",
23
23
  "run-example-ios": "cd example && yarn ios --simulator \"iPhone 16\"",
24
- "run-example-ios:release": "cd example && yarn build:ios && yarn ios --mode Release --simulator \"iPhone 16\" --no-packager",
24
+ "run-example-ios:release": "cd example && yarn build:ios && yarn ios --mode Release --simulator \"iPhone 16 (18.2)\" --no-packager",
25
25
  "run-example-android": "cd example && yarn android",
26
26
  "run-example-android:release": "cd example && yarn build:android && yarn android --mode=release --no-packager",
27
27
  "test:e2e:ios": "bash ./scripts/run-maestro-tests ios",
@@ -153,6 +153,7 @@
153
153
  "AuBECSDebitForm": "AuBECSDebitFormComponentView",
154
154
  "CardField": "CardFieldComponentView",
155
155
  "CardForm": "CardFormComponentView",
156
+ "EmbeddedPaymentElementView": "EmbeddedPaymentElementViewComponentView",
156
157
  "StripeContainer": "StripeContainerComponentView"
157
158
  }
158
159
  },
@@ -1,22 +1,13 @@
1
1
  import type { HostComponent, ViewProps } from 'react-native';
2
- import type {
3
- DirectEventHandler,
4
- Double,
5
- } from 'react-native/Libraries/Types/CodegenTypes';
2
+ import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
6
3
  import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
4
  import { EmbeddedPaymentElementConfiguration } from '../types/EmbeddedPaymentElement';
8
5
  import { IntentConfiguration } from '../types/PaymentSheet';
9
6
  import type { UnsafeMixed } from './utils';
10
- import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
11
-
12
- type OnEmbeddedPaymentElementDidUpdateHeightEvent = Readonly<{
13
- height: Double;
14
- }>;
15
7
 
16
8
  export interface NativeProps extends ViewProps {
17
9
  configuration: UnsafeMixed<EmbeddedPaymentElementConfiguration>;
18
10
  intentConfiguration: UnsafeMixed<IntentConfiguration>;
19
- onEmbeddedPaymentElementDidUpdateHeight?: DirectEventHandler<OnEmbeddedPaymentElementDidUpdateHeightEvent>;
20
11
  }
21
12
 
22
13
  export interface NativeCommands {
@@ -365,14 +365,14 @@ export function useEmbeddedPaymentElement(
365
365
  'embeddedPaymentElementDidUpdateHeight',
366
366
  ({ height: h }) => {
367
367
  // ignore zero
368
- if (h > 0) {
368
+ if (h > 0 || (isAndroid && h === 0)) {
369
369
  LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
370
370
  setHeight(h);
371
371
  }
372
372
  }
373
373
  );
374
374
  return () => sub.remove();
375
- }, []);
375
+ }, [isAndroid]);
376
376
 
377
377
  // Listen for loading failures
378
378
  useEffect(() => {