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
@@ -285,11 +285,8 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
285
285
  @import ObjectiveC;
286
286
  @import PassKit;
287
287
  @import UIKit;
288
- @import WebKit;
289
288
  #endif
290
289
 
291
- #import <PayEngineSDK/PayEngineSDK.h>
292
-
293
290
  #endif
294
291
  #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
295
292
  #pragma clang diagnostic ignored "-Wduplicate-method-arg"
@@ -309,7 +306,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
309
306
  #endif
310
307
 
311
308
  #if defined(__OBJC__)
309
+ /// Represents the supported Apple Pay payment networks.
312
310
  typedef SWIFT_ENUM(NSInteger, ApplePayPaymentNetwork, open) {
311
+ /// Supported Apple Pay payment networks.
313
312
  ApplePayPaymentNetworkAmex = 0,
314
313
  ApplePayPaymentNetworkCartesBancaires = 1,
315
314
  ApplePayPaymentNetworkDiscover = 2,
@@ -333,98 +332,234 @@ typedef SWIFT_ENUM(NSInteger, ApplePayPaymentNetwork, open) {
333
332
  @class NSString;
334
333
  @class PKShippingMethod;
335
334
 
335
+ /// A class that represents an Apple Pay payment request.
336
336
  SWIFT_CLASS("_TtC12PayEngineSDK22ApplePayPaymentRequest")
337
337
  @interface ApplePayPaymentRequest : NSObject
338
- /// Creates a Apple Pay request that can be used afterards to make an apple pay request
339
- /// <ul>
340
- /// <li>
341
- /// </li>
342
- /// </ul>
343
- /// \param currencyCode The currency code the transaction has default .USD
338
+ /// Configures the <code>ApplePayPaymentRequest</code> object to prepare for an Apple Pay transaction.
339
+ /// Use this method to set up the necessary details for an Apple Pay request, including the payment items, total amount, currency, and required contact fields.
340
+ /// This method initializes the payment details and configures the Apple Pay request accordingly.
341
+ /// \param paymentItems An array of <code>PKPaymentSummaryItem</code> representing the items to be displayed in the Apple Pay sheet. Defaults to an empty array.
344
342
  ///
345
- /// \param var paymentItems What are the items you want to show in the apple pay sheet default []
343
+ /// \param paymentAmount The total amount to be collected in the transaction.
346
344
  ///
347
- /// \param paymentAmount The total amount you want to collect
345
+ /// \param currencyCode The currency code for the transaction. Defaults to <code>"USD"</code>.
346
+ ///
347
+ /// \param requiredBillingContactFields A set of <code>PKContactField</code> values specifying the required billing contact fields. Defaults to an empty set.
348
+ ///
349
+ /// \param requiredShippingContactFields A set of <code>PKContactField</code> values specifying the required shipping contact fields. Defaults to an empty set.
350
+ ///
351
+ /// \param shippingMethods An array of <code>PKShippingMethod</code> representing the available shipping options. Defaults to an empty array .
348
352
  ///
349
353
  - (void)buildWithPaymentItems:(NSArray<PKPaymentSummaryItem *> * _Nonnull)paymentItems paymentAmount:(double)paymentAmount currencyCode:(NSString * _Nonnull)currencyCode requiredBillingContactFields:(NSSet<PKContactField> * _Nonnull)requiredBillingContactFields requiredShippingContactFields:(NSSet<PKContactField> * _Nonnull)requiredShippingContactFields shippingMethods:(NSArray<PKShippingMethod *> * _Nonnull)shippingMethods;
350
354
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
351
355
  @end
352
356
 
357
+ /// Represents the Apple Pay eligibility status for the current device and user.
353
358
  typedef SWIFT_ENUM(NSInteger, ApplePayStatus, open) {
354
- /// This means the current device/user has Apple pay activated and a card belongs to the given payment networks
359
+ /// The current device/user has Apple pay activated and a card belongs to the given payment networks
355
360
  ApplePayStatusEligible = 0,
356
- /// This means the current device/user has Apple pay activated but has no card belongs to the given payment networks
361
+ /// The current device/user has Apple pay activated but has no card belongs to the given payment networks
357
362
  ApplePayStatusNeedSetup = 1,
358
- /// This means the current device/user cannot use Apple pay from Apple
363
+ /// The current device/user cannot use Apple pay from Apple
359
364
  ApplePayStatusNotEligible = 2,
360
365
  };
361
366
 
362
367
 
368
+ /// Represents the details of a bank account.
369
+ /// This class stores essential bank account information such as routing number,
370
+ /// last four digits of the account number, and the account holder’s name.
363
371
  SWIFT_CLASS("_TtC12PayEngineSDK15BankAccountData")
364
372
  @interface BankAccountData : NSObject
365
- @property (nonatomic, copy) NSString * _Nonnull routingNumber;
366
- @property (nonatomic, copy) NSString * _Nonnull last4;
367
- @property (nonatomic, copy) NSString * _Nonnull firstName;
368
- @property (nonatomic, copy) NSString * _Nonnull lastName;
369
- - (nullable instancetype)initWithRoutingNumber:(NSString * _Nonnull)routingNumber last4:(NSString * _Nonnull)last4 firstName:(NSString * _Nonnull)firstName lastName:(NSString * _Nonnull)lastName error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
370
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
371
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
372
- @end
373
-
374
- @class PEBankAccount;
375
-
376
- SWIFT_CLASS("_TtC12PayEngineSDK19BankAccountResponse")
377
- @interface BankAccountResponse : NSObject
378
- - (nullable instancetype)initWithMessage:(NSString * _Nonnull)message data:(PEBankAccount * _Nonnull)data error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
373
+ /// The bank’s routing number.
374
+ @property (nonatomic, readonly, copy) NSString * _Nonnull routingNumber;
375
+ /// The last four digits of the bank account number.
376
+ @property (nonatomic, readonly, copy) NSString * _Nonnull last4;
377
+ /// The first name of the account holder.
378
+ @property (nonatomic, readonly, copy) NSString * _Nonnull firstName;
379
+ /// The last name of the account holder.
380
+ @property (nonatomic, readonly, copy) NSString * _Nonnull lastName;
379
381
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
380
382
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
381
383
  @end
382
384
 
383
385
 
386
+ /// Represents the details of a payment card.
387
+ /// This class stores essential card information such as brand, last four digits,
388
+ /// expiration date, and the cardholder’s name.
384
389
  SWIFT_CLASS("_TtC12PayEngineSDK8CardData")
385
390
  @interface CardData : NSObject
386
- @property (nonatomic, copy) NSString * _Nonnull id;
387
- @property (nonatomic, copy) NSString * _Nonnull brand;
388
- @property (nonatomic, copy) NSString * _Nonnull last4;
389
- @property (nonatomic) NSInteger expMonth;
390
- @property (nonatomic) NSInteger expYear;
391
- @property (nonatomic, copy) NSString * _Nonnull name;
392
- @property (nonatomic, copy) NSString * _Nullable addressZip;
393
- - (nullable instancetype)initWithId:(NSString * _Nonnull)id brand:(NSString * _Nonnull)brand last4:(NSString * _Nonnull)last4 expMonth:(NSInteger)expMonth expYear:(NSInteger)expYear name:(NSString * _Nonnull)name addressZip:(NSString * _Nullable)addressZip error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
391
+ /// The unique identifier for the card.
392
+ @property (nonatomic, readonly, copy) NSString * _Nonnull id;
393
+ /// The brand of the card (e.g., Visa, MasterCard).
394
+ @property (nonatomic, readonly, copy) NSString * _Nonnull brand;
395
+ /// The last four digits of the card number.
396
+ @property (nonatomic, readonly, copy) NSString * _Nonnull last4;
397
+ /// The expiration month of the card.
398
+ @property (nonatomic, readonly) NSInteger expMonth;
399
+ /// The expiration year of the card.
400
+ @property (nonatomic, readonly) NSInteger expYear;
401
+ /// The name of the cardholder.
402
+ @property (nonatomic, readonly, copy) NSString * _Nonnull name;
403
+ /// The ZIP code associated with the card’s billing address (optional).
404
+ @property (nonatomic, readonly, copy) NSString * _Nullable addressZip;
394
405
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
395
406
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
396
407
  @end
397
408
 
398
- @class PECard;
399
409
 
400
- SWIFT_CLASS("_TtC12PayEngineSDK12CardResponse")
401
- @interface CardResponse : NSObject
402
- - (nullable instancetype)initWithMessage:(NSString * _Nonnull)message data:(PECard * _Nonnull)data error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
403
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
404
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
405
- @end
406
-
407
-
408
- @class NSBundle;
410
+ @class PEBankAccount;
409
411
  @class NSCoder;
410
412
 
411
- SWIFT_CLASS("_TtC12PayEngineSDK28FraudAnalyticsViewController")
412
- @interface FraudAnalyticsViewController : KountAnalyticsViewController
413
- - (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER;
414
- - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
415
- @end
416
-
417
-
413
+ /// A secure view for entering a customer’s bank account information safely.
414
+ /// This view displays input fields required to securely collect bank account details.
415
+ /// It also provides methods to validate the provided information and saving a customer’s bank acount by securely storing the information in PayEngine’s system.
416
+ /// This view complies with PCI standards and does not store data locally.
417
+ /// Instead, it forwards the information to a PCI-compliant third party, which encrypts and transfers the bank account details to PayEngine’s system.
418
+ /// In addition to the required fields that the view sets up for you, you can also pass additional fields and specify whether they are required.
419
+ /// <h2>How It Works</h2>
420
+ /// Call the <code>PayEngine/createBankAccountView(additionalFields:completion:)-3gn3i</code> method on the <code>PayEngine</code> object to obtain an instance of <code>IBankAccountView</code>. You can also include additional fields if needed.
421
+ /// Use the <code>validate()</code> method to check if all fields pass validation.
422
+ /// Once all fields are valid, call the <code>createBankAccount(merchantId:completion:)</code> method to save the bank account in the PayEngine system.
423
+ /// <h2>Usage Example</h2>
424
+ /// \code
425
+ /// payengine.createBankAccountView(additionalFields: []) { [unowned self] result in
426
+ /// switch result {
427
+ /// case .success(let view): // This is where you get the `IBankAccountView` instance
428
+ /// DispatchQueue.main.async {
429
+ /// self.secureField = view
430
+ /// self.stackView.spacing = 20
431
+ /// self.stackView.addArrangedSubview(self.secureField)
432
+ ///
433
+ /// let button = UIButton(type: .system)
434
+ /// button.setTitle("Create Bank Account", for: .normal)
435
+ ///
436
+ /// // Register tap action, which will send the createBankAccount request
437
+ /// button.addTarget(self, action: #selector(self.onButtonTap), for: .touchUpInside)
438
+ ///
439
+ /// self.stackView.addArrangedSubview(button)
440
+ /// }
441
+ ///
442
+ /// case .failure(let error):
443
+ /// debugPrint("Error: \(error)")
444
+ /// }
445
+ /// }
446
+ ///
447
+ /// @objc func onButtonTap() {
448
+ /// secureField.createBankAccount(merchantId: MERCHANT_ID) { [unowned self] result in
449
+ /// switch result {
450
+ /// case .success(let data):
451
+ /// let alert = UIAlertController(
452
+ /// title: "Bank Account Created",
453
+ /// message: data.token,
454
+ /// preferredStyle: .alert
455
+ /// )
456
+ /// alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
457
+ /// self.present(alert, animated: true, completion: nil)
458
+ ///
459
+ /// case .failure(let error):
460
+ /// debugPrint("Error: \(error)")
461
+ /// }
462
+ /// }
463
+ /// }
464
+ ///
465
+ /// \endcode
418
466
  SWIFT_CLASS("_TtC12PayEngineSDK16IBankAccountView")
419
467
  @interface IBankAccountView : UIStackView
468
+ /// After the user has entered and validated their bank accoount information, this method can be called to save the bank account in the PayEngine system.
469
+ /// \param merchantId Your merchant’s ID.
470
+ ///
471
+ /// \param additionalData Additional data to be included along with the bank account information.
472
+ ///
473
+ /// \param completion Callback that provides an instance of the newly created <code>PEBankAccount</code> object.
474
+ ///
475
+ /// \param failure Callback that returns an error if the request fails.
476
+ ///
420
477
  - (void)createBankAccountWithMerchantId:(NSString * _Nullable)merchantId additionalData:(NSDictionary<NSString *, id> * _Nonnull)additionalData completion:(void (^ _Nonnull)(PEBankAccount * _Nonnull))completion failure:(void (^ _Nonnull)(NSError * _Nonnull))failure;
421
478
  - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
422
479
  - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
423
480
  @end
424
481
 
482
+ @class PECard;
425
483
 
484
+ /// A secure view for entering a customer’s payment card information safely.
485
+ /// This view displays input fields required to securely collect payment card details.
486
+ /// It also provides methods to validate the provided information and saving a customer’s card by securely storing the information in PayEngine’s system.
487
+ /// This view complies with PCI standards and does not store data locally.
488
+ /// Instead, it forwards the information to a PCI-compliant third party, which encrypts and transfers the card details to PayEngine’s system.
489
+ /// In addition to the required fields that the view sets up for you, you can also pass additional fields and specify whether they are required.
490
+ /// <h2>How It Works</h2>
491
+ /// Call the <code>PayEngine/createSecureView(additionalFields:completion:)-5x9ky</code> method on the <code>PayEngine</code> object to obtain an instance of <code>ICardNumberView</code>. You can also include additional fields if needed.
492
+ /// Use the <code>validate()</code> method to check if all fields pass validation.
493
+ /// Once all fields are valid, call the <code>createCard(merchantId:completion:)</code> method to save the card in the PayEngine system.
494
+ /// <h2>Usage Example</h2>
495
+ /// \code
496
+ /// let zipField = PEField(
497
+ /// name: "address_zip",
498
+ /// type: "text",
499
+ /// placeholder: "Zip code",
500
+ /// isRequired: true,
501
+ /// keyboardType: .alphabet,
502
+ /// pattern: #"^(?:\d{5}(?:-\d{4})?|[ABCEGHJKLMNPRSTVXY]\d[A-Z] ?\d[A-Z]\d)$"#
503
+ /// )
504
+ ///
505
+ /// payengine.createSecureView(additionalFields: [zipField]) { [unowned self] result in
506
+ /// switch result {
507
+ /// case .success(let view): // This is where you get the `ICardNumberView` instance
508
+ /// DispatchQueue.main.async {
509
+ /// self.secureField = view
510
+ /// self.stackView.spacing = 20
511
+ /// self.stackView.addArrangedSubview(self.secureField)
512
+ ///
513
+ /// let button = UIButton(type: .system)
514
+ /// button.setTitle("Create Card", for: .normal)
515
+ ///
516
+ /// // Register tap action, which will send the createCard request
517
+ /// button.addTarget(self, action: #selector(self.onButtonTap), for: .touchUpInside)
518
+ /// self.stackView.addArrangedSubview(button)
519
+ /// }
520
+ ///
521
+ /// case .failure(let error):
522
+ /// debugPrint("Error: \(error)")
523
+ /// }
524
+ /// }
525
+ ///
526
+ /// @objc func onButtonTap() {
527
+ /// let additionalData = ["test_data": true]
528
+ ///
529
+ /// secureField.createCard(merchantId: MERCHANT_ID, additionalData: additionalData) { [unowned self] result in
530
+ /// switch result {
531
+ /// case .success(let data):
532
+ /// let alert = UIAlertController(
533
+ /// title: "Card Created",
534
+ /// message: data.token,
535
+ /// preferredStyle: .alert
536
+ /// )
537
+ /// alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
538
+ ///
539
+ /// self.present(alert, animated: true, completion: nil)
540
+ /// self.cardToken = data.token
541
+ ///
542
+ /// debugPrint("Card token: \(data.token)")
543
+ /// self.saleButton.isHidden = false
544
+ ///
545
+ /// case .failure(let error):
546
+ /// debugPrint("Error: \(error)")
547
+ /// }
548
+ /// }
549
+ /// }
550
+ ///
551
+ /// \endcode
426
552
  SWIFT_CLASS("_TtC12PayEngineSDK15ICardNumberView")
427
553
  @interface ICardNumberView : UIStackView
554
+ /// After the user has entered and validated their card information, this method can be called to save the card in the PayEngine system.
555
+ /// \param merchantId Your merchant’s ID.
556
+ ///
557
+ /// \param additionalData Additional data to be included along with the card information.
558
+ ///
559
+ /// \param completion Callback that provides an instance of the newly created <code>PECard</code> object.
560
+ ///
561
+ /// \param failure Callback that returns an error if the request fails.
562
+ ///
428
563
  - (void)createCardWithMerchantId:(NSString * _Nullable)merchantId additionalData:(NSDictionary<NSString *, id> * _Nonnull)additionalData completion:(void (^ _Nonnull)(PECard * _Nonnull))completion failure:(void (^ _Nonnull)(NSError * _Nonnull))failure;
429
564
  - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
430
565
  - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
@@ -433,12 +568,62 @@ SWIFT_CLASS("_TtC12PayEngineSDK15ICardNumberView")
433
568
  @protocol PEApplePayDelegate;
434
569
  @class UIButton;
435
570
 
571
+ /// A class that facilitates Apple Pay transactions.
572
+ /// <blockquote>
573
+ /// Important: Making the object for this class is not allowed. The shared instance of this class provides methods to configure and initiate Apple Pay payments. The shared instance is managed internally and you don’t need to access it directly.
574
+ ///
575
+ /// </blockquote>
576
+ /// When you call the <code>PayEngine/setupApplePay(merchantId:completion:)</code> the shared instance gets returned to you in a completion callback.
577
+ /// Once you get the shared instance call this method <code>setupApplePayButton(for:type:style:)</code> to get a <code>UIButton</code> that triggers the Apple Pay payment flow when tapped.
578
+ /// <h2>Usage Example</h2>
579
+ /// \code
580
+ /// // The payengineSDK instance
581
+ /// let payengine = PayEngine(config: CONFIG)
582
+ /// payengine.setupApplePay(merchantId: "Your merchant's id") { result in
583
+ /// switch result {
584
+ /// case .success(let applePay): // This is where you get the singleton instance of `PEApplePay`
585
+ /// applePay.delegate = self
586
+ ///
587
+ /// let request = ApplePayPaymentRequest()
588
+ /// request.build(
589
+ /// paymentItems: [],
590
+ /// paymentAmount: 1.0,
591
+ /// currencyCode: "USD",
592
+ /// requiredBillingContactFields: [.name, .postalAddress],
593
+ /// requiredShippingContactFields: [.name, .emailAddress, .postalAddress],
594
+ /// shippingMethods: shippingMethods
595
+ /// )
596
+ ///
597
+ /// DispatchQueue.main.async {
598
+ /// if let applePayButton = applePay.setupApplePayButton(for: request, type: .checkout) {
599
+ /// // Add this button to your view hierarchy.
600
+ /// // When tapped, it will automatically start the Apple Pay payment flow.
601
+ /// }
602
+ /// }
603
+ ///
604
+ /// case .failure(let error):
605
+ /// print("Unable to setup Apple Pay: \(error)")
606
+ /// }
607
+ /// }
608
+ ///
609
+ /// \endcode
436
610
  SWIFT_CLASS("_TtC12PayEngineSDK10PEApplePay")
437
611
  @interface PEApplePay : NSObject
612
+ /// A delegate conforming to the <code>PEApplePayDelegate</code> protocol that handles Apple Pay events.
438
613
  @property (nonatomic, strong) id <PEApplePayDelegate> _Nullable delegate;
614
+ /// Creates and returns a <code>UIButton</code> styled as an Apple Pay button.
615
+ /// When the button is tapped, it initiates the Apple Pay authorization flow. Depending on the supported payment network,
616
+ /// the button may direct users to set up Apple Pay or proceed with a payment.
617
+ /// \param paymentRequest An <code>ApplePayPaymentRequest</code> containing details of the payment request.
618
+ ///
619
+ /// \param type The type of Apple Pay button (e.g., <code>.checkout</code>, <code>.book</code>). Default is <code>.checkout</code>.
620
+ ///
621
+ /// \param style The style of the button (e.g., <code>.black</code>, <code>.white</code>). Default is <code>.black</code>.
622
+ ///
623
+ ///
624
+ /// returns:
625
+ /// A <code>UIButton</code> configured for Apple Pay, or <code>nil</code> if Apple Pay is not available.
439
626
  - (UIButton * _Nullable)setupApplePayButtonFor:(ApplePayPaymentRequest * _Nonnull)paymentRequest type:(PKPaymentButtonType)type style:(PKPaymentButtonStyle)style SWIFT_WARN_UNUSED_RESULT;
440
- - (BOOL)startApplePayPaymentAndReturnError:(NSError * _Nullable * _Nullable)error;
441
- - (void)startApplePaySetup;
442
627
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
443
628
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
444
629
  @end
@@ -461,158 +646,270 @@ SWIFT_CLASS("_TtC12PayEngineSDK10PEApplePay")
461
646
 
462
647
  enum PEApplePayResult : NSInteger;
463
648
 
649
+ /// A delegate protocol that provides callbacks for various events during the Apple Pay transaction process.
650
+ /// This protocol notifies the conforming delegate about errors, UI status updates, payment token retrieval,
651
+ /// and optional user interactions such as selecting shipping or payment methods.
464
652
  SWIFT_PROTOCOL("_TtP12PayEngineSDK18PEApplePayDelegate_")
465
653
  @protocol PEApplePayDelegate
654
+ /// Called when an error occurs during the Apple Pay transaction.
655
+ /// \param error The error that occurred.
656
+ ///
466
657
  - (void)paymentErrorWithError:(NSError * _Nonnull)error;
658
+ /// Called when the Apple Pay payment sheet is dismissed.
659
+ /// This can occur when the user cancels the payment request or when the payment is successfully completed.
467
660
  - (void)paymentSheetDidMDismiss;
661
+ /// Called when a payment token is successfully received after Apple Pay authorization.
662
+ /// \param token The payment token received from Apple Pay.
663
+ ///
664
+ /// \param metadata Additional metadata related to the transaction, if available.
665
+ ///
666
+ /// \param billingContact The user’s billing contact information.
667
+ ///
668
+ /// \param shippingContact The user’s shipping contact information.
669
+ ///
670
+ /// \param completion A completion handler that must be called with a <code>PEApplePayResult</code> value.
671
+ ///
468
672
  - (void)paymentTokenDidReturnWithToken:(NSString * _Nonnull)token metadata:(NSDictionary<NSString *, id> * _Nullable)metadata billingContact:(PKContact * _Nullable)billingContact shippingContact:(PKContact * _Nullable)shippingContact completion:(void (^ _Nonnull)(enum PEApplePayResult))completion;
673
+ /// Called when a payment token is unavailable due to an error during token exchange.
674
+ /// \param error The error that occurred, if available.
675
+ ///
469
676
  - (void)paymentTokenNotAvailableWithError:(NSError * _Nullable)error;
470
677
  @optional
678
+ /// Called when the user selects a shipping contact during checkout.
679
+ /// \param contact The selected shipping contact.
680
+ ///
681
+ /// \param completion A handler that must be called with a <code>PKPaymentRequestShippingContactUpdate</code> to update the shipping details.
682
+ ///
471
683
  - (void)didSelectShippingContact:(PKContact * _Nonnull)contact handler:(void (^ _Nonnull)(PKPaymentRequestShippingContactUpdate * _Nonnull))completion SWIFT_AVAILABILITY(ios,introduced=11.0);
684
+ /// Called when the user selects a shipping method.
685
+ /// \param shippingMethod The selected shipping method.
686
+ ///
687
+ /// \param completion A handler that must be called with a <code>PKPaymentRequestShippingMethodUpdate</code> to update the shipping method details.
688
+ ///
472
689
  - (void)didSelectShippingMethod:(PKShippingMethod * _Nonnull)shippingMethod handler:(void (^ _Nonnull)(PKPaymentRequestShippingMethodUpdate * _Nonnull))completion SWIFT_AVAILABILITY(ios,introduced=11.0);
690
+ /// Called when the user selects a payment method.
691
+ /// \param paymentMethod The selected payment method.
692
+ ///
693
+ /// \param completion A handler that must be called with a <code>PKPaymentRequestPaymentMethodUpdate</code> to update the payment method details.
694
+ ///
473
695
  - (void)didSelectPaymentMethod:(PKPaymentMethod * _Nonnull)paymentMethod handler:(void (^ _Nonnull)(PKPaymentRequestPaymentMethodUpdate * _Nonnull))completion SWIFT_AVAILABILITY(ios,introduced=11.0);
474
696
  @end
475
697
 
698
+ /// An enum representing the Apple Payment Result’s success or failure.
476
699
  typedef SWIFT_ENUM(NSInteger, PEApplePayResult, open) {
700
+ /// Success if the payment was successful..
477
701
  PEApplePayResultSuccess = 0,
702
+ /// Failiure if the payment was not successful.
478
703
  PEApplePayResultFailure = 1,
479
704
  };
480
705
 
481
706
 
482
- /// PayEngine Card object
707
+ /// A PayEngine bank account object.
708
+ /// This class represents a bank account stored within PayEngine, containing a secure token
709
+ /// and account details.
483
710
  SWIFT_CLASS("_TtC12PayEngineSDK13PEBankAccount")
484
711
  @interface PEBankAccount : NSObject
485
- @property (nonatomic, copy) NSString * _Nonnull token;
486
- @property (nonatomic, strong) BankAccountData * _Nonnull bankAccountData;
487
- - (nullable instancetype)initWithToken:(NSString * _Nonnull)token bankAccountData:(BankAccountData * _Nonnull)bankAccountData error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
712
+ /// A unique token representing the bank account.
713
+ @property (nonatomic, readonly, copy) NSString * _Nonnull token;
714
+ /// The associated bank account details.
715
+ @property (nonatomic, readonly, strong) BankAccountData * _Nonnull bankAccountData;
488
716
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
489
717
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
490
718
  @end
491
719
 
492
720
 
493
- SWIFT_CLASS("_TtC12PayEngineSDK17PEBankAccountView")
494
- @interface PEBankAccountView : IBankAccountView
495
- - (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
496
- - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
497
- - (void)didMoveToSuperview;
498
- - (void)layoutSubviews;
499
- @end
500
-
501
-
502
- /// PayEngine Card object
721
+ /// A PayEngine card object.
722
+ /// This class represents a payment card stored with PayEngine, containing a secure token
723
+ /// and associated card details.
503
724
  SWIFT_CLASS("_TtC12PayEngineSDK6PECard")
504
725
  @interface PECard : NSObject
505
- @property (nonatomic, copy) NSString * _Nonnull token;
506
- @property (nonatomic, strong) CardData * _Nonnull cardData;
507
- - (nullable instancetype)initWithToken:(NSString * _Nonnull)token cardData:(CardData * _Nonnull)cardData error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
726
+ /// A unique token representing the card.
727
+ @property (nonatomic, readonly, copy) NSString * _Nonnull token;
728
+ /// The associated card details.
729
+ @property (nonatomic, readonly, strong) CardData * _Nonnull cardData;
508
730
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
509
731
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
510
732
  @end
511
733
 
512
- @class PEConfig;
513
- @class WKUserContentController;
514
- @class WKScriptMessage;
515
-
516
- /// PEComponent
517
- SWIFT_CLASS("_TtC12PayEngineSDK11PEComponent")
518
- @interface PEComponent : UIView <WKScriptMessageHandler>
519
- - (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
520
- - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
521
- - (void)didMoveToSuperview;
522
- - (void)setupWithConfig:(PEConfig * _Nonnull)config componentName:(NSString * _Nonnull)componentName props:(NSDictionary<NSString *, NSString *> * _Nonnull)props;
523
- - (void)pinToView:(UIView * _Nonnull)view;
524
- - (void)registerEventWithName:(NSString * _Nonnull)name handler:(void (^ _Nonnull)(id _Nonnull))handler;
525
- - (void)removeEventWithName:(NSString * _Nonnull)name;
526
- - (void)userContentController:(WKUserContentController * _Nonnull)userContentController didReceiveScriptMessage:(WKScriptMessage * _Nonnull)message;
527
- @end
528
-
529
734
 
530
- /// PayEngine configuration
735
+ /// A class that is used to configure the <code>PayEngine</code> object.
736
+ /// This class stores the authentication key that is generated by PayEngine. It also defines the PayEngine’s backend environement which the <code>PayEngine</code> object will interact with.
531
737
  SWIFT_CLASS("_TtC12PayEngineSDK8PEConfig")
532
738
  @interface PEConfig : NSObject
739
+ /// Constructor for the <code>PEConfig</code> class
740
+ /// \param publicKey PayEngine public key.
741
+ ///
742
+ /// \param baseURL Base URL for your custom environemnt. Default is <code>nil</code>. If set as <code>nil</code> the object will setup the environment based on the value of the <code>publicKey</code>.
743
+ ///
533
744
  - (nonnull instancetype)initWithPublicKey:(NSString * _Nonnull)publicKey baseURL:(NSString * _Nullable)baseURL OBJC_DESIGNATED_INITIALIZER;
745
+ /// Returns the base url with which the <code>PayEngine</code> object interacts with.
746
+ ///
747
+ /// returns:
748
+ /// A Base URL. If no url was provided when constructing the object, then this method will return a url based on the <code>publicKey</code> provided in the <code>init(publicKey:baseURL:)</code>
534
749
  - (NSString * _Nonnull)getBaseURL SWIFT_WARN_UNUSED_RESULT;
750
+ /// To check if the environment is set as production.
751
+ ///
752
+ /// returns:
753
+ /// Returns <code>true</code> if the environment is set as live. Returns <code>false</code> otherwise.
535
754
  - (BOOL)isProduction SWIFT_WARN_UNUSED_RESULT;
536
755
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
537
756
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
538
757
  @end
539
758
 
540
759
 
760
+ /// A type that represents an input field.
761
+ /// This class defines an input field with properties that determine its behavior, such as its name, type, placeholder,
762
+ /// whether it is required, keyboard type, and optional validation pattern.
763
+ /// Internal UI components use this type to create input fields that adhere to the specified input criteria.
541
764
  SWIFT_CLASS("_TtC12PayEngineSDK7PEField")
542
765
  @interface PEField : NSObject
766
+ /// The name of the field.
767
+ @property (nonatomic, copy) NSString * _Nonnull name;
768
+ /// The type of the field.
769
+ @property (nonatomic, copy) NSString * _Nonnull type;
770
+ /// The placeholder text displayed when the field is empty.
771
+ @property (nonatomic, copy) NSString * _Nonnull placeholder;
772
+ /// A Boolean value indicating whether the field is required.
773
+ /// If <code>true</code>, the field must contain a value before submission.
774
+ @property (nonatomic) BOOL isRequired;
775
+ /// A regular expression pattern used to validate the field’s input.
776
+ /// If <code>nil</code>, no validation is performed.
777
+ @property (nonatomic, copy) NSString * _Nullable pattern;
543
778
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
544
779
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
545
780
  @end
546
781
 
547
-
548
- /// PEPaymentView
549
- SWIFT_CLASS("_TtC12PayEngineSDK13PEPaymentView")
550
- @interface PEPaymentView : ICardNumberView
551
- - (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
552
- - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
553
- - (void)didMoveToSuperview;
554
- - (void)layoutSubviews;
555
- - (void)setupWithVaultId:(NSString * _Nonnull)vaultId env:(NSString * _Nonnull)env publicKey:(NSString * _Nonnull)publicKey additionalFields:(NSArray<PEField *> * _Nonnull)additionalFields;
556
- - (BOOL)validate SWIFT_WARN_UNUSED_RESULT;
557
- - (void)showKeyboard;
558
- @end
559
-
782
+ /// Color Theme for the SDK.
560
783
  typedef SWIFT_ENUM(NSInteger, PEThemeMode, open) {
561
784
  PEThemeModeSystem = 0,
562
785
  PEThemeModeDark = 1,
563
786
  PEThemeModeLight = 2,
564
787
  };
565
788
 
789
+ @class UIView;
566
790
  @class ThreeDSResult;
567
791
 
568
- /// PayEngine Main Class
792
+ /// <code>PayEngine</code> is the main entry point for integrating PayEngine’s payment processing features.
793
+ /// This class provides a centralized interface for:
794
+ /// <ul>
795
+ /// <li>
796
+ /// Secure card and bank account entry
797
+ /// </li>
798
+ /// <li>
799
+ /// Apple Pay integration
800
+ /// </li>
801
+ /// <li>
802
+ /// Fraud monitoring and 3D Secure authentication
803
+ /// </li>
804
+ /// </ul>
805
+ /// <h2>Key Features</h2>
806
+ /// <h3>Secure Payment Views</h3>
807
+ /// <ul>
808
+ /// <li>
809
+ /// Supports secure card entry via <code>createSecureView(additionalFields:completion:)</code>
810
+ /// </li>
811
+ /// <li>
812
+ /// Supports secure bank account entry via <code>createBankAccountView(additionalFields:completion:)</code>
813
+ /// </li>
814
+ /// <li>
815
+ /// PCI-compliant data handling with external encryption and tokenization
816
+ /// </li>
817
+ /// </ul>
818
+ /// <h3>Apple Pay Integration</h3>
819
+ /// <ul>
820
+ /// <li>
821
+ /// Detects Apple Pay availability
822
+ /// </li>
823
+ /// <li>
824
+ /// Provides Apple Pay button creation
825
+ /// </li>
826
+ /// <li>
827
+ /// Manages Apple Pay transaction processing
828
+ /// </li>
829
+ /// </ul>
830
+ /// <h3>Fraud Monitoring & 3D Secure</h3>
831
+ /// <ul>
832
+ /// <li>
833
+ /// Creates fraud monitoring sessions via <code>createFraudMonitorSession(merchantId:completion:)</code>
834
+ /// </li>
835
+ /// <li>
836
+ /// Supports 3D Secure authentication via <code>perform3DSFlow(view:threeDSData:handler:)</code>
837
+ /// </li>
838
+ /// </ul>
839
+ /// <h2>Usage Example</h2>
840
+ /// \code
841
+ /// // Initialize PayEngine
842
+ /// let payEngine = PayEngine(config: config)
843
+ ///
844
+ /// // Create a secure card entry view
845
+ /// payEngine.createSecureView(additionalFields: []) { result in
846
+ /// switch result {
847
+ /// case .success(let view):
848
+ /// self.view.addSubview(view)
849
+ /// case .failure(let error):
850
+ /// print("Error: \(error)")
851
+ /// }
852
+ /// }
853
+ ///
854
+ /// \endcodeseealso:
855
+ /// <code>ICardNumberView</code>, <code>IBankAccountView</code>, <code>PEApplePay</code>
569
856
  SWIFT_CLASS("_TtC12PayEngineSDK9PayEngine")
570
857
  @interface PayEngine : NSObject
571
- /// Constructor
572
- /// \param config PayEngine configuration
858
+ /// Initializes the <code>PayEngine</code> with the given configuration.
859
+ /// \param config The configuration object <code>PEConfig</code> containing necessary settings.
573
860
  ///
574
861
  - (nonnull instancetype)initWithConfig:(PEConfig * _Nonnull)config OBJC_DESIGNATED_INITIALIZER;
862
+ /// Sets the theme mode for the PayEngine UI components.
863
+ /// \param themeMode The desired theme mode <code>PEThemeMode</code>.
864
+ ///
575
865
  + (void)setThemeMode:(enum PEThemeMode)themMode;
576
- - (PEComponent * _Nonnull)createComponentWithName:(NSString * _Nonnull)name props:(NSDictionary<NSString *, NSString *> * _Nonnull)props SWIFT_WARN_UNUSED_RESULT;
866
+ /// Creates a secure card entry view for collecting payment details.
867
+ /// \param additionalFields Optional additional fields to be included of type <code>PEField</code>.
868
+ ///
869
+ /// \param completion A closure returning the <code>ICardNumberView</code> instance.
870
+ ///
577
871
  - (void)createSecureViewWithAdditionalFields:(NSArray<PEField *> * _Nullable)additionalFields completion:(void (^ _Nonnull)(ICardNumberView * _Nonnull))completion;
872
+ /// Creates a secure bank account entry view.
873
+ /// \param additionalFields Optional additional fields to be included.
874
+ ///
875
+ /// \param completion A closure returning the <code>IBankAccountView</code> instance.
876
+ ///
578
877
  - (void)createBankAccountViewWithAdditionalFields:(NSArray<PEField *> * _Nullable)additionalFields completion:(void (^ _Nonnull)(IBankAccountView * _Nonnull))completion;
878
+ /// Retrieves browser-related information.
879
+ /// \param view The UI view in which the web view is embedded.
880
+ ///
881
+ /// \param handler A closure returning browser details as a <code>String</code>.
882
+ ///
579
883
  - (void)getBrowserInfoWithView:(UIView * _Nonnull)view handler:(void (^ _Nonnull)(NSString * _Nonnull))handler;
884
+ /// Initiates a 3D Secure authentication process.
885
+ /// \param view The UI view in which the 3D Secure flow should be presented.
886
+ ///
887
+ /// \param threeDSData The authentication data required for 3D Secure.
888
+ ///
889
+ /// \param handler A closure returning the <code>ThreeDSResult</code> upon completion.
890
+ ///
580
891
  - (void)perform3DSFlowWithView:(UIView * _Nonnull)view threeDSData:(NSString * _Nonnull)threeDSData handler:(void (^ _Nonnull)(ThreeDSResult * _Nonnull))handler;
892
+ /// Creates a fraud monitoring session.
893
+ /// \param merchantId The merchant’s unique identifier.
894
+ ///
895
+ /// \param completion A closure returning the fraud monitoring session ID as a <code>String</code>.
896
+ ///
581
897
  - (void)createFraudMonitorSessionWithMerchantId:(NSString * _Nonnull)merchantId completion:(void (^ _Nonnull)(NSString * _Nonnull))completion;
582
898
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
583
899
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
584
900
  @end
585
901
 
586
902
 
587
- SWIFT_CLASS("_TtC12PayEngineSDK14ThreeDSMessage")
588
- @interface ThreeDSMessage : NSObject
589
- - (nullable instancetype)initWithType:(NSString * _Nonnull)type subtype:(NSString * _Nonnull)subtype data:(ThreeDSResult * _Nullable)data error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
590
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
591
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
592
- @end
593
-
594
- @class WKWebView;
595
- @class WKNavigationAction;
596
- @class WKNavigation;
597
-
598
- SWIFT_CLASS("_TtC12PayEngineSDK12ThreeDSModal")
599
- @interface ThreeDSModal : UIView <WKNavigationDelegate, WKScriptMessageHandler>
600
- - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
601
- - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
602
- - (void)setupWithConfig:(PEConfig * _Nonnull)config threeDSData:(NSString * _Nonnull)threeDSData handler:(void (^ _Nonnull)(ThreeDSResult * _Nonnull))handler;
603
- - (void)setupWebView;
604
- - (void)webView:(WKWebView * _Nonnull)webView decidePolicyForNavigationAction:(WKNavigationAction * _Nonnull)navigationAction decisionHandler:(void (^ _Nonnull)(WKNavigationActionPolicy))decisionHandler;
605
- - (void)webView:(WKWebView * _Nonnull)webView didFinishNavigation:(WKNavigation * _Null_unspecified)navigation;
606
- - (void)userContentController:(WKUserContentController * _Nonnull)userContentController didReceiveScriptMessage:(WKScriptMessage * _Nonnull)message;
607
- @end
608
-
609
903
 
904
+ /// Type that represents the result for the ThreeDS process
610
905
  SWIFT_CLASS("_TtC12PayEngineSDK13ThreeDSResult")
611
906
  @interface ThreeDSResult : NSObject
612
- @property (nonatomic, copy) NSString * _Nullable message;
613
- @property (nonatomic) BOOL success;
614
- @property (nonatomic, copy) NSString * _Nullable transactionId;
615
- - (nullable instancetype)initWithMessage:(NSString * _Nullable)message success:(BOOL)success transactionId:(NSString * _Nullable)transactionId error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
907
+ /// The message for the result
908
+ @property (nonatomic, readonly, copy) NSString * _Nullable message;
909
+ /// Bool indicating whether the transaction was successful or not
910
+ @property (nonatomic, readonly) BOOL success;
911
+ /// Transaction ID resulting after the ThreeDS Flow completion
912
+ @property (nonatomic, readonly, copy) NSString * _Nullable transactionId;
616
913
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
617
914
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
618
915
  @end