react-native-payengine 2.0.16 → 2.0.18-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/README.md +96 -65
  2. package/android/.gradle/checksums/checksums.lock +0 -0
  3. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  5. package/android/build.gradle +2 -2
  6. package/android/src/main/java/com/reactnativepayengine/v2/RNPayEngineNative.kt +65 -3
  7. package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEEvents.kt +1 -0
  8. package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNBankAccountViewManager.kt +16 -3
  9. package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardViewManager.kt +15 -4
  10. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KDataCollector.h +4 -25
  11. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +0 -20
  12. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountPrivate.h +61 -0
  13. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +430 -133
  14. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Info.plist +0 -0
  15. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.abi.json +1848 -5121
  16. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +35 -117
  17. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface-e +35 -117
  18. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  19. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface +35 -117
  20. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface-e +35 -117
  21. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/PayEngineSDK +0 -0
  22. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
  23. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KDataCollector.h +4 -25
  24. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +0 -20
  25. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountPrivate.h +61 -0
  26. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +860 -266
  27. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Info.plist +0 -0
  28. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1848 -5121
  29. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +35 -117
  30. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface-e +35 -117
  31. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  32. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +35 -117
  33. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface-e +35 -117
  34. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1848 -5121
  35. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +35 -117
  36. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface-e +35 -117
  37. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  38. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +35 -117
  39. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface-e +35 -117
  40. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/PayEngineSDK +0 -0
  41. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
  42. package/ios/Sources/Classes/RNPEEventEmitter.swift +1 -1
  43. package/ios/Sources/Classes/RNPayEngineNative.swift +125 -64
  44. package/ios/Sources/Classes/SecureFields/RNPEEvents.swift +1 -0
  45. package/ios/Sources/Payengine.m +6 -0
  46. package/lib/commonjs/components/PayEngine.js +1 -1
  47. package/lib/commonjs/components/PayEngine.js.map +1 -1
  48. package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js +124 -0
  49. package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -1
  50. package/lib/commonjs/components/v2/ApplePay/PEApplePayInterfaces.js +78 -0
  51. package/lib/commonjs/components/v2/ApplePay/PEApplePayInterfaces.js.map +1 -1
  52. package/lib/commonjs/components/v2/GooglePay/PEGooglePayAddress.js.map +1 -1
  53. package/lib/commonjs/components/v2/GooglePay/PEGooglePayButton.js +53 -0
  54. package/lib/commonjs/components/v2/GooglePay/PEGooglePayButton.js.map +1 -1
  55. package/lib/commonjs/components/v2/PEPaymentRequest.js +121 -0
  56. package/lib/commonjs/components/v2/PEPaymentRequest.js.map +1 -1
  57. package/lib/commonjs/components/v2/PayEngineNative.js +182 -4
  58. package/lib/commonjs/components/v2/PayEngineNative.js.map +1 -1
  59. package/lib/commonjs/components/v2/PayEngineProvider.js +52 -0
  60. package/lib/commonjs/components/v2/PayEngineProvider.js.map +1 -1
  61. package/lib/commonjs/components/v2/SecureFields/BankAccountView.js +71 -0
  62. package/lib/commonjs/components/v2/SecureFields/BankAccountView.js.map +1 -1
  63. package/lib/commonjs/components/v2/SecureFields/CreditCardView.js +82 -0
  64. package/lib/commonjs/components/v2/SecureFields/CreditCardView.js.map +1 -1
  65. package/lib/commonjs/components/v2/SecureFields/IPEField.js.map +1 -1
  66. package/lib/commonjs/components/v2/SecureFields/ITokenizationData.js.map +1 -1
  67. package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js.map +1 -1
  68. package/lib/commonjs/components/v2/SecureFields/PECard.js.map +1 -1
  69. package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js +20 -3
  70. package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js.map +1 -1
  71. package/lib/commonjs/index.js +17 -13
  72. package/lib/commonjs/index.js.map +1 -1
  73. package/lib/commonjs/interfaces/index.js +20 -0
  74. package/lib/commonjs/interfaces/index.js.map +1 -1
  75. package/lib/commonjs/utils/index.js +26 -0
  76. package/lib/commonjs/utils/index.js.map +1 -1
  77. package/lib/module/components/PayEngine.js +1 -1
  78. package/lib/module/components/PayEngine.js.map +1 -1
  79. package/lib/module/components/v2/ApplePay/PEApplePayButton.js +124 -0
  80. package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -1
  81. package/lib/module/components/v2/ApplePay/PEApplePayInterfaces.js +75 -0
  82. package/lib/module/components/v2/ApplePay/PEApplePayInterfaces.js.map +1 -1
  83. package/lib/module/components/v2/GooglePay/PEGooglePayAddress.js.map +1 -1
  84. package/lib/module/components/v2/GooglePay/PEGooglePayButton.js +53 -0
  85. package/lib/module/components/v2/GooglePay/PEGooglePayButton.js.map +1 -1
  86. package/lib/module/components/v2/PEPaymentRequest.js +119 -0
  87. package/lib/module/components/v2/PEPaymentRequest.js.map +1 -1
  88. package/lib/module/components/v2/PayEngineNative.js +184 -5
  89. package/lib/module/components/v2/PayEngineNative.js.map +1 -1
  90. package/lib/module/components/v2/PayEngineProvider.js +51 -0
  91. package/lib/module/components/v2/PayEngineProvider.js.map +1 -1
  92. package/lib/module/components/v2/SecureFields/BankAccountView.js +71 -0
  93. package/lib/module/components/v2/SecureFields/BankAccountView.js.map +1 -1
  94. package/lib/module/components/v2/SecureFields/CreditCardView.js +82 -0
  95. package/lib/module/components/v2/SecureFields/CreditCardView.js.map +1 -1
  96. package/lib/module/components/v2/SecureFields/IPEField.js.map +1 -1
  97. package/lib/module/components/v2/SecureFields/ITokenizationData.js.map +1 -1
  98. package/lib/module/components/v2/SecureFields/PEBankAccount.js.map +1 -1
  99. package/lib/module/components/v2/SecureFields/PECard.js.map +1 -1
  100. package/lib/module/components/v2/SecureFields/PEKeyboardType.js +16 -1
  101. package/lib/module/components/v2/SecureFields/PEKeyboardType.js.map +1 -1
  102. package/lib/module/index.js +10 -5
  103. package/lib/module/index.js.map +1 -1
  104. package/lib/module/interfaces/index.js +19 -0
  105. package/lib/module/interfaces/index.js.map +1 -1
  106. package/lib/module/utils/index.js +27 -0
  107. package/lib/module/utils/index.js.map +1 -1
  108. package/lib/typescript/components/PayEngine.d.ts +1 -1
  109. package/lib/typescript/components/v2/ApplePay/PEApplePayButton.d.ts +217 -12
  110. package/lib/typescript/components/v2/ApplePay/PEApplePayInterfaces.d.ts +180 -1
  111. package/lib/typescript/components/v2/GooglePay/PEGooglePayAddress.d.ts +30 -0
  112. package/lib/typescript/components/v2/GooglePay/PEGooglePayButton.d.ts +99 -0
  113. package/lib/typescript/components/v2/PEPaymentRequest.d.ts +130 -9
  114. package/lib/typescript/components/v2/PayEngineNative.d.ts +165 -7
  115. package/lib/typescript/components/v2/PayEngineProvider.d.ts +51 -0
  116. package/lib/typescript/components/v2/SecureFields/BankAccountView.d.ts +103 -0
  117. package/lib/typescript/components/v2/SecureFields/CreditCardView.d.ts +114 -0
  118. package/lib/typescript/components/v2/SecureFields/IPEField.d.ts +49 -0
  119. package/lib/typescript/components/v2/SecureFields/ITokenizationData.d.ts +14 -0
  120. package/lib/typescript/components/v2/SecureFields/PEBankAccount.d.ts +36 -0
  121. package/lib/typescript/components/v2/SecureFields/PECard.d.ts +44 -0
  122. package/lib/typescript/components/v2/SecureFields/PEKeyboardType.d.ts +16 -1
  123. package/lib/typescript/index.d.ts +11 -5
  124. package/lib/typescript/interfaces/index.d.ts +35 -1
  125. package/lib/typescript/utils/index.d.ts +21 -0
  126. package/package.json +6 -3
  127. package/react-native-payengine.podspec +1 -1
  128. package/src/components/PayEngine.tsx +1 -1
  129. package/src/components/v2/ApplePay/PEApplePayButton.tsx +225 -12
  130. package/src/components/v2/ApplePay/PEApplePayInterfaces.ts +221 -8
  131. package/src/components/v2/GooglePay/PEGooglePayAddress.ts +39 -1
  132. package/src/components/v2/GooglePay/PEGooglePayButton.tsx +113 -9
  133. package/src/components/v2/PEPaymentRequest.ts +151 -13
  134. package/src/components/v2/PayEngineNative.tsx +196 -9
  135. package/src/components/v2/PayEngineProvider.tsx +52 -1
  136. package/src/components/v2/SecureFields/BankAccountView.tsx +108 -1
  137. package/src/components/v2/SecureFields/CreditCardView.tsx +118 -1
  138. package/src/components/v2/SecureFields/IPEField.ts +55 -0
  139. package/src/components/v2/SecureFields/ITokenizationData.ts +17 -2
  140. package/src/components/v2/SecureFields/PEBankAccount.ts +42 -0
  141. package/src/components/v2/SecureFields/PECard.ts +52 -0
  142. package/src/components/v2/SecureFields/PEKeyboardType.ts +18 -1
  143. package/src/index.tsx +23 -5
  144. package/src/interfaces/index.ts +40 -2
  145. package/src/utils/index.ts +21 -0
  146. package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
  147. package/android/.gradle/6.1.1/fileChanges/last-build.bin +0 -0
  148. package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
  149. package/android/.gradle/6.1.1/gc.properties +0 -0
  150. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/CustomWindow.h +0 -25
  151. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +0 -33
  152. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +0 -27
  153. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/CustomWindow.h +0 -25
  154. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +0 -33
  155. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +0 -27
@@ -1,54 +1,233 @@
1
+ /**
2
+ * A model representing a contact associated with Apple Pay.
3
+ *
4
+ * This interface defines the contact details that can be associated with an Apple Pay transaction,
5
+ * including personal and address information such as the contact's name, address, email, and phone number.
6
+ * The fields are optional, meaning not all fields need to be provided when creating an instance.
7
+ *
8
+ * ## Example Usage:
9
+ * ```ts
10
+ * const contact: PEApplePayContact = {
11
+ * givenName: 'John',
12
+ * familyName: 'Doe',
13
+ * addressLines: ['123 Main St', 'Suite 400'],
14
+ * locality: 'Anytown',
15
+ * administrativeArea: 'CA',
16
+ * postalCode: '12345',
17
+ * country: 'USA',
18
+ * countryCode: 'US',
19
+ * subAdministrativeArea: 'SubArea',
20
+ * subLocality: 'Locality',
21
+ * emailAddress: 'john.doe@example.com',
22
+ * phoneNumber: '+1234567890',
23
+ * };
24
+ * ```
25
+ *
26
+ * @category Apple Pay
27
+ */
1
28
  export interface PEApplePayContact {
29
+ /**
30
+ * The given (first) name of the contact.
31
+ *
32
+ * Example: "John"
33
+ */
2
34
  givenName?: string;
35
+ /**
36
+ * The family (last) name of the contact.
37
+ *
38
+ * Example: "Doe"
39
+ */
3
40
  familyName?: string;
41
+ /**
42
+ * The contact's address lines, typically representing street addresses.
43
+ *
44
+ * Example: ["123 Main St", "Suite 400"]
45
+ */
4
46
  addressLines?: string[];
47
+ /**
48
+ * The city or locality of the contact's address.
49
+ *
50
+ * Example: "Anytown"
51
+ */
5
52
  locality?: string;
53
+ /**
54
+ * The state, province, or administrative area of the contact's address.
55
+ *
56
+ * Example: "CA"
57
+ */
6
58
  administrativeArea?: string;
59
+ /**
60
+ * The postal code (ZIP code) of the contact's address.
61
+ *
62
+ * Example: "12345"
63
+ */
7
64
  postalCode?: string;
65
+ /**
66
+ * The full country name of the contact's address.
67
+ *
68
+ * Example: "USA"
69
+ */
8
70
  country?: string;
71
+ /**
72
+ * The ISO country code (e.g., "US" for the United States).
73
+ *
74
+ * Example: "US"
75
+ */
9
76
  countryCode?: string;
77
+ /**
78
+ * A more specific administrative area within the main administrative area.
79
+ *
80
+ * Example: "SubArea"
81
+ */
10
82
  subAdministrativeArea?: string;
83
+ /**
84
+ * A more specific locality within the main locality.
85
+ *
86
+ * Example: "Locality"
87
+ */
11
88
  subLocality?: string;
89
+ /**
90
+ * The contact's email address.
91
+ *
92
+ * Example: "john.doe@example.com"
93
+ */
12
94
  emailAddress?: string;
95
+ /**
96
+ * The contact's phone number.
97
+ *
98
+ * Example: "+1234567890"
99
+ */
13
100
  phoneNumber?: string;
14
101
  }
102
+ /**
103
+ * A model representing the selected Apple Pay payment method.
104
+ *
105
+ * This interface provides details about the payment method chosen by the user
106
+ * during an Apple Pay transaction. It includes the method's display name,
107
+ * payment network (e.g., Visa, MasterCard), and the type of payment method.
108
+ *
109
+ * ## Example Usage:
110
+ * ```ts
111
+ * const paymentMethod: PEApplePayPaymentMethod = {
112
+ * displayName: 'Visa 1234',
113
+ * network: 'Visa',
114
+ * type: 'credit', // or 'debit', depending on your enum or string literal type
115
+ * };
116
+ * ```
117
+ *
118
+ * @category Apple Pay
119
+ */
15
120
  export interface PEApplePayPaymentMethod {
121
+ /**
122
+ * A user-facing description of the payment method.
123
+ *
124
+ * This typically includes the card type and last few digits, e.g., "Visa 1234".
125
+ */
16
126
  displayName?: string;
127
+ /**
128
+ * The network associated with the payment method.
129
+ *
130
+ * Common examples include "Visa", "MasterCard", "Amex", etc.
131
+ */
17
132
  network?: string;
133
+ /**
134
+ * The type of payment method.
135
+ *
136
+ * This is a required field indicating whether the method is a credit card, debit card, etc.
137
+ */
18
138
  type: PEApplePayPaymentMethodType;
19
139
  }
140
+ /**
141
+ * Enum representing the different types of payment methods supported by Apple Pay.
142
+ * Each value corresponds to a specific payment method category.
143
+ *
144
+ * @category Apple Pay
145
+ */
20
146
  export declare enum PEApplePayPaymentMethodType {
147
+ /** Unknown payment method type. */
21
148
  unknown = 0,
149
+ /** Debit card payment method. */
22
150
  debit = 1,
151
+ /** Credit card payment method. */
23
152
  credit = 2,
153
+ /** Prepaid card payment method. */
24
154
  prepaid = 3,
155
+ /** Store card payment method. */
25
156
  store = 4,
157
+ /** Electronic money (e-money) payment method. */
26
158
  eMoney = 5
27
159
  }
160
+ /**
161
+ * Represents a shipping method available during Apple Pay checkout.
162
+ *
163
+ * Includes label, amount, and identifier.
164
+ *
165
+ * @category Apple Pay
166
+ */
28
167
  export interface PEApplePayShippingMethod {
168
+ /** Unique identifier for the shipping method. */
29
169
  identifier: string;
170
+ /** Cost associated with this shipping method. */
30
171
  amount: number;
172
+ /** Display label (e.g., "Express Delivery"). */
31
173
  label: string;
32
174
  }
33
- export declare type PEApplePaySheetError = {
175
+ /**
176
+ * Type representing the possible errors that can occur during the Apple Pay
177
+ * sheet process. This includes issues related to invalid or unserviceable
178
+ * shipping addresses.
179
+ *
180
+ * * @category Apple Pay
181
+ */
182
+ export type PEApplePaySheetError = {
183
+ /** The error occurs due to an invalid shipping address. */
34
184
  errorType: PEApplePaySheetErrorType.InvalidShippingAddress;
185
+ /** The specific field in the shipping address that caused the error. */
35
186
  field: PEApplePayInvalidShippingField;
187
+ /** An optional message providing more details about the error. */
36
188
  message?: string;
37
189
  } | {
190
+ /** The error occurs due to an unserviceable shipping address. */
38
191
  errorType: PEApplePaySheetErrorType.UnserviceableShippingAddress;
192
+ /** An optional message providing more details about the error. */
39
193
  message?: string;
40
194
  };
195
+ /**
196
+ * Enum representing the types of errors that can occur during the Apple Pay
197
+ * sheet process. These errors typically relate to issues with the shipping
198
+ * address provided by the user.
199
+ *
200
+ * @category Apple Pay
201
+ */
41
202
  export declare enum PEApplePaySheetErrorType {
203
+ /** The shipping address provided is invalid. */
42
204
  InvalidShippingAddress = "InvalidShippingAddress",
205
+ /** The shipping address provided is unserviceable (e.g., the address cannot be delivered to). */
43
206
  UnserviceableShippingAddress = "UnserviceableShippingAddress"
44
207
  }
208
+ /**
209
+ *
210
+ * Enum representing the fields of shipping address that may be invalid
211
+ * during Apple Pay transactions. These values can be used to identify
212
+ * which part of the shipping address is incorrect or missing.
213
+ *
214
+ * @category Apple Pay
215
+ */
45
216
  export declare enum PEApplePayInvalidShippingField {
217
+ /** The street address is invalid or missing. */
46
218
  Street = "street",
219
+ /** The city is invalid or missing. */
47
220
  City = "city",
221
+ /** The sub-administrative area (e.g., district) is invalid or missing. */
48
222
  SubAdministrativeArea = "subAdministrativeArea",
223
+ /** The state or province is invalid or missing. */
49
224
  State = "state",
225
+ /** The postal code is invalid or missing. */
50
226
  PostalCode = "postalCode",
227
+ /** The country is invalid or missing. */
51
228
  Country = "country",
229
+ /** The country code is invalid or missing. */
52
230
  CountryCode = "countryCode",
231
+ /** The sub-locality (e.g., neighborhood) is invalid or missing. */
53
232
  SubLocality = "subLocality"
54
233
  }
@@ -1,11 +1,41 @@
1
+ /**
2
+ * Represents a Google Pay address containing structured user information.
3
+ *
4
+ * This model holds address details returned from Google Pay, including
5
+ * name, street address lines, locality, country code, phone number, and postal code.
6
+ *
7
+ * ## Example Usage:
8
+ * ```ts
9
+ * const address: PEGooglePayAddress = {
10
+ * address1: "1600 Amphitheatre Parkway",
11
+ * administrativeArea: "CA",
12
+ * countryCode: "US",
13
+ * locality: "Mountain View",
14
+ * name: "John Doe",
15
+ * phoneNumber: "+1 123-456-7890",
16
+ * postalCode: "94043",
17
+ * };
18
+ * ```
19
+ *
20
+ * @category Google Pay
21
+ */
1
22
  export interface PEGooglePayAddress {
23
+ /** The first line of the street address (e.g., "123 Main St"). */
2
24
  address1?: string;
25
+ /** The second line of the street address (e.g., apartment, suite, or unit number). */
3
26
  address2?: string;
27
+ /** The third line of the street address (if applicable). */
4
28
  address3?: string;
29
+ /** The state, province, or region of the address. */
5
30
  administrativeArea?: string;
31
+ /** The two-letter country code in ISO 3166-1 alpha-2 format (e.g., "US", "CA"). */
6
32
  countryCode?: string;
33
+ /** The city or town of the address. */
7
34
  locality?: string;
35
+ /** The full name of the recipient. */
8
36
  name?: string;
37
+ /** The phone number associated with the address. */
9
38
  phoneNumber?: string;
39
+ /** The ZIP or postal code. */
10
40
  postalCode?: string;
11
41
  }
@@ -2,12 +2,111 @@ import * as React from 'react';
2
2
  import { ViewProps } from 'react-native';
3
3
  import type { PEPaymentRequest } from '../PEPaymentRequest';
4
4
  import type { PEGooglePayAddress } from './PEGooglePayAddress';
5
+ /**
6
+ * Props for rendering the Google Pay payment button.
7
+ *
8
+ * This interface defines the configuration and callback handlers
9
+ * used when initiating a Google Pay transaction.
10
+ *
11
+ * @category Google Pay
12
+ */
5
13
  export interface PEGooglePayButtonProps extends ViewProps {
14
+ /**
15
+ * The payment request containing merchant details, amount, currency,
16
+ * and optional payment item breakdown.
17
+ *
18
+ * This object defines the core transaction that will be processed.
19
+ */
6
20
  paymentRequest: PEPaymentRequest;
21
+ /**
22
+ * Callback triggered when a Google Pay token is successfully returned.
23
+ *
24
+ * @param token - The Google Pay payment token as a string.
25
+ * @param metadata - Additional transaction metadata (if available).
26
+ * @param billingAddress - The billing address provided by Google Pay (optional).
27
+ * @param shippingAddress - The shipping address provided by Google Pay (optional).
28
+ *
29
+ * Example usage:
30
+ * ```ts
31
+ * onTokenDidReturn: (token, metadata, billingAddress, shippingAddress) => {
32
+ * console.log("Token:", token);
33
+ * }
34
+ * ```
35
+ */
7
36
  onTokenDidReturn?: (token: string, metadata?: any, billingAddress?: PEGooglePayAddress, shippingAddress?: PEGooglePayAddress) => void;
37
+ /**
38
+ * Callback triggered when the Google Pay sheet is dismissed
39
+ * without completing the payment.
40
+ *
41
+ * Useful for UI updates or restoring state.
42
+ */
8
43
  onPaymentSheetDismissed?: () => void;
44
+ /**
45
+ * Callback triggered when a payment fails during processing.
46
+ *
47
+ * @param error - An error object describing the cause of the failure.
48
+ *
49
+ * Example:
50
+ * ```ts
51
+ * onPaymentFailed: (error) => {
52
+ * console.error("Payment failed:", error.message);
53
+ * }
54
+ * ```
55
+ */
9
56
  onPaymentFailed?: (error: Error) => void;
10
57
  }
58
+ /**
59
+ * Interface for defining methods related to the Google Pay button.
60
+ *
61
+ * Currently empty, this interface serves as a placeholder for any
62
+ * platform-specific Google Pay button methods that may be added in the future.
63
+ *
64
+ * @category Google Pay
65
+ */
11
66
  export interface PEGooglePayButtonMethods {
12
67
  }
68
+ /**
69
+ * A React Native component for rendering a Google Pay button.
70
+ *
71
+ * This button allows users to initiate a Google Pay transaction using the
72
+ * provided `paymentRequest`. The component communicates with native code
73
+ * and emits events through a shared event emitter (`peEventEmitter`) to
74
+ * notify the JavaScript layer about the payment result.
75
+ *
76
+ * ## Example Usage:
77
+ * ```tsx
78
+ * const paymentRequest = {
79
+ * merchantId: 'your-merchant-id',
80
+ * paymentAmount: 10.00,
81
+ * paymentItems: [
82
+ * { label: 'Test Item', amount: 10.00 }
83
+ * ],
84
+ * platformOptions: {
85
+ * billingAddressRequired: true,
86
+ * shippingAddressRequired: true,
87
+ * },
88
+ * };
89
+ *
90
+ * <PEGooglePayButton
91
+ * paymentRequest={paymentRequest}
92
+ * onPaymentFailed={(error) => {
93
+ * console.log("Payment failed", error);
94
+ * }}
95
+ * onPaymentSheetDismissed={() => {
96
+ * console.log("Payment sheet dismissed");
97
+ * }}
98
+ * onTokenDidReturn={(token, metadata, billingAddress, shippingAddress) => {
99
+ * console.log("Payment successful", token, metadata, billingAddress, shippingAddress);
100
+ * }}
101
+ * />
102
+ * ```
103
+ *
104
+ * ## Platform Support:
105
+ * - **Android only**: On iOS, this component renders a fallback message.
106
+ *
107
+ * @param props - See {@link PEGooglePayButtonProps}
108
+ * @returns A Google Pay button on Android or a fallback message on iOS.
109
+ *
110
+ * @category Google Pay
111
+ */
13
112
  export declare const PEGooglePayButton: React.ForwardRefExoticComponent<PEGooglePayButtonProps & React.RefAttributes<PEGooglePayButtonMethods>>;
@@ -1,30 +1,103 @@
1
1
  import type { PEApplePayShippingMethod } from "./ApplePay/PEApplePayInterfaces";
2
- declare type RNPEPaymentOptions = RNPEGooglePayOptions | RNPEApplePayOptions;
2
+ /**
3
+ * A union type that represents platform-specific payment options.
4
+ *
5
+ * This can either be `RNPEGooglePayOptions` or `RNPEApplePayOptions`, depending
6
+ * on the platform.
7
+ *
8
+ */
9
+ export type RNPEPaymentOptions = RNPEGooglePayOptions | RNPEApplePayOptions;
10
+ /**
11
+ * A class representing a payment request containing all necessary transaction details.
12
+ *
13
+ * This includes merchant identifier, total payment amount, currency code,
14
+ * individual payment items, and optional platform-specific configurations
15
+ * such as Apple Pay or Google Pay options.
16
+ */
3
17
  export declare class PEPaymentRequest {
18
+ /**
19
+ * The unique identifier for the merchant initiating the transaction.
20
+ */
4
21
  merchantId: string;
22
+ /**
23
+ * The total amount to be charged for the transaction.
24
+ */
5
25
  paymentAmount: number;
26
+ /**
27
+ * The currency code used for the transaction. Defaults to `'USD'`.
28
+ */
6
29
  currencyCode?: 'USD' | 'CAD';
30
+ /**
31
+ * List of items representing the breakdown of the transaction.
32
+ */
7
33
  paymentItems?: PESummaryItem[];
34
+ /**
35
+ * Platform-specific options for customizing the payment experience
36
+ * (e.g., Apple Pay or Google Pay settings).
37
+ */
8
38
  platformOptions?: RNPEPaymentOptions;
9
- constructor(merchantId: string, paymentAmount: number, currencyCode?: 'USD' | 'CAD', paymentItems?: {
10
- amount: number;
11
- label: string;
12
- }[], platformOptions?: RNPEPaymentOptions);
39
+ /**
40
+ * Constructs a new instance of [PEPaymentRequest].
41
+ *
42
+ * @param merchantId - The merchant's unique identifier.
43
+ * @param paymentAmount - The total transaction amount.
44
+ * @param currencyCode - The currency code (either `'USD'` or `'CAD'`).
45
+ * @param paymentItems - An array of individual summary items.
46
+ * @param platformOptions - Optional platform-specific payment configuration.
47
+ */
48
+ constructor(merchantId: string, paymentAmount: number, currencyCode?: 'USD' | 'CAD', paymentItems?: PESummaryItem[], platformOptions?: RNPEPaymentOptions);
13
49
  }
50
+ /**
51
+ * Represents an individual item in a payment transaction.
52
+ *
53
+ * Each item includes a label and an associated amount.
54
+ *
55
+ */
14
56
  export interface PESummaryItem {
15
- amount: number;
57
+ /** A descriptive label for the payment item (e.g., "Item 1"). */
16
58
  label: string;
59
+ /** The monetary amount for this item. */
60
+ amount: number;
17
61
  }
62
+ /**
63
+ * Contact fields that can be requested from the user during Apple Pay transactions.
64
+ *
65
+ * These fields specify what customer information (e.g., name, email, address) is required.
66
+ *
67
+ * @category Apple Pay
68
+ */
18
69
  export declare enum RNPEContactField {
70
+ /** The customer's full name. */
19
71
  name = "name",
72
+ /** The customer's postal address. */
20
73
  postalAddress = "postalAddress",
74
+ /** The customer's email address. */
21
75
  emailAddress = "emailAddress",
76
+ /** The customer's phone number. */
22
77
  phoneNumber = "phoneNumber",
78
+ /** The phonetic spelling of the customer's name. */
23
79
  phoneticName = "phoneticName"
24
80
  }
81
+ /**
82
+ * Options specific to Apple Pay payment flow.
83
+ *
84
+ * Includes configuration for required billing and shipping contact fields,
85
+ * as well as available shipping methods.
86
+ *
87
+ * @category Apple Pay
88
+ */
25
89
  export declare class RNPEApplePayOptions {
90
+ /**
91
+ * Contact fields required for billing (e.g., name, address).
92
+ */
26
93
  requiredBillingContactFields?: RNPEContactField[];
94
+ /**
95
+ * Contact fields required for shipping (e.g., phone number, address).
96
+ */
27
97
  requiredShippingContactFields?: RNPEContactField[];
98
+ /**
99
+ * List of available shipping methods shown to the user.
100
+ */
28
101
  shippingMethods?: PEApplePayShippingMethod[];
29
102
  constructor(params: {
30
103
  requiredBillingContactFields: RNPEContactField[];
@@ -32,19 +105,68 @@ export declare class RNPEApplePayOptions {
32
105
  shippingMethods: PEApplePayShippingMethod[];
33
106
  });
34
107
  }
108
+ /**
109
+ * Represents the billing address parameters for Google Pay in React Native.
110
+ *
111
+ * Specifies the address format and whether a phone number is required.
112
+ *
113
+ * @category Google Pay
114
+ */
35
115
  export declare class RNPEGooglePayBillingAddressParameters {
116
+ /**
117
+ * The format of the billing address.
118
+ *
119
+ * - `'FULL'`: Includes street, city, state, and postal code.
120
+ * - `'MIN'`: Minimal format with limited address details.
121
+ */
36
122
  format: 'FULL' | 'MIN';
123
+ /**
124
+ * Whether a phone number is required in the billing address.
125
+ */
37
126
  phoneNumberRequired: boolean;
38
127
  }
128
+ /**
129
+ * Represents the shipping address parameters for Google Pay in React Native.
130
+ *
131
+ * Specifies the allowed countries and whether a phone number is required.
132
+ *
133
+ * @category Google Pay
134
+ */
39
135
  export declare class RNPEGooglePayShippingAddressParameters {
136
+ /**
137
+ * A list of allowed country codes for shipping (e.g., `["US", "CA"]`).
138
+ */
40
139
  allowedCountryCodes?: string[];
140
+ /**
141
+ * Whether a phone number is required in the shipping address.
142
+ */
41
143
  phoneNumberRequired: boolean;
42
144
  }
145
+ /**
146
+ * A class representing Google Pay-specific payment options for React Native.
147
+ *
148
+ * This includes flags and parameters for requiring billing and shipping addresses.
149
+ *
150
+ * @category Google Pay
151
+ */
43
152
  export declare class RNPEGooglePayOptions {
153
+ /** Whether a billing address is required for the transaction. */
44
154
  billingAddressRequired: boolean;
45
- billingAddressParameters?: any;
155
+ /** Additional parameters for billing address collection (platform-specific). */
156
+ billingAddressParameters?: RNPEGooglePayBillingAddressParameters;
157
+ /** Whether a shipping address is required for the transaction. */
46
158
  shippingAddressRequired: boolean;
47
- shippingAddressParameters?: any;
159
+ /** Additional parameters for shipping address collection (platform-specific). */
160
+ shippingAddressParameters?: RNPEGooglePayShippingAddressParameters;
161
+ /**
162
+ * Creates a new instance of `RNPEGooglePayOptions`.
163
+ *
164
+ * @param params - The configuration object for Google Pay options.
165
+ * @param params.billingAddressRequired - Whether billing address is required.
166
+ * @param params.shippingAddressRequired - Whether shipping address is required.
167
+ * @param params.billingAddressParameters - Optional parameters for billing address.
168
+ * @param params.shippingAddressParameters - Optional parameters for shipping address.
169
+ */
48
170
  constructor(params: {
49
171
  billingAddressRequired: boolean;
50
172
  shippingAddressRequired: boolean;
@@ -52,4 +174,3 @@ export declare class RNPEGooglePayOptions {
52
174
  shippingAddressParameters?: RNPEGooglePayShippingAddressParameters;
53
175
  });
54
176
  }
55
- export {};