react-native-payengine 2.0.17 → 2.0.18-alpha.2

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 (157) 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/Info.plist +5 -5
  11. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KDataCollector.h +4 -25
  12. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +0 -20
  13. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountPrivate.h +61 -0
  14. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +430 -149
  15. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Info.plist +0 -0
  16. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.abi.json +1785 -5517
  17. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +35 -129
  18. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface-e +35 -129
  19. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  20. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface +35 -129
  21. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface-e +35 -129
  22. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/PayEngineSDK +0 -0
  23. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
  24. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
  25. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KDataCollector.h +4 -25
  26. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +0 -20
  27. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountPrivate.h +61 -0
  28. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +860 -298
  29. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Info.plist +0 -0
  30. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1785 -5517
  31. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +35 -129
  32. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface-e +35 -129
  33. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  34. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +35 -129
  35. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface-e +35 -129
  36. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1785 -5517
  37. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +35 -129
  38. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface-e +35 -129
  39. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  40. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +35 -129
  41. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface-e +35 -129
  42. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/PayEngineSDK +0 -0
  43. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
  44. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
  45. package/ios/Sources/Classes/RNPEEventEmitter.swift +1 -1
  46. package/ios/Sources/Classes/RNPayEngineNative.swift +125 -64
  47. package/ios/Sources/Classes/SecureFields/RNPEEvents.swift +1 -0
  48. package/ios/Sources/Payengine.m +6 -0
  49. package/lib/commonjs/components/PayEngine.js +1 -1
  50. package/lib/commonjs/components/PayEngine.js.map +1 -1
  51. package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js +124 -0
  52. package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -1
  53. package/lib/commonjs/components/v2/ApplePay/PEApplePayInterfaces.js +78 -0
  54. package/lib/commonjs/components/v2/ApplePay/PEApplePayInterfaces.js.map +1 -1
  55. package/lib/commonjs/components/v2/GooglePay/PEGooglePayAddress.js.map +1 -1
  56. package/lib/commonjs/components/v2/GooglePay/PEGooglePayButton.js +53 -0
  57. package/lib/commonjs/components/v2/GooglePay/PEGooglePayButton.js.map +1 -1
  58. package/lib/commonjs/components/v2/PEPaymentRequest.js +121 -0
  59. package/lib/commonjs/components/v2/PEPaymentRequest.js.map +1 -1
  60. package/lib/commonjs/components/v2/PayEngineNative.js +182 -4
  61. package/lib/commonjs/components/v2/PayEngineNative.js.map +1 -1
  62. package/lib/commonjs/components/v2/PayEngineProvider.js +52 -0
  63. package/lib/commonjs/components/v2/PayEngineProvider.js.map +1 -1
  64. package/lib/commonjs/components/v2/SecureFields/BankAccountView.js +71 -0
  65. package/lib/commonjs/components/v2/SecureFields/BankAccountView.js.map +1 -1
  66. package/lib/commonjs/components/v2/SecureFields/CreditCardView.js +82 -0
  67. package/lib/commonjs/components/v2/SecureFields/CreditCardView.js.map +1 -1
  68. package/lib/commonjs/components/v2/SecureFields/IPEField.js.map +1 -1
  69. package/lib/commonjs/components/v2/SecureFields/ITokenizationData.js.map +1 -1
  70. package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js.map +1 -1
  71. package/lib/commonjs/components/v2/SecureFields/PECard.js.map +1 -1
  72. package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js +20 -3
  73. package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js.map +1 -1
  74. package/lib/commonjs/index.js +17 -13
  75. package/lib/commonjs/index.js.map +1 -1
  76. package/lib/commonjs/interfaces/index.js +20 -0
  77. package/lib/commonjs/interfaces/index.js.map +1 -1
  78. package/lib/commonjs/utils/index.js +26 -0
  79. package/lib/commonjs/utils/index.js.map +1 -1
  80. package/lib/module/components/PayEngine.js +1 -1
  81. package/lib/module/components/PayEngine.js.map +1 -1
  82. package/lib/module/components/v2/ApplePay/PEApplePayButton.js +124 -0
  83. package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -1
  84. package/lib/module/components/v2/ApplePay/PEApplePayInterfaces.js +75 -0
  85. package/lib/module/components/v2/ApplePay/PEApplePayInterfaces.js.map +1 -1
  86. package/lib/module/components/v2/GooglePay/PEGooglePayAddress.js.map +1 -1
  87. package/lib/module/components/v2/GooglePay/PEGooglePayButton.js +53 -0
  88. package/lib/module/components/v2/GooglePay/PEGooglePayButton.js.map +1 -1
  89. package/lib/module/components/v2/PEPaymentRequest.js +119 -0
  90. package/lib/module/components/v2/PEPaymentRequest.js.map +1 -1
  91. package/lib/module/components/v2/PayEngineNative.js +184 -5
  92. package/lib/module/components/v2/PayEngineNative.js.map +1 -1
  93. package/lib/module/components/v2/PayEngineProvider.js +51 -0
  94. package/lib/module/components/v2/PayEngineProvider.js.map +1 -1
  95. package/lib/module/components/v2/SecureFields/BankAccountView.js +71 -0
  96. package/lib/module/components/v2/SecureFields/BankAccountView.js.map +1 -1
  97. package/lib/module/components/v2/SecureFields/CreditCardView.js +82 -0
  98. package/lib/module/components/v2/SecureFields/CreditCardView.js.map +1 -1
  99. package/lib/module/components/v2/SecureFields/IPEField.js.map +1 -1
  100. package/lib/module/components/v2/SecureFields/ITokenizationData.js.map +1 -1
  101. package/lib/module/components/v2/SecureFields/PEBankAccount.js.map +1 -1
  102. package/lib/module/components/v2/SecureFields/PECard.js.map +1 -1
  103. package/lib/module/components/v2/SecureFields/PEKeyboardType.js +16 -1
  104. package/lib/module/components/v2/SecureFields/PEKeyboardType.js.map +1 -1
  105. package/lib/module/index.js +10 -5
  106. package/lib/module/index.js.map +1 -1
  107. package/lib/module/interfaces/index.js +19 -0
  108. package/lib/module/interfaces/index.js.map +1 -1
  109. package/lib/module/utils/index.js +27 -0
  110. package/lib/module/utils/index.js.map +1 -1
  111. package/lib/typescript/components/PayEngine.d.ts +1 -1
  112. package/lib/typescript/components/v2/ApplePay/PEApplePayButton.d.ts +217 -12
  113. package/lib/typescript/components/v2/ApplePay/PEApplePayInterfaces.d.ts +180 -1
  114. package/lib/typescript/components/v2/GooglePay/PEGooglePayAddress.d.ts +30 -0
  115. package/lib/typescript/components/v2/GooglePay/PEGooglePayButton.d.ts +99 -0
  116. package/lib/typescript/components/v2/PEPaymentRequest.d.ts +130 -9
  117. package/lib/typescript/components/v2/PayEngineNative.d.ts +165 -7
  118. package/lib/typescript/components/v2/PayEngineProvider.d.ts +51 -0
  119. package/lib/typescript/components/v2/SecureFields/BankAccountView.d.ts +103 -0
  120. package/lib/typescript/components/v2/SecureFields/CreditCardView.d.ts +114 -0
  121. package/lib/typescript/components/v2/SecureFields/IPEField.d.ts +49 -0
  122. package/lib/typescript/components/v2/SecureFields/ITokenizationData.d.ts +14 -0
  123. package/lib/typescript/components/v2/SecureFields/PEBankAccount.d.ts +36 -0
  124. package/lib/typescript/components/v2/SecureFields/PECard.d.ts +44 -0
  125. package/lib/typescript/components/v2/SecureFields/PEKeyboardType.d.ts +16 -1
  126. package/lib/typescript/index.d.ts +11 -5
  127. package/lib/typescript/interfaces/index.d.ts +35 -1
  128. package/lib/typescript/utils/index.d.ts +21 -0
  129. package/package.json +6 -3
  130. package/src/components/PayEngine.tsx +1 -1
  131. package/src/components/v2/ApplePay/PEApplePayButton.tsx +225 -12
  132. package/src/components/v2/ApplePay/PEApplePayInterfaces.ts +221 -8
  133. package/src/components/v2/GooglePay/PEGooglePayAddress.ts +39 -1
  134. package/src/components/v2/GooglePay/PEGooglePayButton.tsx +113 -9
  135. package/src/components/v2/PEPaymentRequest.ts +151 -13
  136. package/src/components/v2/PayEngineNative.tsx +196 -9
  137. package/src/components/v2/PayEngineProvider.tsx +52 -1
  138. package/src/components/v2/SecureFields/BankAccountView.tsx +108 -1
  139. package/src/components/v2/SecureFields/CreditCardView.tsx +118 -1
  140. package/src/components/v2/SecureFields/IPEField.ts +55 -0
  141. package/src/components/v2/SecureFields/ITokenizationData.ts +17 -2
  142. package/src/components/v2/SecureFields/PEBankAccount.ts +42 -0
  143. package/src/components/v2/SecureFields/PECard.ts +52 -0
  144. package/src/components/v2/SecureFields/PEKeyboardType.ts +18 -1
  145. package/src/index.tsx +23 -5
  146. package/src/interfaces/index.ts +40 -2
  147. package/src/utils/index.ts +21 -0
  148. package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
  149. package/android/.gradle/6.1.1/fileChanges/last-build.bin +0 -0
  150. package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
  151. package/android/.gradle/6.1.1/gc.properties +0 -0
  152. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/CustomWindow.h +0 -25
  153. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +0 -33
  154. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +0 -27
  155. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/CustomWindow.h +0 -25
  156. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +0 -33
  157. 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,114 +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;
379
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
380
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
381
- @end
382
-
383
-
384
- SWIFT_CLASS("_TtC12PayEngineSDK24BankAccountResponseError")
385
- @interface BankAccountResponseError : NSObject
386
- - (nullable instancetype)initWithError:(BOOL)error message:(NSString * _Nonnull)message 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;
387
381
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
388
382
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
389
383
  @end
390
384
 
391
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.
392
389
  SWIFT_CLASS("_TtC12PayEngineSDK8CardData")
393
390
  @interface CardData : NSObject
394
- @property (nonatomic, copy) NSString * _Nonnull id;
395
- @property (nonatomic, copy) NSString * _Nonnull brand;
396
- @property (nonatomic, copy) NSString * _Nonnull last4;
397
- @property (nonatomic) NSInteger expMonth;
398
- @property (nonatomic) NSInteger expYear;
399
- @property (nonatomic, copy) NSString * _Nonnull name;
400
- @property (nonatomic, copy) NSString * _Nullable addressZip;
401
- - (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;
402
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
403
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
404
- @end
405
-
406
- @class PECard;
407
-
408
- SWIFT_CLASS("_TtC12PayEngineSDK12CardResponse")
409
- @interface CardResponse : NSObject
410
- - (nullable instancetype)initWithMessage:(NSString * _Nonnull)message data:(PECard * _Nonnull)data error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
411
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
412
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
413
- @end
414
-
415
-
416
- SWIFT_CLASS("_TtC12PayEngineSDK17CardResponseError")
417
- @interface CardResponseError : NSObject
418
- - (nullable instancetype)initWithError:(BOOL)error message:(NSString * _Nonnull)message 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;
419
405
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
420
406
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
421
407
  @end
422
408
 
423
409
 
424
- @class NSBundle;
410
+ @class PEBankAccount;
425
411
  @class NSCoder;
426
412
 
427
- SWIFT_CLASS("_TtC12PayEngineSDK28FraudAnalyticsViewController")
428
- @interface FraudAnalyticsViewController : KountAnalyticsViewController
429
- - (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER;
430
- - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
431
- @end
432
-
433
-
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
434
466
  SWIFT_CLASS("_TtC12PayEngineSDK16IBankAccountView")
435
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
+ ///
436
477
  - (void)createBankAccountWithMerchantId:(NSString * _Nullable)merchantId additionalData:(NSDictionary<NSString *, id> * _Nonnull)additionalData completion:(void (^ _Nonnull)(PEBankAccount * _Nonnull))completion failure:(void (^ _Nonnull)(NSError * _Nonnull))failure;
437
478
  - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
438
479
  - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
439
480
  @end
440
481
 
482
+ @class PECard;
441
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
442
552
  SWIFT_CLASS("_TtC12PayEngineSDK15ICardNumberView")
443
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
+ ///
444
563
  - (void)createCardWithMerchantId:(NSString * _Nullable)merchantId additionalData:(NSDictionary<NSString *, id> * _Nonnull)additionalData completion:(void (^ _Nonnull)(PECard * _Nonnull))completion failure:(void (^ _Nonnull)(NSError * _Nonnull))failure;
445
564
  - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
446
565
  - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
@@ -449,12 +568,62 @@ SWIFT_CLASS("_TtC12PayEngineSDK15ICardNumberView")
449
568
  @protocol PEApplePayDelegate;
450
569
  @class UIButton;
451
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
452
610
  SWIFT_CLASS("_TtC12PayEngineSDK10PEApplePay")
453
611
  @interface PEApplePay : NSObject
612
+ /// A delegate conforming to the <code>PEApplePayDelegate</code> protocol that handles Apple Pay events.
454
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.
455
626
  - (UIButton * _Nullable)setupApplePayButtonFor:(ApplePayPaymentRequest * _Nonnull)paymentRequest type:(PKPaymentButtonType)type style:(PKPaymentButtonStyle)style SWIFT_WARN_UNUSED_RESULT;
456
- - (BOOL)startApplePayPaymentAndReturnError:(NSError * _Nullable * _Nullable)error;
457
- - (void)startApplePaySetup;
458
627
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
459
628
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
460
629
  @end
@@ -477,158 +646,270 @@ SWIFT_CLASS("_TtC12PayEngineSDK10PEApplePay")
477
646
 
478
647
  enum PEApplePayResult : NSInteger;
479
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.
480
652
  SWIFT_PROTOCOL("_TtP12PayEngineSDK18PEApplePayDelegate_")
481
653
  @protocol PEApplePayDelegate
654
+ /// Called when an error occurs during the Apple Pay transaction.
655
+ /// \param error The error that occurred.
656
+ ///
482
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.
483
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
+ ///
484
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
+ ///
485
676
  - (void)paymentTokenNotAvailableWithError:(NSError * _Nullable)error;
486
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
+ ///
487
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
+ ///
488
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
+ ///
489
695
  - (void)didSelectPaymentMethod:(PKPaymentMethod * _Nonnull)paymentMethod handler:(void (^ _Nonnull)(PKPaymentRequestPaymentMethodUpdate * _Nonnull))completion SWIFT_AVAILABILITY(ios,introduced=11.0);
490
696
  @end
491
697
 
698
+ /// An enum representing the Apple Payment Result’s success or failure.
492
699
  typedef SWIFT_ENUM(NSInteger, PEApplePayResult, open) {
700
+ /// Success if the payment was successful..
493
701
  PEApplePayResultSuccess = 0,
702
+ /// Failiure if the payment was not successful.
494
703
  PEApplePayResultFailure = 1,
495
704
  };
496
705
 
497
706
 
498
- /// 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.
499
710
  SWIFT_CLASS("_TtC12PayEngineSDK13PEBankAccount")
500
711
  @interface PEBankAccount : NSObject
501
- @property (nonatomic, copy) NSString * _Nonnull token;
502
- @property (nonatomic, strong) BankAccountData * _Nonnull bankAccountData;
503
- - (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;
504
716
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
505
717
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
506
718
  @end
507
719
 
508
720
 
509
- SWIFT_CLASS("_TtC12PayEngineSDK17PEBankAccountView")
510
- @interface PEBankAccountView : IBankAccountView
511
- - (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
512
- - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
513
- - (void)didMoveToSuperview;
514
- - (void)layoutSubviews;
515
- @end
516
-
517
-
518
- /// 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.
519
724
  SWIFT_CLASS("_TtC12PayEngineSDK6PECard")
520
725
  @interface PECard : NSObject
521
- @property (nonatomic, copy) NSString * _Nonnull token;
522
- @property (nonatomic, strong) CardData * _Nonnull cardData;
523
- - (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;
524
730
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
525
731
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
526
732
  @end
527
733
 
528
- @class PEConfig;
529
- @class WKUserContentController;
530
- @class WKScriptMessage;
531
-
532
- /// PEComponent
533
- SWIFT_CLASS("_TtC12PayEngineSDK11PEComponent")
534
- @interface PEComponent : UIView <WKScriptMessageHandler>
535
- - (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
536
- - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
537
- - (void)didMoveToSuperview;
538
- - (void)setupWithConfig:(PEConfig * _Nonnull)config componentName:(NSString * _Nonnull)componentName props:(NSDictionary<NSString *, NSString *> * _Nonnull)props;
539
- - (void)pinToView:(UIView * _Nonnull)view;
540
- - (void)registerEventWithName:(NSString * _Nonnull)name handler:(void (^ _Nonnull)(id _Nonnull))handler;
541
- - (void)removeEventWithName:(NSString * _Nonnull)name;
542
- - (void)userContentController:(WKUserContentController * _Nonnull)userContentController didReceiveScriptMessage:(WKScriptMessage * _Nonnull)message;
543
- @end
544
734
 
545
-
546
- /// 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.
547
737
  SWIFT_CLASS("_TtC12PayEngineSDK8PEConfig")
548
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
+ ///
549
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>
550
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.
551
754
  - (BOOL)isProduction SWIFT_WARN_UNUSED_RESULT;
552
755
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
553
756
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
554
757
  @end
555
758
 
556
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.
557
764
  SWIFT_CLASS("_TtC12PayEngineSDK7PEField")
558
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;
559
778
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
560
779
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
561
780
  @end
562
781
 
563
-
564
- /// PEPaymentView
565
- SWIFT_CLASS("_TtC12PayEngineSDK13PEPaymentView")
566
- @interface PEPaymentView : ICardNumberView
567
- - (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
568
- - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
569
- - (void)didMoveToSuperview;
570
- - (void)layoutSubviews;
571
- - (void)setupWithVaultId:(NSString * _Nonnull)vaultId env:(NSString * _Nonnull)env hostname:(NSString * _Nonnull)hostname publicKey:(NSString * _Nonnull)publicKey additionalFields:(NSArray<PEField *> * _Nonnull)additionalFields;
572
- - (BOOL)validate SWIFT_WARN_UNUSED_RESULT;
573
- - (void)showKeyboard;
574
- @end
575
-
782
+ /// Color Theme for the SDK.
576
783
  typedef SWIFT_ENUM(NSInteger, PEThemeMode, open) {
577
784
  PEThemeModeSystem = 0,
578
785
  PEThemeModeDark = 1,
579
786
  PEThemeModeLight = 2,
580
787
  };
581
788
 
789
+ @class UIView;
582
790
  @class ThreeDSResult;
583
791
 
584
- /// 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>
585
856
  SWIFT_CLASS("_TtC12PayEngineSDK9PayEngine")
586
857
  @interface PayEngine : NSObject
587
- /// Constructor
588
- /// \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.
589
860
  ///
590
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
+ ///
591
865
  + (void)setThemeMode:(enum PEThemeMode)themMode;
592
- - (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
+ ///
593
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
+ ///
594
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
+ ///
595
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
+ ///
596
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
+ ///
597
897
  - (void)createFraudMonitorSessionWithMerchantId:(NSString * _Nonnull)merchantId completion:(void (^ _Nonnull)(NSString * _Nonnull))completion;
598
898
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
599
899
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
600
900
  @end
601
901
 
602
902
 
603
- SWIFT_CLASS("_TtC12PayEngineSDK14ThreeDSMessage")
604
- @interface ThreeDSMessage : NSObject
605
- - (nullable instancetype)initWithType:(NSString * _Nonnull)type subtype:(NSString * _Nonnull)subtype data:(ThreeDSResult * _Nullable)data error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
606
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
607
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
608
- @end
609
-
610
- @class WKWebView;
611
- @class WKNavigationAction;
612
- @class WKNavigation;
613
-
614
- SWIFT_CLASS("_TtC12PayEngineSDK12ThreeDSModal")
615
- @interface ThreeDSModal : UIView <WKNavigationDelegate, WKScriptMessageHandler>
616
- - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
617
- - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
618
- - (void)setupWithConfig:(PEConfig * _Nonnull)config threeDSData:(NSString * _Nonnull)threeDSData handler:(void (^ _Nonnull)(ThreeDSResult * _Nonnull))handler;
619
- - (void)setupWebView;
620
- - (void)webView:(WKWebView * _Nonnull)webView decidePolicyForNavigationAction:(WKNavigationAction * _Nonnull)navigationAction decisionHandler:(void (^ _Nonnull)(WKNavigationActionPolicy))decisionHandler;
621
- - (void)webView:(WKWebView * _Nonnull)webView didFinishNavigation:(WKNavigation * _Null_unspecified)navigation;
622
- - (void)userContentController:(WKUserContentController * _Nonnull)userContentController didReceiveScriptMessage:(WKScriptMessage * _Nonnull)message;
623
- @end
624
-
625
903
 
904
+ /// Type that represents the result for the ThreeDS process
626
905
  SWIFT_CLASS("_TtC12PayEngineSDK13ThreeDSResult")
627
906
  @interface ThreeDSResult : NSObject
628
- @property (nonatomic, copy) NSString * _Nullable message;
629
- @property (nonatomic) BOOL success;
630
- @property (nonatomic, copy) NSString * _Nullable transactionId;
631
- - (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;
632
913
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
633
914
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
634
915
  @end
@@ -936,11 +1217,8 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
936
1217
  @import ObjectiveC;
937
1218
  @import PassKit;
938
1219
  @import UIKit;
939
- @import WebKit;
940
1220
  #endif
941
1221
 
942
- #import <PayEngineSDK/PayEngineSDK.h>
943
-
944
1222
  #endif
945
1223
  #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
946
1224
  #pragma clang diagnostic ignored "-Wduplicate-method-arg"
@@ -960,7 +1238,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
960
1238
  #endif
961
1239
 
962
1240
  #if defined(__OBJC__)
1241
+ /// Represents the supported Apple Pay payment networks.
963
1242
  typedef SWIFT_ENUM(NSInteger, ApplePayPaymentNetwork, open) {
1243
+ /// Supported Apple Pay payment networks.
964
1244
  ApplePayPaymentNetworkAmex = 0,
965
1245
  ApplePayPaymentNetworkCartesBancaires = 1,
966
1246
  ApplePayPaymentNetworkDiscover = 2,
@@ -984,114 +1264,234 @@ typedef SWIFT_ENUM(NSInteger, ApplePayPaymentNetwork, open) {
984
1264
  @class NSString;
985
1265
  @class PKShippingMethod;
986
1266
 
1267
+ /// A class that represents an Apple Pay payment request.
987
1268
  SWIFT_CLASS("_TtC12PayEngineSDK22ApplePayPaymentRequest")
988
1269
  @interface ApplePayPaymentRequest : NSObject
989
- /// Creates a Apple Pay request that can be used afterards to make an apple pay request
990
- /// <ul>
991
- /// <li>
992
- /// </li>
993
- /// </ul>
994
- /// \param currencyCode The currency code the transaction has default .USD
1270
+ /// Configures the <code>ApplePayPaymentRequest</code> object to prepare for an Apple Pay transaction.
1271
+ /// 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.
1272
+ /// This method initializes the payment details and configures the Apple Pay request accordingly.
1273
+ /// \param paymentItems An array of <code>PKPaymentSummaryItem</code> representing the items to be displayed in the Apple Pay sheet. Defaults to an empty array.
995
1274
  ///
996
- /// \param var paymentItems What are the items you want to show in the apple pay sheet default []
1275
+ /// \param paymentAmount The total amount to be collected in the transaction.
997
1276
  ///
998
- /// \param paymentAmount The total amount you want to collect
1277
+ /// \param currencyCode The currency code for the transaction. Defaults to <code>"USD"</code>.
1278
+ ///
1279
+ /// \param requiredBillingContactFields A set of <code>PKContactField</code> values specifying the required billing contact fields. Defaults to an empty set.
1280
+ ///
1281
+ /// \param requiredShippingContactFields A set of <code>PKContactField</code> values specifying the required shipping contact fields. Defaults to an empty set.
1282
+ ///
1283
+ /// \param shippingMethods An array of <code>PKShippingMethod</code> representing the available shipping options. Defaults to an empty array .
999
1284
  ///
1000
1285
  - (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;
1001
1286
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
1002
1287
  @end
1003
1288
 
1289
+ /// Represents the Apple Pay eligibility status for the current device and user.
1004
1290
  typedef SWIFT_ENUM(NSInteger, ApplePayStatus, open) {
1005
- /// This means the current device/user has Apple pay activated and a card belongs to the given payment networks
1291
+ /// The current device/user has Apple pay activated and a card belongs to the given payment networks
1006
1292
  ApplePayStatusEligible = 0,
1007
- /// This means the current device/user has Apple pay activated but has no card belongs to the given payment networks
1293
+ /// The current device/user has Apple pay activated but has no card belongs to the given payment networks
1008
1294
  ApplePayStatusNeedSetup = 1,
1009
- /// This means the current device/user cannot use Apple pay from Apple
1295
+ /// The current device/user cannot use Apple pay from Apple
1010
1296
  ApplePayStatusNotEligible = 2,
1011
1297
  };
1012
1298
 
1013
1299
 
1300
+ /// Represents the details of a bank account.
1301
+ /// This class stores essential bank account information such as routing number,
1302
+ /// last four digits of the account number, and the account holder’s name.
1014
1303
  SWIFT_CLASS("_TtC12PayEngineSDK15BankAccountData")
1015
1304
  @interface BankAccountData : NSObject
1016
- @property (nonatomic, copy) NSString * _Nonnull routingNumber;
1017
- @property (nonatomic, copy) NSString * _Nonnull last4;
1018
- @property (nonatomic, copy) NSString * _Nonnull firstName;
1019
- @property (nonatomic, copy) NSString * _Nonnull lastName;
1020
- - (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;
1021
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1022
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1023
- @end
1024
-
1025
- @class PEBankAccount;
1026
-
1027
- SWIFT_CLASS("_TtC12PayEngineSDK19BankAccountResponse")
1028
- @interface BankAccountResponse : NSObject
1029
- - (nullable instancetype)initWithMessage:(NSString * _Nonnull)message data:(PEBankAccount * _Nonnull)data error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
1030
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1031
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1032
- @end
1033
-
1034
-
1035
- SWIFT_CLASS("_TtC12PayEngineSDK24BankAccountResponseError")
1036
- @interface BankAccountResponseError : NSObject
1037
- - (nullable instancetype)initWithError:(BOOL)error message:(NSString * _Nonnull)message error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
1305
+ /// The bank’s routing number.
1306
+ @property (nonatomic, readonly, copy) NSString * _Nonnull routingNumber;
1307
+ /// The last four digits of the bank account number.
1308
+ @property (nonatomic, readonly, copy) NSString * _Nonnull last4;
1309
+ /// The first name of the account holder.
1310
+ @property (nonatomic, readonly, copy) NSString * _Nonnull firstName;
1311
+ /// The last name of the account holder.
1312
+ @property (nonatomic, readonly, copy) NSString * _Nonnull lastName;
1038
1313
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1039
1314
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1040
1315
  @end
1041
1316
 
1042
1317
 
1318
+ /// Represents the details of a payment card.
1319
+ /// This class stores essential card information such as brand, last four digits,
1320
+ /// expiration date, and the cardholder’s name.
1043
1321
  SWIFT_CLASS("_TtC12PayEngineSDK8CardData")
1044
1322
  @interface CardData : NSObject
1045
- @property (nonatomic, copy) NSString * _Nonnull id;
1046
- @property (nonatomic, copy) NSString * _Nonnull brand;
1047
- @property (nonatomic, copy) NSString * _Nonnull last4;
1048
- @property (nonatomic) NSInteger expMonth;
1049
- @property (nonatomic) NSInteger expYear;
1050
- @property (nonatomic, copy) NSString * _Nonnull name;
1051
- @property (nonatomic, copy) NSString * _Nullable addressZip;
1052
- - (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;
1053
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1054
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1055
- @end
1056
-
1057
- @class PECard;
1058
-
1059
- SWIFT_CLASS("_TtC12PayEngineSDK12CardResponse")
1060
- @interface CardResponse : NSObject
1061
- - (nullable instancetype)initWithMessage:(NSString * _Nonnull)message data:(PECard * _Nonnull)data error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
1062
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1063
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1064
- @end
1065
-
1066
-
1067
- SWIFT_CLASS("_TtC12PayEngineSDK17CardResponseError")
1068
- @interface CardResponseError : NSObject
1069
- - (nullable instancetype)initWithError:(BOOL)error message:(NSString * _Nonnull)message error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
1323
+ /// The unique identifier for the card.
1324
+ @property (nonatomic, readonly, copy) NSString * _Nonnull id;
1325
+ /// The brand of the card (e.g., Visa, MasterCard).
1326
+ @property (nonatomic, readonly, copy) NSString * _Nonnull brand;
1327
+ /// The last four digits of the card number.
1328
+ @property (nonatomic, readonly, copy) NSString * _Nonnull last4;
1329
+ /// The expiration month of the card.
1330
+ @property (nonatomic, readonly) NSInteger expMonth;
1331
+ /// The expiration year of the card.
1332
+ @property (nonatomic, readonly) NSInteger expYear;
1333
+ /// The name of the cardholder.
1334
+ @property (nonatomic, readonly, copy) NSString * _Nonnull name;
1335
+ /// The ZIP code associated with the card’s billing address (optional).
1336
+ @property (nonatomic, readonly, copy) NSString * _Nullable addressZip;
1070
1337
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1071
1338
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1072
1339
  @end
1073
1340
 
1074
1341
 
1075
- @class NSBundle;
1342
+ @class PEBankAccount;
1076
1343
  @class NSCoder;
1077
1344
 
1078
- SWIFT_CLASS("_TtC12PayEngineSDK28FraudAnalyticsViewController")
1079
- @interface FraudAnalyticsViewController : KountAnalyticsViewController
1080
- - (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER;
1081
- - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
1082
- @end
1083
-
1084
-
1345
+ /// A secure view for entering a customer’s bank account information safely.
1346
+ /// This view displays input fields required to securely collect bank account details.
1347
+ /// 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.
1348
+ /// This view complies with PCI standards and does not store data locally.
1349
+ /// Instead, it forwards the information to a PCI-compliant third party, which encrypts and transfers the bank account details to PayEngine’s system.
1350
+ /// 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.
1351
+ /// <h2>How It Works</h2>
1352
+ /// 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.
1353
+ /// Use the <code>validate()</code> method to check if all fields pass validation.
1354
+ /// Once all fields are valid, call the <code>createBankAccount(merchantId:completion:)</code> method to save the bank account in the PayEngine system.
1355
+ /// <h2>Usage Example</h2>
1356
+ /// \code
1357
+ /// payengine.createBankAccountView(additionalFields: []) { [unowned self] result in
1358
+ /// switch result {
1359
+ /// case .success(let view): // This is where you get the `IBankAccountView` instance
1360
+ /// DispatchQueue.main.async {
1361
+ /// self.secureField = view
1362
+ /// self.stackView.spacing = 20
1363
+ /// self.stackView.addArrangedSubview(self.secureField)
1364
+ ///
1365
+ /// let button = UIButton(type: .system)
1366
+ /// button.setTitle("Create Bank Account", for: .normal)
1367
+ ///
1368
+ /// // Register tap action, which will send the createBankAccount request
1369
+ /// button.addTarget(self, action: #selector(self.onButtonTap), for: .touchUpInside)
1370
+ ///
1371
+ /// self.stackView.addArrangedSubview(button)
1372
+ /// }
1373
+ ///
1374
+ /// case .failure(let error):
1375
+ /// debugPrint("Error: \(error)")
1376
+ /// }
1377
+ /// }
1378
+ ///
1379
+ /// @objc func onButtonTap() {
1380
+ /// secureField.createBankAccount(merchantId: MERCHANT_ID) { [unowned self] result in
1381
+ /// switch result {
1382
+ /// case .success(let data):
1383
+ /// let alert = UIAlertController(
1384
+ /// title: "Bank Account Created",
1385
+ /// message: data.token,
1386
+ /// preferredStyle: .alert
1387
+ /// )
1388
+ /// alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
1389
+ /// self.present(alert, animated: true, completion: nil)
1390
+ ///
1391
+ /// case .failure(let error):
1392
+ /// debugPrint("Error: \(error)")
1393
+ /// }
1394
+ /// }
1395
+ /// }
1396
+ ///
1397
+ /// \endcode
1085
1398
  SWIFT_CLASS("_TtC12PayEngineSDK16IBankAccountView")
1086
1399
  @interface IBankAccountView : UIStackView
1400
+ /// 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.
1401
+ /// \param merchantId Your merchant’s ID.
1402
+ ///
1403
+ /// \param additionalData Additional data to be included along with the bank account information.
1404
+ ///
1405
+ /// \param completion Callback that provides an instance of the newly created <code>PEBankAccount</code> object.
1406
+ ///
1407
+ /// \param failure Callback that returns an error if the request fails.
1408
+ ///
1087
1409
  - (void)createBankAccountWithMerchantId:(NSString * _Nullable)merchantId additionalData:(NSDictionary<NSString *, id> * _Nonnull)additionalData completion:(void (^ _Nonnull)(PEBankAccount * _Nonnull))completion failure:(void (^ _Nonnull)(NSError * _Nonnull))failure;
1088
1410
  - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
1089
1411
  - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
1090
1412
  @end
1091
1413
 
1414
+ @class PECard;
1092
1415
 
1416
+ /// A secure view for entering a customer’s payment card information safely.
1417
+ /// This view displays input fields required to securely collect payment card details.
1418
+ /// It also provides methods to validate the provided information and saving a customer’s card by securely storing the information in PayEngine’s system.
1419
+ /// This view complies with PCI standards and does not store data locally.
1420
+ /// Instead, it forwards the information to a PCI-compliant third party, which encrypts and transfers the card details to PayEngine’s system.
1421
+ /// 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.
1422
+ /// <h2>How It Works</h2>
1423
+ /// 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.
1424
+ /// Use the <code>validate()</code> method to check if all fields pass validation.
1425
+ /// Once all fields are valid, call the <code>createCard(merchantId:completion:)</code> method to save the card in the PayEngine system.
1426
+ /// <h2>Usage Example</h2>
1427
+ /// \code
1428
+ /// let zipField = PEField(
1429
+ /// name: "address_zip",
1430
+ /// type: "text",
1431
+ /// placeholder: "Zip code",
1432
+ /// isRequired: true,
1433
+ /// keyboardType: .alphabet,
1434
+ /// pattern: #"^(?:\d{5}(?:-\d{4})?|[ABCEGHJKLMNPRSTVXY]\d[A-Z] ?\d[A-Z]\d)$"#
1435
+ /// )
1436
+ ///
1437
+ /// payengine.createSecureView(additionalFields: [zipField]) { [unowned self] result in
1438
+ /// switch result {
1439
+ /// case .success(let view): // This is where you get the `ICardNumberView` instance
1440
+ /// DispatchQueue.main.async {
1441
+ /// self.secureField = view
1442
+ /// self.stackView.spacing = 20
1443
+ /// self.stackView.addArrangedSubview(self.secureField)
1444
+ ///
1445
+ /// let button = UIButton(type: .system)
1446
+ /// button.setTitle("Create Card", for: .normal)
1447
+ ///
1448
+ /// // Register tap action, which will send the createCard request
1449
+ /// button.addTarget(self, action: #selector(self.onButtonTap), for: .touchUpInside)
1450
+ /// self.stackView.addArrangedSubview(button)
1451
+ /// }
1452
+ ///
1453
+ /// case .failure(let error):
1454
+ /// debugPrint("Error: \(error)")
1455
+ /// }
1456
+ /// }
1457
+ ///
1458
+ /// @objc func onButtonTap() {
1459
+ /// let additionalData = ["test_data": true]
1460
+ ///
1461
+ /// secureField.createCard(merchantId: MERCHANT_ID, additionalData: additionalData) { [unowned self] result in
1462
+ /// switch result {
1463
+ /// case .success(let data):
1464
+ /// let alert = UIAlertController(
1465
+ /// title: "Card Created",
1466
+ /// message: data.token,
1467
+ /// preferredStyle: .alert
1468
+ /// )
1469
+ /// alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
1470
+ ///
1471
+ /// self.present(alert, animated: true, completion: nil)
1472
+ /// self.cardToken = data.token
1473
+ ///
1474
+ /// debugPrint("Card token: \(data.token)")
1475
+ /// self.saleButton.isHidden = false
1476
+ ///
1477
+ /// case .failure(let error):
1478
+ /// debugPrint("Error: \(error)")
1479
+ /// }
1480
+ /// }
1481
+ /// }
1482
+ ///
1483
+ /// \endcode
1093
1484
  SWIFT_CLASS("_TtC12PayEngineSDK15ICardNumberView")
1094
1485
  @interface ICardNumberView : UIStackView
1486
+ /// After the user has entered and validated their card information, this method can be called to save the card in the PayEngine system.
1487
+ /// \param merchantId Your merchant’s ID.
1488
+ ///
1489
+ /// \param additionalData Additional data to be included along with the card information.
1490
+ ///
1491
+ /// \param completion Callback that provides an instance of the newly created <code>PECard</code> object.
1492
+ ///
1493
+ /// \param failure Callback that returns an error if the request fails.
1494
+ ///
1095
1495
  - (void)createCardWithMerchantId:(NSString * _Nullable)merchantId additionalData:(NSDictionary<NSString *, id> * _Nonnull)additionalData completion:(void (^ _Nonnull)(PECard * _Nonnull))completion failure:(void (^ _Nonnull)(NSError * _Nonnull))failure;
1096
1496
  - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
1097
1497
  - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
@@ -1100,12 +1500,62 @@ SWIFT_CLASS("_TtC12PayEngineSDK15ICardNumberView")
1100
1500
  @protocol PEApplePayDelegate;
1101
1501
  @class UIButton;
1102
1502
 
1503
+ /// A class that facilitates Apple Pay transactions.
1504
+ /// <blockquote>
1505
+ /// 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.
1506
+ ///
1507
+ /// </blockquote>
1508
+ /// When you call the <code>PayEngine/setupApplePay(merchantId:completion:)</code> the shared instance gets returned to you in a completion callback.
1509
+ /// 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.
1510
+ /// <h2>Usage Example</h2>
1511
+ /// \code
1512
+ /// // The payengineSDK instance
1513
+ /// let payengine = PayEngine(config: CONFIG)
1514
+ /// payengine.setupApplePay(merchantId: "Your merchant's id") { result in
1515
+ /// switch result {
1516
+ /// case .success(let applePay): // This is where you get the singleton instance of `PEApplePay`
1517
+ /// applePay.delegate = self
1518
+ ///
1519
+ /// let request = ApplePayPaymentRequest()
1520
+ /// request.build(
1521
+ /// paymentItems: [],
1522
+ /// paymentAmount: 1.0,
1523
+ /// currencyCode: "USD",
1524
+ /// requiredBillingContactFields: [.name, .postalAddress],
1525
+ /// requiredShippingContactFields: [.name, .emailAddress, .postalAddress],
1526
+ /// shippingMethods: shippingMethods
1527
+ /// )
1528
+ ///
1529
+ /// DispatchQueue.main.async {
1530
+ /// if let applePayButton = applePay.setupApplePayButton(for: request, type: .checkout) {
1531
+ /// // Add this button to your view hierarchy.
1532
+ /// // When tapped, it will automatically start the Apple Pay payment flow.
1533
+ /// }
1534
+ /// }
1535
+ ///
1536
+ /// case .failure(let error):
1537
+ /// print("Unable to setup Apple Pay: \(error)")
1538
+ /// }
1539
+ /// }
1540
+ ///
1541
+ /// \endcode
1103
1542
  SWIFT_CLASS("_TtC12PayEngineSDK10PEApplePay")
1104
1543
  @interface PEApplePay : NSObject
1544
+ /// A delegate conforming to the <code>PEApplePayDelegate</code> protocol that handles Apple Pay events.
1105
1545
  @property (nonatomic, strong) id <PEApplePayDelegate> _Nullable delegate;
1546
+ /// Creates and returns a <code>UIButton</code> styled as an Apple Pay button.
1547
+ /// When the button is tapped, it initiates the Apple Pay authorization flow. Depending on the supported payment network,
1548
+ /// the button may direct users to set up Apple Pay or proceed with a payment.
1549
+ /// \param paymentRequest An <code>ApplePayPaymentRequest</code> containing details of the payment request.
1550
+ ///
1551
+ /// \param type The type of Apple Pay button (e.g., <code>.checkout</code>, <code>.book</code>). Default is <code>.checkout</code>.
1552
+ ///
1553
+ /// \param style The style of the button (e.g., <code>.black</code>, <code>.white</code>). Default is <code>.black</code>.
1554
+ ///
1555
+ ///
1556
+ /// returns:
1557
+ /// A <code>UIButton</code> configured for Apple Pay, or <code>nil</code> if Apple Pay is not available.
1106
1558
  - (UIButton * _Nullable)setupApplePayButtonFor:(ApplePayPaymentRequest * _Nonnull)paymentRequest type:(PKPaymentButtonType)type style:(PKPaymentButtonStyle)style SWIFT_WARN_UNUSED_RESULT;
1107
- - (BOOL)startApplePayPaymentAndReturnError:(NSError * _Nullable * _Nullable)error;
1108
- - (void)startApplePaySetup;
1109
1559
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1110
1560
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1111
1561
  @end
@@ -1128,158 +1578,270 @@ SWIFT_CLASS("_TtC12PayEngineSDK10PEApplePay")
1128
1578
 
1129
1579
  enum PEApplePayResult : NSInteger;
1130
1580
 
1581
+ /// A delegate protocol that provides callbacks for various events during the Apple Pay transaction process.
1582
+ /// This protocol notifies the conforming delegate about errors, UI status updates, payment token retrieval,
1583
+ /// and optional user interactions such as selecting shipping or payment methods.
1131
1584
  SWIFT_PROTOCOL("_TtP12PayEngineSDK18PEApplePayDelegate_")
1132
1585
  @protocol PEApplePayDelegate
1586
+ /// Called when an error occurs during the Apple Pay transaction.
1587
+ /// \param error The error that occurred.
1588
+ ///
1133
1589
  - (void)paymentErrorWithError:(NSError * _Nonnull)error;
1590
+ /// Called when the Apple Pay payment sheet is dismissed.
1591
+ /// This can occur when the user cancels the payment request or when the payment is successfully completed.
1134
1592
  - (void)paymentSheetDidMDismiss;
1593
+ /// Called when a payment token is successfully received after Apple Pay authorization.
1594
+ /// \param token The payment token received from Apple Pay.
1595
+ ///
1596
+ /// \param metadata Additional metadata related to the transaction, if available.
1597
+ ///
1598
+ /// \param billingContact The user’s billing contact information.
1599
+ ///
1600
+ /// \param shippingContact The user’s shipping contact information.
1601
+ ///
1602
+ /// \param completion A completion handler that must be called with a <code>PEApplePayResult</code> value.
1603
+ ///
1135
1604
  - (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;
1605
+ /// Called when a payment token is unavailable due to an error during token exchange.
1606
+ /// \param error The error that occurred, if available.
1607
+ ///
1136
1608
  - (void)paymentTokenNotAvailableWithError:(NSError * _Nullable)error;
1137
1609
  @optional
1610
+ /// Called when the user selects a shipping contact during checkout.
1611
+ /// \param contact The selected shipping contact.
1612
+ ///
1613
+ /// \param completion A handler that must be called with a <code>PKPaymentRequestShippingContactUpdate</code> to update the shipping details.
1614
+ ///
1138
1615
  - (void)didSelectShippingContact:(PKContact * _Nonnull)contact handler:(void (^ _Nonnull)(PKPaymentRequestShippingContactUpdate * _Nonnull))completion SWIFT_AVAILABILITY(ios,introduced=11.0);
1616
+ /// Called when the user selects a shipping method.
1617
+ /// \param shippingMethod The selected shipping method.
1618
+ ///
1619
+ /// \param completion A handler that must be called with a <code>PKPaymentRequestShippingMethodUpdate</code> to update the shipping method details.
1620
+ ///
1139
1621
  - (void)didSelectShippingMethod:(PKShippingMethod * _Nonnull)shippingMethod handler:(void (^ _Nonnull)(PKPaymentRequestShippingMethodUpdate * _Nonnull))completion SWIFT_AVAILABILITY(ios,introduced=11.0);
1622
+ /// Called when the user selects a payment method.
1623
+ /// \param paymentMethod The selected payment method.
1624
+ ///
1625
+ /// \param completion A handler that must be called with a <code>PKPaymentRequestPaymentMethodUpdate</code> to update the payment method details.
1626
+ ///
1140
1627
  - (void)didSelectPaymentMethod:(PKPaymentMethod * _Nonnull)paymentMethod handler:(void (^ _Nonnull)(PKPaymentRequestPaymentMethodUpdate * _Nonnull))completion SWIFT_AVAILABILITY(ios,introduced=11.0);
1141
1628
  @end
1142
1629
 
1630
+ /// An enum representing the Apple Payment Result’s success or failure.
1143
1631
  typedef SWIFT_ENUM(NSInteger, PEApplePayResult, open) {
1632
+ /// Success if the payment was successful..
1144
1633
  PEApplePayResultSuccess = 0,
1634
+ /// Failiure if the payment was not successful.
1145
1635
  PEApplePayResultFailure = 1,
1146
1636
  };
1147
1637
 
1148
1638
 
1149
- /// PayEngine Card object
1639
+ /// A PayEngine bank account object.
1640
+ /// This class represents a bank account stored within PayEngine, containing a secure token
1641
+ /// and account details.
1150
1642
  SWIFT_CLASS("_TtC12PayEngineSDK13PEBankAccount")
1151
1643
  @interface PEBankAccount : NSObject
1152
- @property (nonatomic, copy) NSString * _Nonnull token;
1153
- @property (nonatomic, strong) BankAccountData * _Nonnull bankAccountData;
1154
- - (nullable instancetype)initWithToken:(NSString * _Nonnull)token bankAccountData:(BankAccountData * _Nonnull)bankAccountData error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
1644
+ /// A unique token representing the bank account.
1645
+ @property (nonatomic, readonly, copy) NSString * _Nonnull token;
1646
+ /// The associated bank account details.
1647
+ @property (nonatomic, readonly, strong) BankAccountData * _Nonnull bankAccountData;
1155
1648
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1156
1649
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1157
1650
  @end
1158
1651
 
1159
1652
 
1160
- SWIFT_CLASS("_TtC12PayEngineSDK17PEBankAccountView")
1161
- @interface PEBankAccountView : IBankAccountView
1162
- - (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
1163
- - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
1164
- - (void)didMoveToSuperview;
1165
- - (void)layoutSubviews;
1166
- @end
1167
-
1168
-
1169
- /// PayEngine Card object
1653
+ /// A PayEngine card object.
1654
+ /// This class represents a payment card stored with PayEngine, containing a secure token
1655
+ /// and associated card details.
1170
1656
  SWIFT_CLASS("_TtC12PayEngineSDK6PECard")
1171
1657
  @interface PECard : NSObject
1172
- @property (nonatomic, copy) NSString * _Nonnull token;
1173
- @property (nonatomic, strong) CardData * _Nonnull cardData;
1174
- - (nullable instancetype)initWithToken:(NSString * _Nonnull)token cardData:(CardData * _Nonnull)cardData error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
1658
+ /// A unique token representing the card.
1659
+ @property (nonatomic, readonly, copy) NSString * _Nonnull token;
1660
+ /// The associated card details.
1661
+ @property (nonatomic, readonly, strong) CardData * _Nonnull cardData;
1175
1662
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1176
1663
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1177
1664
  @end
1178
1665
 
1179
- @class PEConfig;
1180
- @class WKUserContentController;
1181
- @class WKScriptMessage;
1182
-
1183
- /// PEComponent
1184
- SWIFT_CLASS("_TtC12PayEngineSDK11PEComponent")
1185
- @interface PEComponent : UIView <WKScriptMessageHandler>
1186
- - (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
1187
- - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
1188
- - (void)didMoveToSuperview;
1189
- - (void)setupWithConfig:(PEConfig * _Nonnull)config componentName:(NSString * _Nonnull)componentName props:(NSDictionary<NSString *, NSString *> * _Nonnull)props;
1190
- - (void)pinToView:(UIView * _Nonnull)view;
1191
- - (void)registerEventWithName:(NSString * _Nonnull)name handler:(void (^ _Nonnull)(id _Nonnull))handler;
1192
- - (void)removeEventWithName:(NSString * _Nonnull)name;
1193
- - (void)userContentController:(WKUserContentController * _Nonnull)userContentController didReceiveScriptMessage:(WKScriptMessage * _Nonnull)message;
1194
- @end
1195
1666
 
1196
-
1197
- /// PayEngine configuration
1667
+ /// A class that is used to configure the <code>PayEngine</code> object.
1668
+ /// 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.
1198
1669
  SWIFT_CLASS("_TtC12PayEngineSDK8PEConfig")
1199
1670
  @interface PEConfig : NSObject
1671
+ /// Constructor for the <code>PEConfig</code> class
1672
+ /// \param publicKey PayEngine public key.
1673
+ ///
1674
+ /// \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>.
1675
+ ///
1200
1676
  - (nonnull instancetype)initWithPublicKey:(NSString * _Nonnull)publicKey baseURL:(NSString * _Nullable)baseURL OBJC_DESIGNATED_INITIALIZER;
1677
+ /// Returns the base url with which the <code>PayEngine</code> object interacts with.
1678
+ ///
1679
+ /// returns:
1680
+ /// 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>
1201
1681
  - (NSString * _Nonnull)getBaseURL SWIFT_WARN_UNUSED_RESULT;
1682
+ /// To check if the environment is set as production.
1683
+ ///
1684
+ /// returns:
1685
+ /// Returns <code>true</code> if the environment is set as live. Returns <code>false</code> otherwise.
1202
1686
  - (BOOL)isProduction SWIFT_WARN_UNUSED_RESULT;
1203
1687
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1204
1688
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1205
1689
  @end
1206
1690
 
1207
1691
 
1692
+ /// A type that represents an input field.
1693
+ /// This class defines an input field with properties that determine its behavior, such as its name, type, placeholder,
1694
+ /// whether it is required, keyboard type, and optional validation pattern.
1695
+ /// Internal UI components use this type to create input fields that adhere to the specified input criteria.
1208
1696
  SWIFT_CLASS("_TtC12PayEngineSDK7PEField")
1209
1697
  @interface PEField : NSObject
1698
+ /// The name of the field.
1699
+ @property (nonatomic, copy) NSString * _Nonnull name;
1700
+ /// The type of the field.
1701
+ @property (nonatomic, copy) NSString * _Nonnull type;
1702
+ /// The placeholder text displayed when the field is empty.
1703
+ @property (nonatomic, copy) NSString * _Nonnull placeholder;
1704
+ /// A Boolean value indicating whether the field is required.
1705
+ /// If <code>true</code>, the field must contain a value before submission.
1706
+ @property (nonatomic) BOOL isRequired;
1707
+ /// A regular expression pattern used to validate the field’s input.
1708
+ /// If <code>nil</code>, no validation is performed.
1709
+ @property (nonatomic, copy) NSString * _Nullable pattern;
1210
1710
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1211
1711
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1212
1712
  @end
1213
1713
 
1214
-
1215
- /// PEPaymentView
1216
- SWIFT_CLASS("_TtC12PayEngineSDK13PEPaymentView")
1217
- @interface PEPaymentView : ICardNumberView
1218
- - (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
1219
- - (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
1220
- - (void)didMoveToSuperview;
1221
- - (void)layoutSubviews;
1222
- - (void)setupWithVaultId:(NSString * _Nonnull)vaultId env:(NSString * _Nonnull)env hostname:(NSString * _Nonnull)hostname publicKey:(NSString * _Nonnull)publicKey additionalFields:(NSArray<PEField *> * _Nonnull)additionalFields;
1223
- - (BOOL)validate SWIFT_WARN_UNUSED_RESULT;
1224
- - (void)showKeyboard;
1225
- @end
1226
-
1714
+ /// Color Theme for the SDK.
1227
1715
  typedef SWIFT_ENUM(NSInteger, PEThemeMode, open) {
1228
1716
  PEThemeModeSystem = 0,
1229
1717
  PEThemeModeDark = 1,
1230
1718
  PEThemeModeLight = 2,
1231
1719
  };
1232
1720
 
1721
+ @class UIView;
1233
1722
  @class ThreeDSResult;
1234
1723
 
1235
- /// PayEngine Main Class
1724
+ /// <code>PayEngine</code> is the main entry point for integrating PayEngine’s payment processing features.
1725
+ /// This class provides a centralized interface for:
1726
+ /// <ul>
1727
+ /// <li>
1728
+ /// Secure card and bank account entry
1729
+ /// </li>
1730
+ /// <li>
1731
+ /// Apple Pay integration
1732
+ /// </li>
1733
+ /// <li>
1734
+ /// Fraud monitoring and 3D Secure authentication
1735
+ /// </li>
1736
+ /// </ul>
1737
+ /// <h2>Key Features</h2>
1738
+ /// <h3>Secure Payment Views</h3>
1739
+ /// <ul>
1740
+ /// <li>
1741
+ /// Supports secure card entry via <code>createSecureView(additionalFields:completion:)</code>
1742
+ /// </li>
1743
+ /// <li>
1744
+ /// Supports secure bank account entry via <code>createBankAccountView(additionalFields:completion:)</code>
1745
+ /// </li>
1746
+ /// <li>
1747
+ /// PCI-compliant data handling with external encryption and tokenization
1748
+ /// </li>
1749
+ /// </ul>
1750
+ /// <h3>Apple Pay Integration</h3>
1751
+ /// <ul>
1752
+ /// <li>
1753
+ /// Detects Apple Pay availability
1754
+ /// </li>
1755
+ /// <li>
1756
+ /// Provides Apple Pay button creation
1757
+ /// </li>
1758
+ /// <li>
1759
+ /// Manages Apple Pay transaction processing
1760
+ /// </li>
1761
+ /// </ul>
1762
+ /// <h3>Fraud Monitoring & 3D Secure</h3>
1763
+ /// <ul>
1764
+ /// <li>
1765
+ /// Creates fraud monitoring sessions via <code>createFraudMonitorSession(merchantId:completion:)</code>
1766
+ /// </li>
1767
+ /// <li>
1768
+ /// Supports 3D Secure authentication via <code>perform3DSFlow(view:threeDSData:handler:)</code>
1769
+ /// </li>
1770
+ /// </ul>
1771
+ /// <h2>Usage Example</h2>
1772
+ /// \code
1773
+ /// // Initialize PayEngine
1774
+ /// let payEngine = PayEngine(config: config)
1775
+ ///
1776
+ /// // Create a secure card entry view
1777
+ /// payEngine.createSecureView(additionalFields: []) { result in
1778
+ /// switch result {
1779
+ /// case .success(let view):
1780
+ /// self.view.addSubview(view)
1781
+ /// case .failure(let error):
1782
+ /// print("Error: \(error)")
1783
+ /// }
1784
+ /// }
1785
+ ///
1786
+ /// \endcodeseealso:
1787
+ /// <code>ICardNumberView</code>, <code>IBankAccountView</code>, <code>PEApplePay</code>
1236
1788
  SWIFT_CLASS("_TtC12PayEngineSDK9PayEngine")
1237
1789
  @interface PayEngine : NSObject
1238
- /// Constructor
1239
- /// \param config PayEngine configuration
1790
+ /// Initializes the <code>PayEngine</code> with the given configuration.
1791
+ /// \param config The configuration object <code>PEConfig</code> containing necessary settings.
1240
1792
  ///
1241
1793
  - (nonnull instancetype)initWithConfig:(PEConfig * _Nonnull)config OBJC_DESIGNATED_INITIALIZER;
1794
+ /// Sets the theme mode for the PayEngine UI components.
1795
+ /// \param themeMode The desired theme mode <code>PEThemeMode</code>.
1796
+ ///
1242
1797
  + (void)setThemeMode:(enum PEThemeMode)themMode;
1243
- - (PEComponent * _Nonnull)createComponentWithName:(NSString * _Nonnull)name props:(NSDictionary<NSString *, NSString *> * _Nonnull)props SWIFT_WARN_UNUSED_RESULT;
1798
+ /// Creates a secure card entry view for collecting payment details.
1799
+ /// \param additionalFields Optional additional fields to be included of type <code>PEField</code>.
1800
+ ///
1801
+ /// \param completion A closure returning the <code>ICardNumberView</code> instance.
1802
+ ///
1244
1803
  - (void)createSecureViewWithAdditionalFields:(NSArray<PEField *> * _Nullable)additionalFields completion:(void (^ _Nonnull)(ICardNumberView * _Nonnull))completion;
1804
+ /// Creates a secure bank account entry view.
1805
+ /// \param additionalFields Optional additional fields to be included.
1806
+ ///
1807
+ /// \param completion A closure returning the <code>IBankAccountView</code> instance.
1808
+ ///
1245
1809
  - (void)createBankAccountViewWithAdditionalFields:(NSArray<PEField *> * _Nullable)additionalFields completion:(void (^ _Nonnull)(IBankAccountView * _Nonnull))completion;
1810
+ /// Retrieves browser-related information.
1811
+ /// \param view The UI view in which the web view is embedded.
1812
+ ///
1813
+ /// \param handler A closure returning browser details as a <code>String</code>.
1814
+ ///
1246
1815
  - (void)getBrowserInfoWithView:(UIView * _Nonnull)view handler:(void (^ _Nonnull)(NSString * _Nonnull))handler;
1816
+ /// Initiates a 3D Secure authentication process.
1817
+ /// \param view The UI view in which the 3D Secure flow should be presented.
1818
+ ///
1819
+ /// \param threeDSData The authentication data required for 3D Secure.
1820
+ ///
1821
+ /// \param handler A closure returning the <code>ThreeDSResult</code> upon completion.
1822
+ ///
1247
1823
  - (void)perform3DSFlowWithView:(UIView * _Nonnull)view threeDSData:(NSString * _Nonnull)threeDSData handler:(void (^ _Nonnull)(ThreeDSResult * _Nonnull))handler;
1824
+ /// Creates a fraud monitoring session.
1825
+ /// \param merchantId The merchant’s unique identifier.
1826
+ ///
1827
+ /// \param completion A closure returning the fraud monitoring session ID as a <code>String</code>.
1828
+ ///
1248
1829
  - (void)createFraudMonitorSessionWithMerchantId:(NSString * _Nonnull)merchantId completion:(void (^ _Nonnull)(NSString * _Nonnull))completion;
1249
1830
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1250
1831
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1251
1832
  @end
1252
1833
 
1253
1834
 
1254
- SWIFT_CLASS("_TtC12PayEngineSDK14ThreeDSMessage")
1255
- @interface ThreeDSMessage : NSObject
1256
- - (nullable instancetype)initWithType:(NSString * _Nonnull)type subtype:(NSString * _Nonnull)subtype data:(ThreeDSResult * _Nullable)data error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
1257
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1258
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1259
- @end
1260
-
1261
- @class WKWebView;
1262
- @class WKNavigationAction;
1263
- @class WKNavigation;
1264
-
1265
- SWIFT_CLASS("_TtC12PayEngineSDK12ThreeDSModal")
1266
- @interface ThreeDSModal : UIView <WKNavigationDelegate, WKScriptMessageHandler>
1267
- - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
1268
- - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
1269
- - (void)setupWithConfig:(PEConfig * _Nonnull)config threeDSData:(NSString * _Nonnull)threeDSData handler:(void (^ _Nonnull)(ThreeDSResult * _Nonnull))handler;
1270
- - (void)setupWebView;
1271
- - (void)webView:(WKWebView * _Nonnull)webView decidePolicyForNavigationAction:(WKNavigationAction * _Nonnull)navigationAction decisionHandler:(void (^ _Nonnull)(WKNavigationActionPolicy))decisionHandler;
1272
- - (void)webView:(WKWebView * _Nonnull)webView didFinishNavigation:(WKNavigation * _Null_unspecified)navigation;
1273
- - (void)userContentController:(WKUserContentController * _Nonnull)userContentController didReceiveScriptMessage:(WKScriptMessage * _Nonnull)message;
1274
- @end
1275
-
1276
1835
 
1836
+ /// Type that represents the result for the ThreeDS process
1277
1837
  SWIFT_CLASS("_TtC12PayEngineSDK13ThreeDSResult")
1278
1838
  @interface ThreeDSResult : NSObject
1279
- @property (nonatomic, copy) NSString * _Nullable message;
1280
- @property (nonatomic) BOOL success;
1281
- @property (nonatomic, copy) NSString * _Nullable transactionId;
1282
- - (nullable instancetype)initWithMessage:(NSString * _Nullable)message success:(BOOL)success transactionId:(NSString * _Nullable)transactionId error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
1839
+ /// The message for the result
1840
+ @property (nonatomic, readonly, copy) NSString * _Nullable message;
1841
+ /// Bool indicating whether the transaction was successful or not
1842
+ @property (nonatomic, readonly) BOOL success;
1843
+ /// Transaction ID resulting after the ThreeDS Flow completion
1844
+ @property (nonatomic, readonly, copy) NSString * _Nullable transactionId;
1283
1845
  - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1284
1846
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1285
1847
  @end