react-native-payengine 2.0.6 → 2.0.9

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 (176) hide show
  1. package/README.md +27 -11
  2. package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
  3. package/android/.gradle/6.1.1/fileHashes/fileHashes.bin +0 -0
  4. package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  7. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  8. package/android/.gradle/checksums/checksums.lock +0 -0
  9. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  10. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  11. package/android/.gradle/config.properties +2 -0
  12. package/android/.idea/caches/deviceStreaming.xml +329 -0
  13. package/android/.idea/gradle.xml +2 -2
  14. package/android/.idea/jarRepositories.xml +5 -0
  15. package/android/.idea/kotlinc.xml +6 -0
  16. package/android/.idea/migrations.xml +10 -0
  17. package/android/.idea/misc.xml +2 -1
  18. package/android/build.gradle +2 -2
  19. package/android/local.properties +2 -2
  20. package/android/payment-sdk-debug-1.0.3.aar +0 -0
  21. package/android/payment-sdk-release-1.0.3.aar +0 -0
  22. package/android/src/main/java/com/reactnativepayengine/v2/features/googlepay/RNPEGooglePayButton.kt +27 -10
  23. package/android/src/main/java/com/reactnativepayengine/v2/features/googlepay/RNPEGooglePayButtonManager.kt +17 -7
  24. package/android/src/main/java/com/reactnativepayengine/v2/features/googlepay/RNPEPaymentRequest.kt +32 -0
  25. package/ios/PayEngineSDK.xcframework/Info.plist +5 -5
  26. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
  27. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +2 -2
  28. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Info.plist +0 -0
  29. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.abi.json +742 -851
  30. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +2 -14
  31. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface-e +2 -14
  32. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  33. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface +2 -14
  34. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface-e +2 -14
  35. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/PayEngineSDK +0 -0
  36. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
  37. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
  38. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
  39. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +4 -4
  40. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Info.plist +0 -0
  41. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +742 -851
  42. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +2 -14
  43. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface-e +2 -14
  44. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  45. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -14
  46. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface-e +2 -14
  47. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +742 -851
  48. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +2 -14
  49. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface-e +2 -14
  50. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  51. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +2 -14
  52. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface-e +2 -14
  53. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/PayEngineSDK +0 -0
  54. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
  55. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
  56. package/ios/Payengine.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +34 -0
  57. package/ios/Payengine.xcodeproj/project.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  58. package/ios/Payengine.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +24 -0
  59. package/ios/Payengine.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  60. package/ios/Pods/Pods.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcschemes/Pods-Payengine.xcscheme +58 -0
  61. package/ios/Pods/Pods.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcschemes/VGSCollectSDK-CardIcon.xcscheme +58 -0
  62. package/ios/Pods/Pods.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcschemes/VGSCollectSDK.xcscheme +58 -0
  63. package/ios/Pods/Pods.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcschemes/xcschememanagement.plist +32 -0
  64. package/ios/Sources/Classes/ApplePay/RNPEApplePayButton.swift +8 -7
  65. package/ios/Sources/Classes/ApplePay/RNPEApplePayPaymentRequest.swift +43 -4
  66. package/ios/Sources/Classes/RNPayEngineNative.swift +12 -10
  67. package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js +3 -1
  68. package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -1
  69. package/lib/commonjs/components/v2/GooglePay/PEGooglePayButton.js +6 -3
  70. package/lib/commonjs/components/v2/GooglePay/PEGooglePayButton.js.map +1 -1
  71. package/lib/commonjs/components/v2/PEPaymentRequest.js +71 -1
  72. package/lib/commonjs/components/v2/PEPaymentRequest.js.map +1 -1
  73. package/lib/commonjs/index.js +24 -0
  74. package/lib/commonjs/index.js.map +1 -1
  75. package/lib/module/components/v2/ApplePay/PEApplePayButton.js +3 -1
  76. package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -1
  77. package/lib/module/components/v2/GooglePay/PEGooglePayButton.js +6 -3
  78. package/lib/module/components/v2/GooglePay/PEGooglePayButton.js.map +1 -1
  79. package/lib/module/components/v2/PEPaymentRequest.js +58 -0
  80. package/lib/module/components/v2/PEPaymentRequest.js.map +1 -1
  81. package/lib/module/index.js +2 -2
  82. package/lib/module/index.js.map +1 -1
  83. package/lib/typescript/components/v2/PEPaymentRequest.d.ts +39 -1
  84. package/lib/typescript/index.d.ts +2 -2
  85. package/package.json +1 -1
  86. package/src/components/v2/ApplePay/PEApplePayButton.tsx +4 -1
  87. package/src/components/v2/GooglePay/PEGooglePayButton.tsx +9 -4
  88. package/src/components/v2/PEPaymentRequest.ts +65 -6
  89. package/src/index.tsx +6 -1
  90. package/android/.idea/libraries/Gradle__android_arch_core_common_1_0_0.xml +0 -11
  91. package/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_0_0.xml +0 -11
  92. package/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_0_0_aar.xml +0 -13
  93. package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0.xml +0 -13
  94. package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_0_2_aar.xml +0 -16
  95. package/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0.xml +0 -11
  96. package/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml +0 -13
  97. package/android/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml +0 -13
  98. package/android/.idea/libraries/Gradle__androidx_autofill_autofill_1_1_0_aar.xml +0 -16
  99. package/android/.idea/libraries/Gradle__androidx_collection_collection_1_0_0.xml +0 -11
  100. package/android/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml +0 -16
  101. package/android/.idea/libraries/Gradle__androidx_core_core_1_1_0_aar.xml +0 -16
  102. package/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +0 -13
  103. package/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +0 -13
  104. package/android/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml +0 -13
  105. package/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +0 -16
  106. package/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_0_0_aar.xml +0 -16
  107. package/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +0 -13
  108. package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml +0 -13
  109. package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml +0 -13
  110. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0.xml +0 -11
  111. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml +0 -13
  112. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml +0 -13
  113. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml +0 -13
  114. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml +0 -13
  115. package/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +0 -13
  116. package/android/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml +0 -13
  117. package/android/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml +0 -16
  118. package/android/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml +0 -13
  119. package/android/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml +0 -16
  120. package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_0_1_aar.xml +0 -13
  121. package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml +0 -13
  122. package/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml +0 -13
  123. package/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +0 -13
  124. package/android/.idea/libraries/Gradle__com_android_support_support_annotations_26_1_0.xml +0 -13
  125. package/android/.idea/libraries/Gradle__com_android_support_support_compat_26_1_0_aar.xml +0 -13
  126. package/android/.idea/libraries/Gradle__com_android_support_support_core_ui_26_1_0_aar.xml +0 -13
  127. package/android/.idea/libraries/Gradle__com_android_support_support_core_utils_26_1_0_aar.xml +0 -13
  128. package/android/.idea/libraries/Gradle__com_android_support_support_fragment_26_1_0_aar.xml +0 -13
  129. package/android/.idea/libraries/Gradle__com_android_support_support_media_compat_26_1_0_aar.xml +0 -13
  130. package/android/.idea/libraries/Gradle__com_android_support_support_v4_26_1_0_aar.xml +0 -13
  131. package/android/.idea/libraries/Gradle__com_facebook_fbjni_fbjni_java_only_0_2_2.xml +0 -13
  132. package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_2_5_0_aar.xml +0 -15
  133. package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_2_5_0_aar.xml +0 -18
  134. package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_2_5_0_aar.xml +0 -18
  135. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_2_5_0_aar.xml +0 -18
  136. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_base_2_5_0_aar.xml +0 -18
  137. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_native_2_5_0_aar.xml +0 -15
  138. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp3_2_5_0_aar.xml +0 -15
  139. package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_ashmem_2_5_0_aar.xml +0 -15
  140. package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_java_2_5_0_aar.xml +0 -15
  141. package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_native_2_5_0_aar.xml +0 -15
  142. package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagefilters_2_5_0_aar.xml +0 -15
  143. package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagetranscoder_2_5_0_aar.xml +0 -15
  144. package/android/.idea/libraries/Gradle__com_facebook_fresco_ui_common_2_5_0_aar.xml +0 -15
  145. package/android/.idea/libraries/Gradle__com_facebook_infer_annotation_infer_annotation_0_18_0.xml +0 -13
  146. package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_68_2_aar.xml +0 -16
  147. package/android/.idea/libraries/Gradle__com_facebook_soloader_annotation_0_10_3.xml +0 -13
  148. package/android/.idea/libraries/Gradle__com_facebook_soloader_nativeloader_0_10_3.xml +0 -13
  149. package/android/.idea/libraries/Gradle__com_facebook_soloader_soloader_0_10_3_aar.xml +0 -15
  150. package/android/.idea/libraries/Gradle__com_facebook_yoga_proguard_annotations_1_19_0.xml +0 -13
  151. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_base_15_0_1_aar.xml +0 -11
  152. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_basement_15_0_1_aar.xml +0 -11
  153. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_identity_15_0_1_aar.xml +0 -11
  154. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_maps_15_0_1_aar.xml +0 -11
  155. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_tasks_15_0_1_aar.xml +0 -11
  156. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_wallet_16_0_0_aar.xml +0 -11
  157. package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_2.xml +0 -13
  158. package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_4_9_2.xml +0 -13
  159. package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_urlconnection_4_9_2.xml +0 -13
  160. package/android/.idea/libraries/Gradle__com_squareup_okio_okio_2_9_0.xml +0 -13
  161. package/android/.idea/libraries/Gradle__javax_inject_javax_inject_1.xml +0 -13
  162. package/android/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml +0 -13
  163. package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_annotations_jvm_1_3_72.xml +0 -13
  164. package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_4_10.xml +0 -13
  165. package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_4_10.xml +0 -13
  166. package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_4_10.xml +0 -13
  167. package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk8_1_4_10.xml +0 -13
  168. package/android/.idea/modules/android.androidTest.iml +0 -114
  169. package/android/.idea/modules/android.iml +0 -40
  170. package/android/.idea/modules/android.main.iml +0 -122
  171. package/android/.idea/modules/android.unitTest.iml +0 -109
  172. package/android/.idea/modules.xml +0 -11
  173. package/android/payment-sdk-debug-1.0.2.aar +0 -0
  174. package/android/payment-sdk-release-1.0.2.aar +0 -0
  175. package/ios/Payengine.xcodeproj/project.xcworkspace/xcuserdata/trinvh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  176. /package/ios/Payengine.xcodeproj/xcuserdata/{trinvh.xcuserdatad → tringuyen.xcuserdatad}/xcschemes/xcschememanagement.plist +0 -0
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.PEPaymentRequest = void 0;
6
+ exports.RNPEGooglePayShippingAddressParameters = exports.RNPEGooglePayOptions = exports.RNPEGooglePayBillingAddressParameters = exports.RNPEContactField = exports.RNPEApplePayOptions = exports.PEPaymentRequest = void 0;
7
7
 
8
8
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
9
 
@@ -11,6 +11,7 @@ class PEPaymentRequest {
11
11
  constructor(merchantId, paymentAmount) {
12
12
  let currencyCode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'USD';
13
13
  let paymentItems = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
14
+ let platformOptions = arguments.length > 4 ? arguments[4] : undefined;
14
15
 
15
16
  _defineProperty(this, "merchantId", void 0);
16
17
 
@@ -20,13 +21,82 @@ class PEPaymentRequest {
20
21
 
21
22
  _defineProperty(this, "paymentItems", []);
22
23
 
24
+ _defineProperty(this, "platformOptions", void 0);
25
+
23
26
  this.merchantId = merchantId;
24
27
  this.paymentAmount = paymentAmount;
25
28
  this.currencyCode = currencyCode;
26
29
  this.paymentItems = paymentItems;
30
+ this.platformOptions = platformOptions;
27
31
  }
28
32
 
29
33
  }
30
34
 
31
35
  exports.PEPaymentRequest = PEPaymentRequest;
36
+ let RNPEContactField;
37
+ exports.RNPEContactField = RNPEContactField;
38
+
39
+ (function (RNPEContactField) {
40
+ RNPEContactField["name"] = "name";
41
+ RNPEContactField["postalAddress"] = "postalAddress";
42
+ RNPEContactField["emailAddress"] = "emailAddress";
43
+ RNPEContactField["phoneNumber"] = "phoneNumber";
44
+ RNPEContactField["phoneticName"] = "phoneticName";
45
+ })(RNPEContactField || (exports.RNPEContactField = RNPEContactField = {}));
46
+
47
+ class RNPEApplePayOptions {
48
+ constructor(params) {
49
+ _defineProperty(this, "requiredBillingContactFields", []);
50
+
51
+ _defineProperty(this, "requiredShippingContactFields", []);
52
+
53
+ this.requiredBillingContactFields = params.requiredBillingContactFields;
54
+ this.requiredShippingContactFields = params.requiredShippingContactFields;
55
+ }
56
+
57
+ }
58
+
59
+ exports.RNPEApplePayOptions = RNPEApplePayOptions;
60
+
61
+ class RNPEGooglePayBillingAddressParameters {
62
+ constructor() {
63
+ _defineProperty(this, "format", 'FULL');
64
+
65
+ _defineProperty(this, "phoneNumberRequired", false);
66
+ }
67
+
68
+ }
69
+
70
+ exports.RNPEGooglePayBillingAddressParameters = RNPEGooglePayBillingAddressParameters;
71
+
72
+ class RNPEGooglePayShippingAddressParameters {
73
+ constructor() {
74
+ _defineProperty(this, "allowedCountryCodes", undefined);
75
+
76
+ _defineProperty(this, "phoneNumberRequired", false);
77
+ }
78
+
79
+ }
80
+
81
+ exports.RNPEGooglePayShippingAddressParameters = RNPEGooglePayShippingAddressParameters;
82
+
83
+ class RNPEGooglePayOptions {
84
+ constructor(params) {
85
+ _defineProperty(this, "billingAddressRequired", void 0);
86
+
87
+ _defineProperty(this, "billingAddressParameters", void 0);
88
+
89
+ _defineProperty(this, "shippingAddressRequired", void 0);
90
+
91
+ _defineProperty(this, "shippingAddressParameters", void 0);
92
+
93
+ this.billingAddressRequired = params.billingAddressRequired;
94
+ this.billingAddressParameters = params.billingAddressParameters;
95
+ this.shippingAddressRequired = params.shippingAddressRequired;
96
+ this.shippingAddressParameters = params.shippingAddressParameters;
97
+ }
98
+
99
+ }
100
+
101
+ exports.RNPEGooglePayOptions = RNPEGooglePayOptions;
32
102
  //# sourceMappingURL=PEPaymentRequest.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PEPaymentRequest","constructor","merchantId","paymentAmount","currencyCode","paymentItems"],"sources":["PEPaymentRequest.ts"],"sourcesContent":["\nexport class PEPaymentRequest {\n merchantId: string;\n paymentAmount: number;\n currencyCode?: 'USD' | 'CAD' = 'USD';\n paymentItems?: {\n amount: number;\n label: string;\n }[] = []\n\n constructor(merchantId: string, paymentAmount: number, currencyCode: 'USD' | 'CAD' = 'USD', paymentItems: {\n amount: number;\n label: string;\n }[] = []) {\n this.merchantId = merchantId;\n this.paymentAmount = paymentAmount;\n this.currencyCode = currencyCode;\n this.paymentItems = paymentItems;\n }\n}"],"mappings":";;;;;;;;;AACO,MAAMA,gBAAN,CAAuB;EAS5BC,WAAW,CAACC,UAAD,EAAqBC,aAArB,EAGD;IAAA,IAH6CC,YAG7C,uEAH2E,KAG3E;IAAA,IAHkFC,YAGlF,uEAAJ,EAAI;;IAAA;;IAAA;;IAAA,sCATqB,KASrB;;IAAA,sCALJ,EAKI;;IACR,KAAKH,UAAL,GAAkBA,UAAlB;IACA,KAAKC,aAAL,GAAqBA,aAArB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,YAAL,GAAoBA,YAApB;EACD;;AAjB2B"}
1
+ {"version":3,"names":["PEPaymentRequest","constructor","merchantId","paymentAmount","currencyCode","paymentItems","platformOptions","RNPEContactField","RNPEApplePayOptions","params","requiredBillingContactFields","requiredShippingContactFields","RNPEGooglePayBillingAddressParameters","RNPEGooglePayShippingAddressParameters","undefined","RNPEGooglePayOptions","billingAddressRequired","billingAddressParameters","shippingAddressRequired","shippingAddressParameters"],"sources":["PEPaymentRequest.ts"],"sourcesContent":["type RNPEPaymentOptions = RNPEGooglePayOptions | RNPEApplePayOptions;\n\nexport class PEPaymentRequest {\n merchantId: string;\n paymentAmount: number;\n currencyCode?: 'USD' | 'CAD' = 'USD';\n paymentItems?: {\n amount: number;\n label: string;\n }[] = [];\n platformOptions?: RNPEPaymentOptions;\n\n constructor(\n merchantId: string,\n paymentAmount: number,\n currencyCode: 'USD' | 'CAD' = 'USD',\n paymentItems: {\n amount: number;\n label: string;\n }[] = [],\n platformOptions?: RNPEPaymentOptions\n ) {\n this.merchantId = merchantId;\n this.paymentAmount = paymentAmount;\n this.currencyCode = currencyCode;\n this.paymentItems = paymentItems;\n this.platformOptions = platformOptions;\n }\n}\n\nexport enum RNPEContactField {\n name = 'name',\n postalAddress = 'postalAddress',\n emailAddress = 'emailAddress',\n phoneNumber = 'phoneNumber',\n phoneticName = 'phoneticName',\n}\n\nexport class RNPEApplePayOptions {\n requiredBillingContactFields?: RNPEContactField[] = [];\n requiredShippingContactFields?: RNPEContactField[] = [];\n\n constructor(params: {\n requiredBillingContactFields: RNPEContactField[];\n requiredShippingContactFields: RNPEContactField[];\n }) {\n this.requiredBillingContactFields = params.requiredBillingContactFields;\n this.requiredShippingContactFields = params.requiredShippingContactFields;\n }\n}\n\nexport class RNPEGooglePayBillingAddressParameters {\n format: 'FULL' | 'MIN' = 'FULL'\n phoneNumberRequired: boolean = false\n}\n\nexport class RNPEGooglePayShippingAddressParameters {\n allowedCountryCodes?: string[] = undefined\n phoneNumberRequired: boolean = false\n}\n\nexport class RNPEGooglePayOptions {\n billingAddressRequired: boolean;\n billingAddressParameters?: any;\n shippingAddressRequired: boolean;\n shippingAddressParameters?: any;\n\n constructor(params: {\n billingAddressRequired: boolean;\n shippingAddressRequired: boolean;\n billingAddressParameters?: RNPEGooglePayBillingAddressParameters;\n shippingAddressParameters?: RNPEGooglePayShippingAddressParameters;\n }) {\n this.billingAddressRequired = params.billingAddressRequired;\n this.billingAddressParameters = params.billingAddressParameters;\n this.shippingAddressRequired = params.shippingAddressRequired;\n this.shippingAddressParameters = params.shippingAddressParameters;\n }\n}\n"],"mappings":";;;;;;;;;AAEO,MAAMA,gBAAN,CAAuB;EAU5BC,WAAW,CACTC,UADS,EAETC,aAFS,EAST;IAAA,IANAC,YAMA,uEAN8B,KAM9B;IAAA,IALAC,YAKA,uEAFM,EAEN;IAAA,IADAC,eACA;;IAAA;;IAAA;;IAAA,sCAhB6B,KAgB7B;;IAAA,sCAZI,EAYJ;;IAAA;;IACA,KAAKJ,UAAL,GAAkBA,UAAlB;IACA,KAAKC,aAAL,GAAqBA,aAArB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,eAAL,GAAuBA,eAAvB;EACD;;AAzB2B;;;IA4BlBC,gB;;;WAAAA,gB;EAAAA,gB;EAAAA,gB;EAAAA,gB;EAAAA,gB;EAAAA,gB;GAAAA,gB,gCAAAA,gB;;AAQL,MAAMC,mBAAN,CAA0B;EAI/BP,WAAW,CAACQ,MAAD,EAGR;IAAA,sDANiD,EAMjD;;IAAA,uDALkD,EAKlD;;IACD,KAAKC,4BAAL,GAAoCD,MAAM,CAACC,4BAA3C;IACA,KAAKC,6BAAL,GAAqCF,MAAM,CAACE,6BAA5C;EACD;;AAV8B;;;;AAa1B,MAAMC,qCAAN,CAA4C;EAAA;IAAA,gCACxB,MADwB;;IAAA,6CAElB,KAFkB;EAAA;;AAAA;;;;AAK5C,MAAMC,sCAAN,CAA6C;EAAA;IAAA,6CACjBC,SADiB;;IAAA,6CAEnB,KAFmB;EAAA;;AAAA;;;;AAK7C,MAAMC,oBAAN,CAA2B;EAMhCd,WAAW,CAACQ,MAAD,EAKR;IAAA;;IAAA;;IAAA;;IAAA;;IACD,KAAKO,sBAAL,GAA8BP,MAAM,CAACO,sBAArC;IACA,KAAKC,wBAAL,GAAgCR,MAAM,CAACQ,wBAAvC;IACA,KAAKC,uBAAL,GAA+BT,MAAM,CAACS,uBAAtC;IACA,KAAKC,yBAAL,GAAiCV,MAAM,CAACU,yBAAxC;EACD;;AAhB+B"}
@@ -70,6 +70,30 @@ Object.defineProperty(exports, "PayEngineProvider", {
70
70
  }
71
71
  });
72
72
  exports.PayEngineUtils = exports.PayEngineStatic = void 0;
73
+ Object.defineProperty(exports, "RNPEApplePayOptions", {
74
+ enumerable: true,
75
+ get: function () {
76
+ return _PEPaymentRequest.RNPEApplePayOptions;
77
+ }
78
+ });
79
+ Object.defineProperty(exports, "RNPEContactField", {
80
+ enumerable: true,
81
+ get: function () {
82
+ return _PEPaymentRequest.RNPEContactField;
83
+ }
84
+ });
85
+ Object.defineProperty(exports, "RNPEGooglePayBillingAddressParameters", {
86
+ enumerable: true,
87
+ get: function () {
88
+ return _PEPaymentRequest.RNPEGooglePayBillingAddressParameters;
89
+ }
90
+ });
91
+ Object.defineProperty(exports, "RNPEGooglePayShippingAddressParameters", {
92
+ enumerable: true,
93
+ get: function () {
94
+ return _PEPaymentRequest.RNPEGooglePayShippingAddressParameters;
95
+ }
96
+ });
73
97
 
74
98
  var _PayEngine = _interopRequireDefault(require("./components/PayEngine"));
75
99
 
@@ -1 +1 @@
1
- {"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","PayEngineStatic","NativeModules","Payengine","Proxy","get","Error"],"sources":["index.tsx"],"sourcesContent":["import PayEngine from './components/PayEngine';\nimport { NativeModules, Platform } from 'react-native';\nimport type { IPayEngineConfig } from './interfaces/index';\nimport {\n PECreditCardView,\n PECreditCardViewMethods,\n} from './components/v2/SecureFields/CreditCardView';\nimport {\n PEBankAccountView,\n PEBankAccountViewMethods,\n} from './components/v2/SecureFields/BankAccountView';\nimport type IPEField from './components/v2/SecureFields/IPEField';\nimport type PECard from './components/v2/SecureFields/PECard';\nimport type PEBankAccount from './components/v2/SecureFields/PEBankAccount';\nimport { PayEngineProvider } from './components/v2/PayEngineProvider';\nimport PayEngineNative from './components/v2/PayEngineNative';\nimport { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';\nimport { PEPaymentRequest } from './components/v2/PEPaymentRequest';\nimport { PEGooglePayButton } from './components/v2/GooglePay/PEGooglePayButton';\nimport * as PayEngineUtils from './utils/index';\nimport PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';\n\nconst LINKING_ERROR =\n `The package 'react-native-payengine' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst PayEngineStatic = NativeModules.Payengine\n ? NativeModules.Payengine\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport {\n PayEngineStatic,\n PayEngine,\n IPayEngineConfig,\n\n // v2 starting here\n PayEngineUtils,\n PayEngineProvider,\n PayEngineNative,\n // securefields\n PEKeyboardType,\n IPEField,\n // credit card\n PECreditCardView,\n PECreditCardViewMethods,\n PECard,\n // bank account\n PEBankAccountView,\n PEBankAccountViewMethods,\n PEBankAccount,\n // Apple Pay\n PEApplePayButton,\n PEPaymentRequest,\n PEGooglePayButton,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAIA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AACA;;;;;;;;AAEA,MAAMA,aAAa,GAChB,iFAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,eAAe,GAAGC,0BAAA,CAAcC,SAAd,GACpBD,0BAAA,CAAcC,SADM,GAEpB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUV,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ"}
1
+ {"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","PayEngineStatic","NativeModules","Payengine","Proxy","get","Error"],"sources":["index.tsx"],"sourcesContent":["import PayEngine from './components/PayEngine';\nimport { NativeModules, Platform } from 'react-native';\nimport type { IPayEngineConfig } from './interfaces/index';\nimport {\n PECreditCardView,\n PECreditCardViewMethods,\n} from './components/v2/SecureFields/CreditCardView';\nimport {\n PEBankAccountView,\n PEBankAccountViewMethods,\n} from './components/v2/SecureFields/BankAccountView';\nimport type IPEField from './components/v2/SecureFields/IPEField';\nimport type PECard from './components/v2/SecureFields/PECard';\nimport type PEBankAccount from './components/v2/SecureFields/PEBankAccount';\nimport { PayEngineProvider } from './components/v2/PayEngineProvider';\nimport PayEngineNative from './components/v2/PayEngineNative';\nimport { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';\nimport { PEPaymentRequest, RNPEApplePayOptions, RNPEContactField, RNPEGooglePayBillingAddressParameters, RNPEGooglePayShippingAddressParameters } from './components/v2/PEPaymentRequest';\nimport { PEGooglePayButton } from './components/v2/GooglePay/PEGooglePayButton';\nimport * as PayEngineUtils from './utils/index';\nimport PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';\n\nconst LINKING_ERROR =\n `The package 'react-native-payengine' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst PayEngineStatic = NativeModules.Payengine\n ? NativeModules.Payengine\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport {\n PayEngineStatic,\n PayEngine,\n IPayEngineConfig,\n\n // v2 starting here\n PayEngineUtils,\n PayEngineProvider,\n PayEngineNative,\n // securefields\n PEKeyboardType,\n IPEField,\n // credit card\n PECreditCardView,\n PECreditCardViewMethods,\n PECard,\n // bank account\n PEBankAccountView,\n PEBankAccountViewMethods,\n PEBankAccount,\n // Apple Pay\n PEApplePayButton,\n RNPEApplePayOptions, \n RNPEContactField,\n RNPEGooglePayBillingAddressParameters, \n RNPEGooglePayShippingAddressParameters,\n PEPaymentRequest,\n PEGooglePayButton,\n \n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAIA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AACA;;;;;;;;AAEA,MAAMA,aAAa,GAChB,iFAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,eAAe,GAAGC,0BAAA,CAAcC,SAAd,GACpBD,0BAAA,CAAcC,SADM,GAEpB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUV,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ"}
@@ -32,7 +32,9 @@ export const PEApplePayButton = /*#__PURE__*/React.forwardRef((props, ref) => {
32
32
  width: '100%',
33
33
  ...props.style
34
34
  },
35
- paymentRequest: JSON.stringify(props.paymentRequest),
35
+ paymentRequest: JSON.stringify({ ...props.paymentRequest,
36
+ ...props.paymentRequest.platformOptions
37
+ }),
36
38
  onPmError: pmError,
37
39
  onPmTokenDidReturn: pmTokenDidReturn,
38
40
  onPmSheetDidDismiss: pmSheetDidDismiss
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","requireNativeComponent","Text","RNPEApplePayButton","PEApplePayButton","forwardRef","props","ref","useImperativeHandle","pmError","event","onPaymentFailed","Error","nativeEvent","error","pmTokenDidReturn","onTokenDidReturn","token","pmSheetDidDismiss","onPaymentSheetDismissed","OS","height","width","style","JSON","stringify","paymentRequest"],"sources":["PEApplePayButton.tsx"],"sourcesContent":["\nimport * as React from 'react';\nimport { Platform, requireNativeComponent, Text, ViewProps } from 'react-native';\nimport type { PEPaymentRequest } from '../PEPaymentRequest';\n\n\nconst RNPEApplePayButton = requireNativeComponent<NativePEApplePayViewProps>('RNPEApplePayButton');\n\ntype NativePEApplePayEvent = {\n nativeEvent: {\n error?: string;\n token?: string\n };\n};\n\ninterface NativePEApplePayViewProps extends ViewProps {\n paymentRequest: string;\n onPmSheetDidDismiss: (event: NativePEApplePayEvent) => void;\n onPmTokenDidReturn: (event: NativePEApplePayEvent) => void;\n onPmError: (event: NativePEApplePayEvent) => void;\n}\n\nexport interface PEApplePayButtonProps extends ViewProps {\n paymentRequest: PEPaymentRequest;\n onTokenDidReturn?: (token: string) => void;\n onPaymentSheetDismissed?: () => void;\n onPaymentFailed?: (error: Error) => void;\n}\n\nexport interface PEApplePayButtonMethods {\n \n}\n\n\nexport const PEApplePayButton = React.forwardRef<\nPEApplePayButtonMethods,\n PEApplePayButtonProps\n>((props, ref) => {\n\n React.useImperativeHandle(ref, () => ({\n }));\n\n const pmError = (event: NativePEApplePayEvent) => {\n if (props.onPaymentFailed) {\n props.onPaymentFailed(new Error(event.nativeEvent.error));\n }\n };\n\n const pmTokenDidReturn = (event: NativePEApplePayEvent) => {\n if (props.onTokenDidReturn) {\n props.onTokenDidReturn(event.nativeEvent.token!);\n }\n };\n\n const pmSheetDidDismiss = () => {\n if (props.onPaymentSheetDismissed) {\n props.onPaymentSheetDismissed();\n }\n }\n\n if (Platform.OS !== 'ios') {\n return <Text>Apple Pay is not supported on this platform</Text>\n }\n \n return (\n <RNPEApplePayButton \n style={{ height: 32, width: '100%', ...(props.style as object) }} \n paymentRequest={JSON.stringify(props.paymentRequest)} \n onPmError={pmError} \n onPmTokenDidReturn={pmTokenDidReturn} \n onPmSheetDidDismiss={pmSheetDidDismiss} \n />\n );\n});\n"],"mappings":"AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,sBAAnB,EAA2CC,IAA3C,QAAkE,cAAlE;AAIA,MAAMC,kBAAkB,GAAGF,sBAAsB,CAA4B,oBAA5B,CAAjD;AA4BA,OAAO,MAAMG,gBAAgB,gBAAGL,KAAK,CAACM,UAAN,CAG9B,CAACC,KAAD,EAAQC,GAAR,KAAgB;EAEhBR,KAAK,CAACS,mBAAN,CAA0BD,GAA1B,EAA+B,OAAO,EAAP,CAA/B;;EAGA,MAAME,OAAO,GAAIC,KAAD,IAAkC;IAChD,IAAIJ,KAAK,CAACK,eAAV,EAA2B;MACzBL,KAAK,CAACK,eAAN,CAAsB,IAAIC,KAAJ,CAAUF,KAAK,CAACG,WAAN,CAAkBC,KAA5B,CAAtB;IACD;EACF,CAJD;;EAMA,MAAMC,gBAAgB,GAAIL,KAAD,IAAkC;IACzD,IAAIJ,KAAK,CAACU,gBAAV,EAA4B;MAC1BV,KAAK,CAACU,gBAAN,CAAuBN,KAAK,CAACG,WAAN,CAAkBI,KAAzC;IACD;EACF,CAJD;;EAMA,MAAMC,iBAAiB,GAAG,MAAM;IAC9B,IAAIZ,KAAK,CAACa,uBAAV,EAAmC;MACjCb,KAAK,CAACa,uBAAN;IACD;EACF,CAJD;;EAMA,IAAInB,QAAQ,CAACoB,EAAT,KAAgB,KAApB,EAA2B;IACzB,oBAAO,oBAAC,IAAD,sDAAP;EACD;;EAED,oBACE,oBAAC,kBAAD;IACE,KAAK,EAAE;MAAEC,MAAM,EAAE,EAAV;MAAcC,KAAK,EAAE,MAArB;MAA6B,GAAIhB,KAAK,CAACiB;IAAvC,CADT;IAEE,cAAc,EAAEC,IAAI,CAACC,SAAL,CAAenB,KAAK,CAACoB,cAArB,CAFlB;IAGE,SAAS,EAAEjB,OAHb;IAIE,kBAAkB,EAAEM,gBAJtB;IAKE,mBAAmB,EAAEG;EALvB,EADF;AASD,CAvC+B,CAAzB"}
1
+ {"version":3,"names":["React","Platform","requireNativeComponent","Text","RNPEApplePayButton","PEApplePayButton","forwardRef","props","ref","useImperativeHandle","pmError","event","onPaymentFailed","Error","nativeEvent","error","pmTokenDidReturn","onTokenDidReturn","token","pmSheetDidDismiss","onPaymentSheetDismissed","OS","height","width","style","JSON","stringify","paymentRequest","platformOptions"],"sources":["PEApplePayButton.tsx"],"sourcesContent":["\nimport * as React from 'react';\nimport { Platform, requireNativeComponent, Text, ViewProps } from 'react-native';\nimport type { PEPaymentRequest } from '../PEPaymentRequest';\n\n\nconst RNPEApplePayButton = requireNativeComponent<NativePEApplePayViewProps>('RNPEApplePayButton');\n\ntype NativePEApplePayEvent = {\n nativeEvent: {\n error?: string;\n token?: string\n };\n};\n\ninterface NativePEApplePayViewProps extends ViewProps {\n paymentRequest: string;\n onPmSheetDidDismiss: (event: NativePEApplePayEvent) => void;\n onPmTokenDidReturn: (event: NativePEApplePayEvent) => void;\n onPmError: (event: NativePEApplePayEvent) => void;\n}\n\nexport interface PEApplePayButtonProps extends ViewProps {\n paymentRequest: PEPaymentRequest;\n onTokenDidReturn?: (token: string) => void;\n onPaymentSheetDismissed?: () => void;\n onPaymentFailed?: (error: Error) => void;\n}\n\nexport interface PEApplePayButtonMethods {\n \n}\n\n\nexport const PEApplePayButton = React.forwardRef<\nPEApplePayButtonMethods,\n PEApplePayButtonProps\n>((props, ref) => {\n\n React.useImperativeHandle(ref, () => ({\n }));\n\n const pmError = (event: NativePEApplePayEvent) => {\n if (props.onPaymentFailed) {\n props.onPaymentFailed(new Error(event.nativeEvent.error));\n }\n };\n\n const pmTokenDidReturn = (event: NativePEApplePayEvent) => {\n if (props.onTokenDidReturn) {\n props.onTokenDidReturn(event.nativeEvent.token!);\n }\n };\n\n const pmSheetDidDismiss = () => {\n if (props.onPaymentSheetDismissed) {\n props.onPaymentSheetDismissed();\n }\n }\n\n if (Platform.OS !== 'ios') {\n return <Text>Apple Pay is not supported on this platform</Text>\n }\n \n return (\n <RNPEApplePayButton \n style={{ height: 32, width: '100%', ...(props.style as object) }} \n paymentRequest={JSON.stringify({\n ...props.paymentRequest,\n ...props.paymentRequest.platformOptions\n })} \n onPmError={pmError} \n onPmTokenDidReturn={pmTokenDidReturn} \n onPmSheetDidDismiss={pmSheetDidDismiss} \n />\n );\n});\n"],"mappings":"AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,sBAAnB,EAA2CC,IAA3C,QAAkE,cAAlE;AAIA,MAAMC,kBAAkB,GAAGF,sBAAsB,CAA4B,oBAA5B,CAAjD;AA4BA,OAAO,MAAMG,gBAAgB,gBAAGL,KAAK,CAACM,UAAN,CAG9B,CAACC,KAAD,EAAQC,GAAR,KAAgB;EAEhBR,KAAK,CAACS,mBAAN,CAA0BD,GAA1B,EAA+B,OAAO,EAAP,CAA/B;;EAGA,MAAME,OAAO,GAAIC,KAAD,IAAkC;IAChD,IAAIJ,KAAK,CAACK,eAAV,EAA2B;MACzBL,KAAK,CAACK,eAAN,CAAsB,IAAIC,KAAJ,CAAUF,KAAK,CAACG,WAAN,CAAkBC,KAA5B,CAAtB;IACD;EACF,CAJD;;EAMA,MAAMC,gBAAgB,GAAIL,KAAD,IAAkC;IACzD,IAAIJ,KAAK,CAACU,gBAAV,EAA4B;MAC1BV,KAAK,CAACU,gBAAN,CAAuBN,KAAK,CAACG,WAAN,CAAkBI,KAAzC;IACD;EACF,CAJD;;EAMA,MAAMC,iBAAiB,GAAG,MAAM;IAC9B,IAAIZ,KAAK,CAACa,uBAAV,EAAmC;MACjCb,KAAK,CAACa,uBAAN;IACD;EACF,CAJD;;EAMA,IAAInB,QAAQ,CAACoB,EAAT,KAAgB,KAApB,EAA2B;IACzB,oBAAO,oBAAC,IAAD,sDAAP;EACD;;EAED,oBACE,oBAAC,kBAAD;IACE,KAAK,EAAE;MAAEC,MAAM,EAAE,EAAV;MAAcC,KAAK,EAAE,MAArB;MAA6B,GAAIhB,KAAK,CAACiB;IAAvC,CADT;IAEE,cAAc,EAAEC,IAAI,CAACC,SAAL,CAAe,EAC7B,GAAGnB,KAAK,CAACoB,cADoB;MAE7B,GAAGpB,KAAK,CAACoB,cAAN,CAAqBC;IAFK,CAAf,CAFlB;IAME,SAAS,EAAElB,OANb;IAOE,kBAAkB,EAAEM,gBAPtB;IAQE,mBAAmB,EAAEG;EARvB,EADF;AAYD,CA1C+B,CAAzB"}
@@ -48,9 +48,12 @@ export const PEGooglePayButton = /*#__PURE__*/React.forwardRef((props, ref) => {
48
48
  height: 32,
49
49
  width: '100%',
50
50
  ...props.style
51
- },
52
- amount: props.paymentRequest.paymentAmount,
53
- merchantId: props.paymentRequest.merchantId
51
+ } // amount={props.paymentRequest.paymentAmount}
52
+ // merchantId={props.paymentRequest.merchantId}
53
+ ,
54
+ paymentRequest: JSON.stringify({ ...props.paymentRequest,
55
+ ...props.paymentRequest.platformOptions
56
+ })
54
57
  });
55
58
  });
56
59
  //# sourceMappingURL=PEGooglePayButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","NativeEventEmitter","NativeModules","Platform","requireNativeComponent","Text","RNPEEventEmitter","RNPEGooglePayButton","peEventEmitter","PEGooglePayButton","forwardRef","props","ref","useImperativeHandle","useEffect","listener1","addListener","args","token","console","log","onTokenDidReturn","listener2","error","onPaymentFailed","Error","listener3","onPaymentSheetDismissed","remove","OS","height","width","style","paymentRequest","paymentAmount","merchantId"],"sources":["PEGooglePayButton.tsx"],"sourcesContent":["\nimport * as React from 'react';\nimport { NativeEventEmitter, NativeModules, Platform, requireNativeComponent, Text, ViewProps } from 'react-native';\nimport type { PEPaymentRequest } from '../PEPaymentRequest';\n\nconst { RNPEEventEmitter } = NativeModules;\n\nconst RNPEGooglePayButton = requireNativeComponent<NativePEGooglePayViewProps>('RNPEGooglePayButton');\n\ninterface NativePEGooglePayViewProps extends ViewProps {\n amount: number;\n merchantId: string;\n}\n\nconst peEventEmitter = new NativeEventEmitter(RNPEEventEmitter);\n\nexport interface PEGooglePayButtonProps extends ViewProps {\n paymentRequest: PEPaymentRequest;\n onTokenDidReturn?: (token: string) => void;\n onPaymentSheetDismissed?: () => void;\n onPaymentFailed?: (error: Error) => void;\n}\n\nexport interface PEGooglePayButtonMethods {\n \n}\n\n\nexport const PEGooglePayButton = React.forwardRef<\n PEGooglePayButtonMethods,\n PEGooglePayButtonProps\n>((props, ref) => {\n\n React.useImperativeHandle(ref, () => ({\n }));\n\n React.useEffect(() => {\n const listener1 = peEventEmitter.addListener('onGooglePayRespond', args => {\n const { token } = args;\n console.log('ON token', token)\n props.onTokenDidReturn?.(token)\n });\n\n const listener2 = peEventEmitter.addListener('onGooglePayError', args => {\n const { error } = args;\n console.log('ON error', error)\n props.onPaymentFailed?.(new Error(error))\n });\n\n const listener3 = peEventEmitter.addListener('onGooglePayDismiss', () => {\n console.log('ON dismiss')\n props.onPaymentSheetDismissed?.()\n });\n\n return () => {\n listener1.remove();\n listener2.remove();\n listener3.remove();\n }\n }, []);\n\n if (Platform.OS !== 'android') {\n return <Text>Google Pay is not supported on this platform</Text>\n }\n \n return (\n <RNPEGooglePayButton \n style={{ height: 32, width: '100%', ...(props.style as object) }} \n amount={props.paymentRequest.paymentAmount}\n merchantId={props.paymentRequest.merchantId} \n />\n );\n});\n"],"mappings":"AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,kBAAT,EAA6BC,aAA7B,EAA4CC,QAA5C,EAAsDC,sBAAtD,EAA8EC,IAA9E,QAAqG,cAArG;AAGA,MAAM;EAAEC;AAAF,IAAuBJ,aAA7B;AAEA,MAAMK,mBAAmB,GAAGH,sBAAsB,CAA6B,qBAA7B,CAAlD;AAOA,MAAMI,cAAc,GAAG,IAAIP,kBAAJ,CAAuBK,gBAAvB,CAAvB;AAcA,OAAO,MAAMG,iBAAiB,gBAAGT,KAAK,CAACU,UAAN,CAG/B,CAACC,KAAD,EAAQC,GAAR,KAAgB;EAEhBZ,KAAK,CAACa,mBAAN,CAA0BD,GAA1B,EAA+B,OAAO,EAAP,CAA/B;EAGAZ,KAAK,CAACc,SAAN,CAAgB,MAAM;IACpB,MAAMC,SAAS,GAAGP,cAAc,CAACQ,WAAf,CAA2B,oBAA3B,EAAiDC,IAAI,IAAI;MAAA;;MACzE,MAAM;QAAEC;MAAF,IAAYD,IAAlB;MACAE,OAAO,CAACC,GAAR,CAAY,UAAZ,EAAwBF,KAAxB;MACA,yBAAAP,KAAK,CAACU,gBAAN,qFAAAV,KAAK,EAAoBO,KAApB,CAAL;IACD,CAJiB,CAAlB;IAMA,MAAMI,SAAS,GAAGd,cAAc,CAACQ,WAAf,CAA2B,kBAA3B,EAA+CC,IAAI,IAAI;MAAA;;MACvE,MAAM;QAAEM;MAAF,IAAYN,IAAlB;MACAE,OAAO,CAACC,GAAR,CAAY,UAAZ,EAAwBG,KAAxB;MACA,yBAAAZ,KAAK,CAACa,eAAN,qFAAAb,KAAK,EAAmB,IAAIc,KAAJ,CAAUF,KAAV,CAAnB,CAAL;IACD,CAJiB,CAAlB;IAMA,MAAMG,SAAS,GAAGlB,cAAc,CAACQ,WAAf,CAA2B,oBAA3B,EAAiD,MAAM;MAAA;;MACvEG,OAAO,CAACC,GAAR,CAAY,YAAZ;MACA,yBAAAT,KAAK,CAACgB,uBAAN,qFAAAhB,KAAK;IACN,CAHiB,CAAlB;IAKA,OAAO,MAAM;MACXI,SAAS,CAACa,MAAV;MACAN,SAAS,CAACM,MAAV;MACAF,SAAS,CAACE,MAAV;IACD,CAJD;EAKD,CAvBD,EAuBG,EAvBH;;EAyBA,IAAIzB,QAAQ,CAAC0B,EAAT,KAAgB,SAApB,EAA+B;IAC7B,oBAAO,oBAAC,IAAD,uDAAP;EACD;;EAED,oBACE,oBAAC,mBAAD;IACE,KAAK,EAAE;MAAEC,MAAM,EAAE,EAAV;MAAcC,KAAK,EAAE,MAArB;MAA6B,GAAIpB,KAAK,CAACqB;IAAvC,CADT;IAEE,MAAM,EAAErB,KAAK,CAACsB,cAAN,CAAqBC,aAF/B;IAGE,UAAU,EAAEvB,KAAK,CAACsB,cAAN,CAAqBE;EAHnC,EADF;AAOD,CA5CgC,CAA1B"}
1
+ {"version":3,"names":["React","NativeEventEmitter","NativeModules","Platform","requireNativeComponent","Text","RNPEEventEmitter","RNPEGooglePayButton","peEventEmitter","PEGooglePayButton","forwardRef","props","ref","useImperativeHandle","useEffect","listener1","addListener","args","token","console","log","onTokenDidReturn","listener2","error","onPaymentFailed","Error","listener3","onPaymentSheetDismissed","remove","OS","height","width","style","JSON","stringify","paymentRequest","platformOptions"],"sources":["PEGooglePayButton.tsx"],"sourcesContent":["\nimport * as React from 'react';\nimport { NativeEventEmitter, NativeModules, Platform, requireNativeComponent, Text, ViewProps } from 'react-native';\nimport type { PEPaymentRequest } from '../PEPaymentRequest';\n\nconst { RNPEEventEmitter } = NativeModules;\n\nconst RNPEGooglePayButton = requireNativeComponent<NativePEGooglePayViewProps>('RNPEGooglePayButton');\n\ninterface NativePEGooglePayViewProps extends ViewProps {\n // amount: number;\n // merchantId: string;\n paymentRequest: string;\n}\n\nconst peEventEmitter = new NativeEventEmitter(RNPEEventEmitter);\n\nexport interface PEGooglePayButtonProps extends ViewProps {\n paymentRequest: PEPaymentRequest;\n onTokenDidReturn?: (token: string) => void;\n onPaymentSheetDismissed?: () => void;\n onPaymentFailed?: (error: Error) => void;\n}\n\nexport interface PEGooglePayButtonMethods {\n \n}\n\n\nexport const PEGooglePayButton = React.forwardRef<\n PEGooglePayButtonMethods,\n PEGooglePayButtonProps\n>((props, ref) => {\n\n React.useImperativeHandle(ref, () => ({\n }));\n\n React.useEffect(() => {\n const listener1 = peEventEmitter.addListener('onGooglePayRespond', args => {\n const { token } = args;\n console.log('ON token', token)\n props.onTokenDidReturn?.(token)\n });\n\n const listener2 = peEventEmitter.addListener('onGooglePayError', args => {\n const { error } = args;\n console.log('ON error', error)\n props.onPaymentFailed?.(new Error(error))\n });\n\n const listener3 = peEventEmitter.addListener('onGooglePayDismiss', () => {\n console.log('ON dismiss')\n props.onPaymentSheetDismissed?.()\n });\n\n return () => {\n listener1.remove();\n listener2.remove();\n listener3.remove();\n }\n }, []);\n\n if (Platform.OS !== 'android') {\n return <Text>Google Pay is not supported on this platform</Text>\n }\n \n return (\n <RNPEGooglePayButton \n style={{ height: 32, width: '100%', ...(props.style as object) }} \n // amount={props.paymentRequest.paymentAmount}\n // merchantId={props.paymentRequest.merchantId} \n paymentRequest={JSON.stringify({\n ...props.paymentRequest,\n ...props.paymentRequest.platformOptions\n })}\n />\n );\n});\n"],"mappings":"AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,kBAAT,EAA6BC,aAA7B,EAA4CC,QAA5C,EAAsDC,sBAAtD,EAA8EC,IAA9E,QAAqG,cAArG;AAGA,MAAM;EAAEC;AAAF,IAAuBJ,aAA7B;AAEA,MAAMK,mBAAmB,GAAGH,sBAAsB,CAA6B,qBAA7B,CAAlD;AAQA,MAAMI,cAAc,GAAG,IAAIP,kBAAJ,CAAuBK,gBAAvB,CAAvB;AAcA,OAAO,MAAMG,iBAAiB,gBAAGT,KAAK,CAACU,UAAN,CAG/B,CAACC,KAAD,EAAQC,GAAR,KAAgB;EAEhBZ,KAAK,CAACa,mBAAN,CAA0BD,GAA1B,EAA+B,OAAO,EAAP,CAA/B;EAGAZ,KAAK,CAACc,SAAN,CAAgB,MAAM;IACpB,MAAMC,SAAS,GAAGP,cAAc,CAACQ,WAAf,CAA2B,oBAA3B,EAAiDC,IAAI,IAAI;MAAA;;MACzE,MAAM;QAAEC;MAAF,IAAYD,IAAlB;MACAE,OAAO,CAACC,GAAR,CAAY,UAAZ,EAAwBF,KAAxB;MACA,yBAAAP,KAAK,CAACU,gBAAN,qFAAAV,KAAK,EAAoBO,KAApB,CAAL;IACD,CAJiB,CAAlB;IAMA,MAAMI,SAAS,GAAGd,cAAc,CAACQ,WAAf,CAA2B,kBAA3B,EAA+CC,IAAI,IAAI;MAAA;;MACvE,MAAM;QAAEM;MAAF,IAAYN,IAAlB;MACAE,OAAO,CAACC,GAAR,CAAY,UAAZ,EAAwBG,KAAxB;MACA,yBAAAZ,KAAK,CAACa,eAAN,qFAAAb,KAAK,EAAmB,IAAIc,KAAJ,CAAUF,KAAV,CAAnB,CAAL;IACD,CAJiB,CAAlB;IAMA,MAAMG,SAAS,GAAGlB,cAAc,CAACQ,WAAf,CAA2B,oBAA3B,EAAiD,MAAM;MAAA;;MACvEG,OAAO,CAACC,GAAR,CAAY,YAAZ;MACA,yBAAAT,KAAK,CAACgB,uBAAN,qFAAAhB,KAAK;IACN,CAHiB,CAAlB;IAKA,OAAO,MAAM;MACXI,SAAS,CAACa,MAAV;MACAN,SAAS,CAACM,MAAV;MACAF,SAAS,CAACE,MAAV;IACD,CAJD;EAKD,CAvBD,EAuBG,EAvBH;;EAyBA,IAAIzB,QAAQ,CAAC0B,EAAT,KAAgB,SAApB,EAA+B;IAC7B,oBAAO,oBAAC,IAAD,uDAAP;EACD;;EAED,oBACE,oBAAC,mBAAD;IACE,KAAK,EAAE;MAAEC,MAAM,EAAE,EAAV;MAAcC,KAAK,EAAE,MAArB;MAA6B,GAAIpB,KAAK,CAACqB;IAAvC,CADT,CAEE;IACA;IAHF;IAIE,cAAc,EAAEC,IAAI,CAACC,SAAL,CAAe,EAC7B,GAAGvB,KAAK,CAACwB,cADoB;MAE7B,GAAGxB,KAAK,CAACwB,cAAN,CAAqBC;IAFK,CAAf;EAJlB,EADF;AAWD,CAhDgC,CAA1B"}
@@ -4,6 +4,7 @@ export class PEPaymentRequest {
4
4
  constructor(merchantId, paymentAmount) {
5
5
  let currencyCode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'USD';
6
6
  let paymentItems = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
7
+ let platformOptions = arguments.length > 4 ? arguments[4] : undefined;
7
8
 
8
9
  _defineProperty(this, "merchantId", void 0);
9
10
 
@@ -13,10 +14,67 @@ export class PEPaymentRequest {
13
14
 
14
15
  _defineProperty(this, "paymentItems", []);
15
16
 
17
+ _defineProperty(this, "platformOptions", void 0);
18
+
16
19
  this.merchantId = merchantId;
17
20
  this.paymentAmount = paymentAmount;
18
21
  this.currencyCode = currencyCode;
19
22
  this.paymentItems = paymentItems;
23
+ this.platformOptions = platformOptions;
24
+ }
25
+
26
+ }
27
+ export let RNPEContactField;
28
+
29
+ (function (RNPEContactField) {
30
+ RNPEContactField["name"] = "name";
31
+ RNPEContactField["postalAddress"] = "postalAddress";
32
+ RNPEContactField["emailAddress"] = "emailAddress";
33
+ RNPEContactField["phoneNumber"] = "phoneNumber";
34
+ RNPEContactField["phoneticName"] = "phoneticName";
35
+ })(RNPEContactField || (RNPEContactField = {}));
36
+
37
+ export class RNPEApplePayOptions {
38
+ constructor(params) {
39
+ _defineProperty(this, "requiredBillingContactFields", []);
40
+
41
+ _defineProperty(this, "requiredShippingContactFields", []);
42
+
43
+ this.requiredBillingContactFields = params.requiredBillingContactFields;
44
+ this.requiredShippingContactFields = params.requiredShippingContactFields;
45
+ }
46
+
47
+ }
48
+ export class RNPEGooglePayBillingAddressParameters {
49
+ constructor() {
50
+ _defineProperty(this, "format", 'FULL');
51
+
52
+ _defineProperty(this, "phoneNumberRequired", false);
53
+ }
54
+
55
+ }
56
+ export class RNPEGooglePayShippingAddressParameters {
57
+ constructor() {
58
+ _defineProperty(this, "allowedCountryCodes", undefined);
59
+
60
+ _defineProperty(this, "phoneNumberRequired", false);
61
+ }
62
+
63
+ }
64
+ export class RNPEGooglePayOptions {
65
+ constructor(params) {
66
+ _defineProperty(this, "billingAddressRequired", void 0);
67
+
68
+ _defineProperty(this, "billingAddressParameters", void 0);
69
+
70
+ _defineProperty(this, "shippingAddressRequired", void 0);
71
+
72
+ _defineProperty(this, "shippingAddressParameters", void 0);
73
+
74
+ this.billingAddressRequired = params.billingAddressRequired;
75
+ this.billingAddressParameters = params.billingAddressParameters;
76
+ this.shippingAddressRequired = params.shippingAddressRequired;
77
+ this.shippingAddressParameters = params.shippingAddressParameters;
20
78
  }
21
79
 
22
80
  }
@@ -1 +1 @@
1
- {"version":3,"names":["PEPaymentRequest","constructor","merchantId","paymentAmount","currencyCode","paymentItems"],"sources":["PEPaymentRequest.ts"],"sourcesContent":["\nexport class PEPaymentRequest {\n merchantId: string;\n paymentAmount: number;\n currencyCode?: 'USD' | 'CAD' = 'USD';\n paymentItems?: {\n amount: number;\n label: string;\n }[] = []\n\n constructor(merchantId: string, paymentAmount: number, currencyCode: 'USD' | 'CAD' = 'USD', paymentItems: {\n amount: number;\n label: string;\n }[] = []) {\n this.merchantId = merchantId;\n this.paymentAmount = paymentAmount;\n this.currencyCode = currencyCode;\n this.paymentItems = paymentItems;\n }\n}"],"mappings":";;AACA,OAAO,MAAMA,gBAAN,CAAuB;EAS5BC,WAAW,CAACC,UAAD,EAAqBC,aAArB,EAGD;IAAA,IAH6CC,YAG7C,uEAH2E,KAG3E;IAAA,IAHkFC,YAGlF,uEAAJ,EAAI;;IAAA;;IAAA;;IAAA,sCATqB,KASrB;;IAAA,sCALJ,EAKI;;IACR,KAAKH,UAAL,GAAkBA,UAAlB;IACA,KAAKC,aAAL,GAAqBA,aAArB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,YAAL,GAAoBA,YAApB;EACD;;AAjB2B"}
1
+ {"version":3,"names":["PEPaymentRequest","constructor","merchantId","paymentAmount","currencyCode","paymentItems","platformOptions","RNPEContactField","RNPEApplePayOptions","params","requiredBillingContactFields","requiredShippingContactFields","RNPEGooglePayBillingAddressParameters","RNPEGooglePayShippingAddressParameters","undefined","RNPEGooglePayOptions","billingAddressRequired","billingAddressParameters","shippingAddressRequired","shippingAddressParameters"],"sources":["PEPaymentRequest.ts"],"sourcesContent":["type RNPEPaymentOptions = RNPEGooglePayOptions | RNPEApplePayOptions;\n\nexport class PEPaymentRequest {\n merchantId: string;\n paymentAmount: number;\n currencyCode?: 'USD' | 'CAD' = 'USD';\n paymentItems?: {\n amount: number;\n label: string;\n }[] = [];\n platformOptions?: RNPEPaymentOptions;\n\n constructor(\n merchantId: string,\n paymentAmount: number,\n currencyCode: 'USD' | 'CAD' = 'USD',\n paymentItems: {\n amount: number;\n label: string;\n }[] = [],\n platformOptions?: RNPEPaymentOptions\n ) {\n this.merchantId = merchantId;\n this.paymentAmount = paymentAmount;\n this.currencyCode = currencyCode;\n this.paymentItems = paymentItems;\n this.platformOptions = platformOptions;\n }\n}\n\nexport enum RNPEContactField {\n name = 'name',\n postalAddress = 'postalAddress',\n emailAddress = 'emailAddress',\n phoneNumber = 'phoneNumber',\n phoneticName = 'phoneticName',\n}\n\nexport class RNPEApplePayOptions {\n requiredBillingContactFields?: RNPEContactField[] = [];\n requiredShippingContactFields?: RNPEContactField[] = [];\n\n constructor(params: {\n requiredBillingContactFields: RNPEContactField[];\n requiredShippingContactFields: RNPEContactField[];\n }) {\n this.requiredBillingContactFields = params.requiredBillingContactFields;\n this.requiredShippingContactFields = params.requiredShippingContactFields;\n }\n}\n\nexport class RNPEGooglePayBillingAddressParameters {\n format: 'FULL' | 'MIN' = 'FULL'\n phoneNumberRequired: boolean = false\n}\n\nexport class RNPEGooglePayShippingAddressParameters {\n allowedCountryCodes?: string[] = undefined\n phoneNumberRequired: boolean = false\n}\n\nexport class RNPEGooglePayOptions {\n billingAddressRequired: boolean;\n billingAddressParameters?: any;\n shippingAddressRequired: boolean;\n shippingAddressParameters?: any;\n\n constructor(params: {\n billingAddressRequired: boolean;\n shippingAddressRequired: boolean;\n billingAddressParameters?: RNPEGooglePayBillingAddressParameters;\n shippingAddressParameters?: RNPEGooglePayShippingAddressParameters;\n }) {\n this.billingAddressRequired = params.billingAddressRequired;\n this.billingAddressParameters = params.billingAddressParameters;\n this.shippingAddressRequired = params.shippingAddressRequired;\n this.shippingAddressParameters = params.shippingAddressParameters;\n }\n}\n"],"mappings":";;AAEA,OAAO,MAAMA,gBAAN,CAAuB;EAU5BC,WAAW,CACTC,UADS,EAETC,aAFS,EAST;IAAA,IANAC,YAMA,uEAN8B,KAM9B;IAAA,IALAC,YAKA,uEAFM,EAEN;IAAA,IADAC,eACA;;IAAA;;IAAA;;IAAA,sCAhB6B,KAgB7B;;IAAA,sCAZI,EAYJ;;IAAA;;IACA,KAAKJ,UAAL,GAAkBA,UAAlB;IACA,KAAKC,aAAL,GAAqBA,aAArB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,eAAL,GAAuBA,eAAvB;EACD;;AAzB2B;AA4B9B,WAAYC,gBAAZ;;WAAYA,gB;EAAAA,gB;EAAAA,gB;EAAAA,gB;EAAAA,gB;EAAAA,gB;GAAAA,gB,KAAAA,gB;;AAQZ,OAAO,MAAMC,mBAAN,CAA0B;EAI/BP,WAAW,CAACQ,MAAD,EAGR;IAAA,sDANiD,EAMjD;;IAAA,uDALkD,EAKlD;;IACD,KAAKC,4BAAL,GAAoCD,MAAM,CAACC,4BAA3C;IACA,KAAKC,6BAAL,GAAqCF,MAAM,CAACE,6BAA5C;EACD;;AAV8B;AAajC,OAAO,MAAMC,qCAAN,CAA4C;EAAA;IAAA,gCACxB,MADwB;;IAAA,6CAElB,KAFkB;EAAA;;AAAA;AAKnD,OAAO,MAAMC,sCAAN,CAA6C;EAAA;IAAA,6CACjBC,SADiB;;IAAA,6CAEnB,KAFmB;EAAA;;AAAA;AAKpD,OAAO,MAAMC,oBAAN,CAA2B;EAMhCd,WAAW,CAACQ,MAAD,EAKR;IAAA;;IAAA;;IAAA;;IAAA;;IACD,KAAKO,sBAAL,GAA8BP,MAAM,CAACO,sBAArC;IACA,KAAKC,wBAAL,GAAgCR,MAAM,CAACQ,wBAAvC;IACA,KAAKC,uBAAL,GAA+BT,MAAM,CAACS,uBAAtC;IACA,KAAKC,yBAAL,GAAiCV,MAAM,CAACU,yBAAxC;EACD;;AAhB+B"}
@@ -5,7 +5,7 @@ import { PEBankAccountView, PEBankAccountViewMethods } from './components/v2/Sec
5
5
  import { PayEngineProvider } from './components/v2/PayEngineProvider';
6
6
  import PayEngineNative from './components/v2/PayEngineNative';
7
7
  import { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';
8
- import { PEPaymentRequest } from './components/v2/PEPaymentRequest';
8
+ import { PEPaymentRequest, RNPEApplePayOptions, RNPEContactField, RNPEGooglePayBillingAddressParameters, RNPEGooglePayShippingAddressParameters } from './components/v2/PEPaymentRequest';
9
9
  import { PEGooglePayButton } from './components/v2/GooglePay/PEGooglePayButton';
10
10
  import * as PayEngineUtils from './utils/index';
11
11
  import PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';
@@ -24,5 +24,5 @@ PayEngineUtils, PayEngineProvider, PayEngineNative, // securefields
24
24
  PEKeyboardType, // credit card
25
25
  PECreditCardView, PECreditCardViewMethods, // bank account
26
26
  PEBankAccountView, PEBankAccountViewMethods, // Apple Pay
27
- PEApplePayButton, PEPaymentRequest, PEGooglePayButton };
27
+ PEApplePayButton, RNPEApplePayOptions, RNPEContactField, RNPEGooglePayBillingAddressParameters, RNPEGooglePayShippingAddressParameters, PEPaymentRequest, PEGooglePayButton };
28
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PayEngine","NativeModules","Platform","PECreditCardView","PECreditCardViewMethods","PEBankAccountView","PEBankAccountViewMethods","PayEngineProvider","PayEngineNative","PEApplePayButton","PEPaymentRequest","PEGooglePayButton","PayEngineUtils","PEKeyboardType","LINKING_ERROR","select","ios","default","PayEngineStatic","Payengine","Proxy","get","Error"],"sources":["index.tsx"],"sourcesContent":["import PayEngine from './components/PayEngine';\nimport { NativeModules, Platform } from 'react-native';\nimport type { IPayEngineConfig } from './interfaces/index';\nimport {\n PECreditCardView,\n PECreditCardViewMethods,\n} from './components/v2/SecureFields/CreditCardView';\nimport {\n PEBankAccountView,\n PEBankAccountViewMethods,\n} from './components/v2/SecureFields/BankAccountView';\nimport type IPEField from './components/v2/SecureFields/IPEField';\nimport type PECard from './components/v2/SecureFields/PECard';\nimport type PEBankAccount from './components/v2/SecureFields/PEBankAccount';\nimport { PayEngineProvider } from './components/v2/PayEngineProvider';\nimport PayEngineNative from './components/v2/PayEngineNative';\nimport { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';\nimport { PEPaymentRequest } from './components/v2/PEPaymentRequest';\nimport { PEGooglePayButton } from './components/v2/GooglePay/PEGooglePayButton';\nimport * as PayEngineUtils from './utils/index';\nimport PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';\n\nconst LINKING_ERROR =\n `The package 'react-native-payengine' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst PayEngineStatic = NativeModules.Payengine\n ? NativeModules.Payengine\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport {\n PayEngineStatic,\n PayEngine,\n IPayEngineConfig,\n\n // v2 starting here\n PayEngineUtils,\n PayEngineProvider,\n PayEngineNative,\n // securefields\n PEKeyboardType,\n IPEField,\n // credit card\n PECreditCardView,\n PECreditCardViewMethods,\n PECard,\n // bank account\n PEBankAccountView,\n PEBankAccountViewMethods,\n PEBankAccount,\n // Apple Pay\n PEApplePayButton,\n PEPaymentRequest,\n PEGooglePayButton,\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,wBAAtB;AACA,SAASC,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,SACEC,gBADF,EAEEC,uBAFF,QAGO,6CAHP;AAIA,SACEC,iBADF,EAEEC,wBAFF,QAGO,8CAHP;AAOA,SAASC,iBAAT,QAAkC,mCAAlC;AACA,OAAOC,eAAP,MAA4B,iCAA5B;AACA,SAASC,gBAAT,QAAiC,2CAAjC;AACA,SAASC,gBAAT,QAAiC,kCAAjC;AACA,SAASC,iBAAT,QAAkC,6CAAlC;AACA,OAAO,KAAKC,cAAZ,MAAgC,eAAhC;AACA,OAAOC,cAAP,MAA2B,6CAA3B;AAEA,MAAMC,aAAa,GAChB,iFAAD,GACAZ,QAAQ,CAACa,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,eAAe,GAAGjB,aAAa,CAACkB,SAAd,GACpBlB,aAAa,CAACkB,SADM,GAEpB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUR,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ;AAWA,SACEI,eADF,EAEElB,SAFF,EAKE;AACAY,cANF,EAOEL,iBAPF,EAQEC,eARF,EASE;AACAK,cAVF,EAYE;AACAV,gBAbF,EAcEC,uBAdF,EAgBE;AACAC,iBAjBF,EAkBEC,wBAlBF,EAoBE;AACAG,gBArBF,EAsBEC,gBAtBF,EAuBEC,iBAvBF"}
1
+ {"version":3,"names":["PayEngine","NativeModules","Platform","PECreditCardView","PECreditCardViewMethods","PEBankAccountView","PEBankAccountViewMethods","PayEngineProvider","PayEngineNative","PEApplePayButton","PEPaymentRequest","RNPEApplePayOptions","RNPEContactField","RNPEGooglePayBillingAddressParameters","RNPEGooglePayShippingAddressParameters","PEGooglePayButton","PayEngineUtils","PEKeyboardType","LINKING_ERROR","select","ios","default","PayEngineStatic","Payengine","Proxy","get","Error"],"sources":["index.tsx"],"sourcesContent":["import PayEngine from './components/PayEngine';\nimport { NativeModules, Platform } from 'react-native';\nimport type { IPayEngineConfig } from './interfaces/index';\nimport {\n PECreditCardView,\n PECreditCardViewMethods,\n} from './components/v2/SecureFields/CreditCardView';\nimport {\n PEBankAccountView,\n PEBankAccountViewMethods,\n} from './components/v2/SecureFields/BankAccountView';\nimport type IPEField from './components/v2/SecureFields/IPEField';\nimport type PECard from './components/v2/SecureFields/PECard';\nimport type PEBankAccount from './components/v2/SecureFields/PEBankAccount';\nimport { PayEngineProvider } from './components/v2/PayEngineProvider';\nimport PayEngineNative from './components/v2/PayEngineNative';\nimport { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';\nimport { PEPaymentRequest, RNPEApplePayOptions, RNPEContactField, RNPEGooglePayBillingAddressParameters, RNPEGooglePayShippingAddressParameters } from './components/v2/PEPaymentRequest';\nimport { PEGooglePayButton } from './components/v2/GooglePay/PEGooglePayButton';\nimport * as PayEngineUtils from './utils/index';\nimport PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';\n\nconst LINKING_ERROR =\n `The package 'react-native-payengine' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst PayEngineStatic = NativeModules.Payengine\n ? NativeModules.Payengine\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport {\n PayEngineStatic,\n PayEngine,\n IPayEngineConfig,\n\n // v2 starting here\n PayEngineUtils,\n PayEngineProvider,\n PayEngineNative,\n // securefields\n PEKeyboardType,\n IPEField,\n // credit card\n PECreditCardView,\n PECreditCardViewMethods,\n PECard,\n // bank account\n PEBankAccountView,\n PEBankAccountViewMethods,\n PEBankAccount,\n // Apple Pay\n PEApplePayButton,\n RNPEApplePayOptions, \n RNPEContactField,\n RNPEGooglePayBillingAddressParameters, \n RNPEGooglePayShippingAddressParameters,\n PEPaymentRequest,\n PEGooglePayButton,\n \n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,wBAAtB;AACA,SAASC,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,SACEC,gBADF,EAEEC,uBAFF,QAGO,6CAHP;AAIA,SACEC,iBADF,EAEEC,wBAFF,QAGO,8CAHP;AAOA,SAASC,iBAAT,QAAkC,mCAAlC;AACA,OAAOC,eAAP,MAA4B,iCAA5B;AACA,SAASC,gBAAT,QAAiC,2CAAjC;AACA,SAASC,gBAAT,EAA2BC,mBAA3B,EAAgDC,gBAAhD,EAAkEC,qCAAlE,EAAyGC,sCAAzG,QAAuJ,kCAAvJ;AACA,SAASC,iBAAT,QAAkC,6CAAlC;AACA,OAAO,KAAKC,cAAZ,MAAgC,eAAhC;AACA,OAAOC,cAAP,MAA2B,6CAA3B;AAEA,MAAMC,aAAa,GAChB,iFAAD,GACAhB,QAAQ,CAACiB,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,eAAe,GAAGrB,aAAa,CAACsB,SAAd,GACpBtB,aAAa,CAACsB,SADM,GAEpB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUR,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ;AAWA,SACEI,eADF,EAEEtB,SAFF,EAKE;AACAgB,cANF,EAOET,iBAPF,EAQEC,eARF,EASE;AACAS,cAVF,EAYE;AACAd,gBAbF,EAcEC,uBAdF,EAgBE;AACAC,iBAjBF,EAkBEC,wBAlBF,EAoBE;AACAG,gBArBF,EAsBEE,mBAtBF,EAuBEC,gBAvBF,EAwBEC,qCAxBF,EAyBEC,sCAzBF,EA0BEJ,gBA1BF,EA2BEK,iBA3BF"}
@@ -1,3 +1,4 @@
1
+ declare type RNPEPaymentOptions = RNPEGooglePayOptions | RNPEApplePayOptions;
1
2
  export declare class PEPaymentRequest {
2
3
  merchantId: string;
3
4
  paymentAmount: number;
@@ -6,8 +7,45 @@ export declare class PEPaymentRequest {
6
7
  amount: number;
7
8
  label: string;
8
9
  }[];
10
+ platformOptions?: RNPEPaymentOptions;
9
11
  constructor(merchantId: string, paymentAmount: number, currencyCode?: 'USD' | 'CAD', paymentItems?: {
10
12
  amount: number;
11
13
  label: string;
12
- }[]);
14
+ }[], platformOptions?: RNPEPaymentOptions);
13
15
  }
16
+ export declare enum RNPEContactField {
17
+ name = "name",
18
+ postalAddress = "postalAddress",
19
+ emailAddress = "emailAddress",
20
+ phoneNumber = "phoneNumber",
21
+ phoneticName = "phoneticName"
22
+ }
23
+ export declare class RNPEApplePayOptions {
24
+ requiredBillingContactFields?: RNPEContactField[];
25
+ requiredShippingContactFields?: RNPEContactField[];
26
+ constructor(params: {
27
+ requiredBillingContactFields: RNPEContactField[];
28
+ requiredShippingContactFields: RNPEContactField[];
29
+ });
30
+ }
31
+ export declare class RNPEGooglePayBillingAddressParameters {
32
+ format: 'FULL' | 'MIN';
33
+ phoneNumberRequired: boolean;
34
+ }
35
+ export declare class RNPEGooglePayShippingAddressParameters {
36
+ allowedCountryCodes?: string[];
37
+ phoneNumberRequired: boolean;
38
+ }
39
+ export declare class RNPEGooglePayOptions {
40
+ billingAddressRequired: boolean;
41
+ billingAddressParameters?: any;
42
+ shippingAddressRequired: boolean;
43
+ shippingAddressParameters?: any;
44
+ constructor(params: {
45
+ billingAddressRequired: boolean;
46
+ shippingAddressRequired: boolean;
47
+ billingAddressParameters?: RNPEGooglePayBillingAddressParameters;
48
+ shippingAddressParameters?: RNPEGooglePayShippingAddressParameters;
49
+ });
50
+ }
51
+ export {};
@@ -8,9 +8,9 @@ import type PEBankAccount from './components/v2/SecureFields/PEBankAccount';
8
8
  import { PayEngineProvider } from './components/v2/PayEngineProvider';
9
9
  import PayEngineNative from './components/v2/PayEngineNative';
10
10
  import { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';
11
- import { PEPaymentRequest } from './components/v2/PEPaymentRequest';
11
+ import { PEPaymentRequest, RNPEApplePayOptions, RNPEContactField, RNPEGooglePayBillingAddressParameters, RNPEGooglePayShippingAddressParameters } from './components/v2/PEPaymentRequest';
12
12
  import { PEGooglePayButton } from './components/v2/GooglePay/PEGooglePayButton';
13
13
  import * as PayEngineUtils from './utils/index';
14
14
  import PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';
15
15
  declare const PayEngineStatic: any;
16
- export { PayEngineStatic, PayEngine, IPayEngineConfig, PayEngineUtils, PayEngineProvider, PayEngineNative, PEKeyboardType, IPEField, PECreditCardView, PECreditCardViewMethods, PECard, PEBankAccountView, PEBankAccountViewMethods, PEBankAccount, PEApplePayButton, PEPaymentRequest, PEGooglePayButton, };
16
+ export { PayEngineStatic, PayEngine, IPayEngineConfig, PayEngineUtils, PayEngineProvider, PayEngineNative, PEKeyboardType, IPEField, PECreditCardView, PECreditCardViewMethods, PECard, PEBankAccountView, PEBankAccountViewMethods, PEBankAccount, PEApplePayButton, RNPEApplePayOptions, RNPEContactField, RNPEGooglePayBillingAddressParameters, RNPEGooglePayShippingAddressParameters, PEPaymentRequest, PEGooglePayButton, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-payengine",
3
- "version": "2.0.6",
3
+ "version": "2.0.9",
4
4
  "description": "PayEngine SDK for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -65,7 +65,10 @@ PEApplePayButtonMethods,
65
65
  return (
66
66
  <RNPEApplePayButton
67
67
  style={{ height: 32, width: '100%', ...(props.style as object) }}
68
- paymentRequest={JSON.stringify(props.paymentRequest)}
68
+ paymentRequest={JSON.stringify({
69
+ ...props.paymentRequest,
70
+ ...props.paymentRequest.platformOptions
71
+ })}
69
72
  onPmError={pmError}
70
73
  onPmTokenDidReturn={pmTokenDidReturn}
71
74
  onPmSheetDidDismiss={pmSheetDidDismiss}
@@ -8,8 +8,9 @@ const { RNPEEventEmitter } = NativeModules;
8
8
  const RNPEGooglePayButton = requireNativeComponent<NativePEGooglePayViewProps>('RNPEGooglePayButton');
9
9
 
10
10
  interface NativePEGooglePayViewProps extends ViewProps {
11
- amount: number;
12
- merchantId: string;
11
+ // amount: number;
12
+ // merchantId: string;
13
+ paymentRequest: string;
13
14
  }
14
15
 
15
16
  const peEventEmitter = new NativeEventEmitter(RNPEEventEmitter);
@@ -66,8 +67,12 @@ export const PEGooglePayButton = React.forwardRef<
66
67
  return (
67
68
  <RNPEGooglePayButton
68
69
  style={{ height: 32, width: '100%', ...(props.style as object) }}
69
- amount={props.paymentRequest.paymentAmount}
70
- merchantId={props.paymentRequest.merchantId}
70
+ // amount={props.paymentRequest.paymentAmount}
71
+ // merchantId={props.paymentRequest.merchantId}
72
+ paymentRequest={JSON.stringify({
73
+ ...props.paymentRequest,
74
+ ...props.paymentRequest.platformOptions
75
+ })}
71
76
  />
72
77
  );
73
78
  });
@@ -1,3 +1,4 @@
1
+ type RNPEPaymentOptions = RNPEGooglePayOptions | RNPEApplePayOptions;
1
2
 
2
3
  export class PEPaymentRequest {
3
4
  merchantId: string;
@@ -6,15 +7,73 @@ export class PEPaymentRequest {
6
7
  paymentItems?: {
7
8
  amount: number;
8
9
  label: string;
9
- }[] = []
10
+ }[] = [];
11
+ platformOptions?: RNPEPaymentOptions;
10
12
 
11
- constructor(merchantId: string, paymentAmount: number, currencyCode: 'USD' | 'CAD' = 'USD', paymentItems: {
12
- amount: number;
13
- label: string;
14
- }[] = []) {
13
+ constructor(
14
+ merchantId: string,
15
+ paymentAmount: number,
16
+ currencyCode: 'USD' | 'CAD' = 'USD',
17
+ paymentItems: {
18
+ amount: number;
19
+ label: string;
20
+ }[] = [],
21
+ platformOptions?: RNPEPaymentOptions
22
+ ) {
15
23
  this.merchantId = merchantId;
16
24
  this.paymentAmount = paymentAmount;
17
25
  this.currencyCode = currencyCode;
18
26
  this.paymentItems = paymentItems;
27
+ this.platformOptions = platformOptions;
28
+ }
29
+ }
30
+
31
+ export enum RNPEContactField {
32
+ name = 'name',
33
+ postalAddress = 'postalAddress',
34
+ emailAddress = 'emailAddress',
35
+ phoneNumber = 'phoneNumber',
36
+ phoneticName = 'phoneticName',
37
+ }
38
+
39
+ export class RNPEApplePayOptions {
40
+ requiredBillingContactFields?: RNPEContactField[] = [];
41
+ requiredShippingContactFields?: RNPEContactField[] = [];
42
+
43
+ constructor(params: {
44
+ requiredBillingContactFields: RNPEContactField[];
45
+ requiredShippingContactFields: RNPEContactField[];
46
+ }) {
47
+ this.requiredBillingContactFields = params.requiredBillingContactFields;
48
+ this.requiredShippingContactFields = params.requiredShippingContactFields;
49
+ }
50
+ }
51
+
52
+ export class RNPEGooglePayBillingAddressParameters {
53
+ format: 'FULL' | 'MIN' = 'FULL'
54
+ phoneNumberRequired: boolean = false
55
+ }
56
+
57
+ export class RNPEGooglePayShippingAddressParameters {
58
+ allowedCountryCodes?: string[] = undefined
59
+ phoneNumberRequired: boolean = false
60
+ }
61
+
62
+ export class RNPEGooglePayOptions {
63
+ billingAddressRequired: boolean;
64
+ billingAddressParameters?: any;
65
+ shippingAddressRequired: boolean;
66
+ shippingAddressParameters?: any;
67
+
68
+ constructor(params: {
69
+ billingAddressRequired: boolean;
70
+ shippingAddressRequired: boolean;
71
+ billingAddressParameters?: RNPEGooglePayBillingAddressParameters;
72
+ shippingAddressParameters?: RNPEGooglePayShippingAddressParameters;
73
+ }) {
74
+ this.billingAddressRequired = params.billingAddressRequired;
75
+ this.billingAddressParameters = params.billingAddressParameters;
76
+ this.shippingAddressRequired = params.shippingAddressRequired;
77
+ this.shippingAddressParameters = params.shippingAddressParameters;
19
78
  }
20
- }
79
+ }
package/src/index.tsx CHANGED
@@ -15,7 +15,7 @@ import type PEBankAccount from './components/v2/SecureFields/PEBankAccount';
15
15
  import { PayEngineProvider } from './components/v2/PayEngineProvider';
16
16
  import PayEngineNative from './components/v2/PayEngineNative';
17
17
  import { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';
18
- import { PEPaymentRequest } from './components/v2/PEPaymentRequest';
18
+ import { PEPaymentRequest, RNPEApplePayOptions, RNPEContactField, RNPEGooglePayBillingAddressParameters, RNPEGooglePayShippingAddressParameters } from './components/v2/PEPaymentRequest';
19
19
  import { PEGooglePayButton } from './components/v2/GooglePay/PEGooglePayButton';
20
20
  import * as PayEngineUtils from './utils/index';
21
21
  import PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';
@@ -59,6 +59,11 @@ export {
59
59
  PEBankAccount,
60
60
  // Apple Pay
61
61
  PEApplePayButton,
62
+ RNPEApplePayOptions,
63
+ RNPEContactField,
64
+ RNPEGooglePayBillingAddressParameters,
65
+ RNPEGooglePayShippingAddressParameters,
62
66
  PEPaymentRequest,
63
67
  PEGooglePayButton,
68
+
64
69
  };
@@ -1,11 +0,0 @@
1
- <component name="libraryTable">
2
- <library name="Gradle: android.arch.core:common:1.0.0">
3
- <CLASSES>
4
- <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.core/common/1.0.0/a2d487452376193fc8c103dd2b9bd5f2b1b44563/common-1.0.0.jar!/" />
5
- </CLASSES>
6
- <JAVADOC />
7
- <SOURCES>
8
- <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.core/common/1.0.0/a41fa3b9a66f3bdd41f98013a1688e969072aaf2/common-1.0.0-sources.jar!/" />
9
- </SOURCES>
10
- </library>
11
- </component>
@@ -1,11 +0,0 @@
1
- <component name="libraryTable">
2
- <library name="Gradle: android.arch.lifecycle:common:1.0.0">
3
- <CLASSES>
4
- <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/common/1.0.0/e414a4cb28434e25c4f6aa71426eb20cf4874ae9/common-1.0.0.jar!/" />
5
- </CLASSES>
6
- <JAVADOC />
7
- <SOURCES>
8
- <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/common/1.0.0/39ce4055689b4b766478265a8c661f4165f26dc3/common-1.0.0-sources.jar!/" />
9
- </SOURCES>
10
- </library>
11
- </component>
@@ -1,13 +0,0 @@
1
- <component name="libraryTable">
2
- <library name="Gradle: android.arch.lifecycle:runtime:1.0.0@aar">
3
- <CLASSES>
4
- <root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0153b7b32b50155c05c597945fbb09b3/runtime-1.0.0/jars/classes.jar!/" />
5
- <root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0153b7b32b50155c05c597945fbb09b3/runtime-1.0.0/res" />
6
- <root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0153b7b32b50155c05c597945fbb09b3/runtime-1.0.0/AndroidManifest.xml" />
7
- </CLASSES>
8
- <JAVADOC />
9
- <SOURCES>
10
- <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/runtime/1.0.0/1dd0298d8c45d8dfa4d038270247327f23df7a3a/runtime-1.0.0-sources.jar!/" />
11
- </SOURCES>
12
- </library>
13
- </component>