react-native-payengine 2.0.17 → 2.0.18-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -65
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/reactnativepayengine/v2/RNPayEngineNative.kt +65 -3
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEEvents.kt +1 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNBankAccountViewManager.kt +16 -3
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardViewManager.kt +15 -4
- package/ios/PayEngineSDK.xcframework/Info.plist +5 -5
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KDataCollector.h +4 -25
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +0 -20
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountPrivate.h +61 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +430 -149
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.abi.json +1962 -5715
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface-e +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface-e +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/PayEngineSDK +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KDataCollector.h +4 -25
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +0 -20
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountPrivate.h +61 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +860 -298
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1962 -5715
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface-e +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface-e +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1962 -5715
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface-e +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface-e +35 -129
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/PayEngineSDK +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
- package/ios/Sources/Classes/RNPEEventEmitter.swift +1 -1
- package/ios/Sources/Classes/RNPayEngineNative.swift +125 -64
- package/ios/Sources/Classes/SecureFields/RNPEEvents.swift +1 -0
- package/ios/Sources/Payengine.m +6 -0
- package/lib/commonjs/components/PayEngine.js +1 -1
- package/lib/commonjs/components/PayEngine.js.map +1 -1
- package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js +124 -0
- package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -1
- package/lib/commonjs/components/v2/ApplePay/PEApplePayInterfaces.js +78 -0
- package/lib/commonjs/components/v2/ApplePay/PEApplePayInterfaces.js.map +1 -1
- package/lib/commonjs/components/v2/GooglePay/PEGooglePayAddress.js.map +1 -1
- package/lib/commonjs/components/v2/GooglePay/PEGooglePayButton.js +53 -0
- package/lib/commonjs/components/v2/GooglePay/PEGooglePayButton.js.map +1 -1
- package/lib/commonjs/components/v2/PEPaymentRequest.js +121 -0
- package/lib/commonjs/components/v2/PEPaymentRequest.js.map +1 -1
- package/lib/commonjs/components/v2/PayEngineNative.js +182 -4
- package/lib/commonjs/components/v2/PayEngineNative.js.map +1 -1
- package/lib/commonjs/components/v2/PayEngineProvider.js +52 -0
- package/lib/commonjs/components/v2/PayEngineProvider.js.map +1 -1
- package/lib/commonjs/components/v2/SecureFields/BankAccountView.js +71 -0
- package/lib/commonjs/components/v2/SecureFields/BankAccountView.js.map +1 -1
- package/lib/commonjs/components/v2/SecureFields/CreditCardView.js +82 -0
- package/lib/commonjs/components/v2/SecureFields/CreditCardView.js.map +1 -1
- package/lib/commonjs/components/v2/SecureFields/IPEField.js.map +1 -1
- package/lib/commonjs/components/v2/SecureFields/ITokenizationData.js.map +1 -1
- package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js.map +1 -1
- package/lib/commonjs/components/v2/SecureFields/PECard.js.map +1 -1
- package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js +20 -3
- package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js.map +1 -1
- package/lib/commonjs/index.js +17 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/index.js +20 -0
- package/lib/commonjs/interfaces/index.js.map +1 -1
- package/lib/commonjs/utils/index.js +26 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/components/PayEngine.js +1 -1
- package/lib/module/components/PayEngine.js.map +1 -1
- package/lib/module/components/v2/ApplePay/PEApplePayButton.js +124 -0
- package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -1
- package/lib/module/components/v2/ApplePay/PEApplePayInterfaces.js +75 -0
- package/lib/module/components/v2/ApplePay/PEApplePayInterfaces.js.map +1 -1
- package/lib/module/components/v2/GooglePay/PEGooglePayAddress.js.map +1 -1
- package/lib/module/components/v2/GooglePay/PEGooglePayButton.js +53 -0
- package/lib/module/components/v2/GooglePay/PEGooglePayButton.js.map +1 -1
- package/lib/module/components/v2/PEPaymentRequest.js +119 -0
- package/lib/module/components/v2/PEPaymentRequest.js.map +1 -1
- package/lib/module/components/v2/PayEngineNative.js +184 -5
- package/lib/module/components/v2/PayEngineNative.js.map +1 -1
- package/lib/module/components/v2/PayEngineProvider.js +51 -0
- package/lib/module/components/v2/PayEngineProvider.js.map +1 -1
- package/lib/module/components/v2/SecureFields/BankAccountView.js +71 -0
- package/lib/module/components/v2/SecureFields/BankAccountView.js.map +1 -1
- package/lib/module/components/v2/SecureFields/CreditCardView.js +82 -0
- package/lib/module/components/v2/SecureFields/CreditCardView.js.map +1 -1
- package/lib/module/components/v2/SecureFields/IPEField.js.map +1 -1
- package/lib/module/components/v2/SecureFields/ITokenizationData.js.map +1 -1
- package/lib/module/components/v2/SecureFields/PEBankAccount.js.map +1 -1
- package/lib/module/components/v2/SecureFields/PECard.js.map +1 -1
- package/lib/module/components/v2/SecureFields/PEKeyboardType.js +16 -1
- package/lib/module/components/v2/SecureFields/PEKeyboardType.js.map +1 -1
- package/lib/module/index.js +10 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/index.js +19 -0
- package/lib/module/interfaces/index.js.map +1 -1
- package/lib/module/utils/index.js +27 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/components/PayEngine.d.ts +1 -1
- package/lib/typescript/components/v2/ApplePay/PEApplePayButton.d.ts +217 -12
- package/lib/typescript/components/v2/ApplePay/PEApplePayInterfaces.d.ts +180 -1
- package/lib/typescript/components/v2/GooglePay/PEGooglePayAddress.d.ts +30 -0
- package/lib/typescript/components/v2/GooglePay/PEGooglePayButton.d.ts +99 -0
- package/lib/typescript/components/v2/PEPaymentRequest.d.ts +130 -9
- package/lib/typescript/components/v2/PayEngineNative.d.ts +165 -7
- package/lib/typescript/components/v2/PayEngineProvider.d.ts +51 -0
- package/lib/typescript/components/v2/SecureFields/BankAccountView.d.ts +103 -0
- package/lib/typescript/components/v2/SecureFields/CreditCardView.d.ts +114 -0
- package/lib/typescript/components/v2/SecureFields/IPEField.d.ts +49 -0
- package/lib/typescript/components/v2/SecureFields/ITokenizationData.d.ts +14 -0
- package/lib/typescript/components/v2/SecureFields/PEBankAccount.d.ts +36 -0
- package/lib/typescript/components/v2/SecureFields/PECard.d.ts +44 -0
- package/lib/typescript/components/v2/SecureFields/PEKeyboardType.d.ts +16 -1
- package/lib/typescript/index.d.ts +11 -5
- package/lib/typescript/interfaces/index.d.ts +35 -1
- package/lib/typescript/utils/index.d.ts +21 -0
- package/package.json +6 -3
- package/src/components/PayEngine.tsx +1 -1
- package/src/components/v2/ApplePay/PEApplePayButton.tsx +225 -12
- package/src/components/v2/ApplePay/PEApplePayInterfaces.ts +221 -8
- package/src/components/v2/GooglePay/PEGooglePayAddress.ts +39 -1
- package/src/components/v2/GooglePay/PEGooglePayButton.tsx +113 -9
- package/src/components/v2/PEPaymentRequest.ts +151 -13
- package/src/components/v2/PayEngineNative.tsx +196 -9
- package/src/components/v2/PayEngineProvider.tsx +52 -1
- package/src/components/v2/SecureFields/BankAccountView.tsx +108 -1
- package/src/components/v2/SecureFields/CreditCardView.tsx +118 -1
- package/src/components/v2/SecureFields/IPEField.ts +55 -0
- package/src/components/v2/SecureFields/ITokenizationData.ts +17 -2
- package/src/components/v2/SecureFields/PEBankAccount.ts +42 -0
- package/src/components/v2/SecureFields/PECard.ts +52 -0
- package/src/components/v2/SecureFields/PEKeyboardType.ts +18 -1
- package/src/index.tsx +23 -5
- package/src/interfaces/index.ts +40 -2
- package/src/utils/index.ts +21 -0
- package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.1.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.1.1/gc.properties +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/CustomWindow.h +0 -25
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +0 -33
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +0 -27
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/CustomWindow.h +0 -25
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +0 -33
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +0 -27
package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h
CHANGED
|
@@ -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
|
-
///
|
|
339
|
-
///
|
|
340
|
-
///
|
|
341
|
-
///
|
|
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
|
|
343
|
+
/// \param paymentAmount The total amount to be collected in the transaction.
|
|
346
344
|
///
|
|
347
|
-
/// \param
|
|
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
|
-
///
|
|
359
|
+
/// The current device/user has Apple pay activated and a card belongs to the given payment networks
|
|
355
360
|
ApplePayStatusEligible = 0,
|
|
356
|
-
///
|
|
361
|
+
/// The current device/user has Apple pay activated but has no card belongs to the given payment networks
|
|
357
362
|
ApplePayStatusNeedSetup = 1,
|
|
358
|
-
///
|
|
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
|
-
|
|
366
|
-
@property (nonatomic, copy) NSString * _Nonnull
|
|
367
|
-
|
|
368
|
-
@property (nonatomic, copy) NSString * _Nonnull
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
@
|
|
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
|
-
|
|
395
|
-
@property (nonatomic, copy) NSString * _Nonnull
|
|
396
|
-
|
|
397
|
-
@property (nonatomic)
|
|
398
|
-
|
|
399
|
-
@property (nonatomic, copy) NSString * _Nonnull
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
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
|
|
410
|
+
@class PEBankAccount;
|
|
425
411
|
@class NSCoder;
|
|
426
412
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
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
|
|
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
|
-
|
|
502
|
-
@property (nonatomic,
|
|
503
|
-
|
|
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
|
-
|
|
510
|
-
|
|
511
|
-
|
|
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
|
-
|
|
522
|
-
@property (nonatomic,
|
|
523
|
-
|
|
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
|
|
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
|
|
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
|
-
///
|
|
588
|
-
/// \param config
|
|
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
|
-
|
|
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
|
-
|
|
629
|
-
@property (nonatomic)
|
|
630
|
-
|
|
631
|
-
|
|
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
|