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
|
@@ -1,12 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a bank account stored within PayEngine.
|
|
3
|
+
*
|
|
4
|
+
* This interface contains a secure token and account details, ensuring sensitive banking
|
|
5
|
+
* information is securely managed within the system.
|
|
6
|
+
*
|
|
7
|
+
* @category SecureFields
|
|
8
|
+
*/
|
|
1
9
|
interface PEBankAccount {
|
|
10
|
+
/**
|
|
11
|
+
* A unique identifier for the bank account.
|
|
12
|
+
*
|
|
13
|
+
* This may be used internally to reference the bank account object.
|
|
14
|
+
*/
|
|
2
15
|
id: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A secure token representing the bank account.
|
|
19
|
+
*
|
|
20
|
+
* This token is used for referencing the account in API operations without exposing raw bank details.
|
|
21
|
+
*/
|
|
3
22
|
token: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The associated bank account details.
|
|
26
|
+
*
|
|
27
|
+
* Includes essential information such as the account holder's name,
|
|
28
|
+
* the routing number, and the last four digits of the account number.
|
|
29
|
+
*/
|
|
4
30
|
account_data: {
|
|
31
|
+
/**
|
|
32
|
+
* The first name of the account holder.
|
|
33
|
+
*/
|
|
5
34
|
first_name: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The last name of the account holder.
|
|
38
|
+
*/
|
|
6
39
|
last_name: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The bank's routing number.
|
|
43
|
+
*/
|
|
7
44
|
routing_number: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The last four digits of the bank account number.
|
|
48
|
+
*/
|
|
8
49
|
last_4: string;
|
|
9
50
|
};
|
|
10
51
|
}
|
|
11
52
|
|
|
53
|
+
|
|
12
54
|
export default PEBankAccount;
|
|
@@ -1,14 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a payment card stored with PayEngine.
|
|
3
|
+
*
|
|
4
|
+
* This interface contains a secure token and associated card details,
|
|
5
|
+
* ensuring sensitive payment information is securely managed within the system.
|
|
6
|
+
*
|
|
7
|
+
* @category SecureFields
|
|
8
|
+
*/
|
|
1
9
|
interface PECard {
|
|
10
|
+
/**
|
|
11
|
+
* A secure token representing the card.
|
|
12
|
+
*
|
|
13
|
+
* This token is used to safely reference the card in API operations without exposing raw card data.
|
|
14
|
+
*/
|
|
2
15
|
token: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The associated card details.
|
|
19
|
+
*
|
|
20
|
+
* Includes essential information such as brand, expiration date,
|
|
21
|
+
* the last four digits, cardholder name, and optional billing ZIP code.
|
|
22
|
+
*/
|
|
3
23
|
card_data: {
|
|
24
|
+
/**
|
|
25
|
+
* A unique identifier for the card.
|
|
26
|
+
*
|
|
27
|
+
* This ID is typically used to reference the card object in system operations.
|
|
28
|
+
*/
|
|
4
29
|
id: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The brand of the card (e.g., Visa, MasterCard).
|
|
33
|
+
*/
|
|
5
34
|
brand: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The last four digits of the card number.
|
|
38
|
+
*
|
|
39
|
+
* Useful for displaying or confirming the card to the user.
|
|
40
|
+
*/
|
|
6
41
|
last_4: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The expiration year of the card.
|
|
45
|
+
*/
|
|
7
46
|
exp_year: string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The expiration month of the card.
|
|
50
|
+
*/
|
|
8
51
|
exp_month: string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The name of the cardholder.
|
|
55
|
+
*/
|
|
9
56
|
name: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The ZIP code associated with the card's billing address (optional).
|
|
60
|
+
*/
|
|
10
61
|
address_zip?: string;
|
|
11
62
|
};
|
|
12
63
|
}
|
|
13
64
|
|
|
65
|
+
|
|
14
66
|
export default PECard;
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import type IPEField from './IPEField';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Defines the keyboard type for a PayEngine secure input field.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This enum is used in {@link IPEField.keyboardType} to control the keyboard layout
|
|
8
|
+
* shown to the user based on the input field's context.
|
|
9
|
+
*
|
|
10
|
+
* The available keyboard types are:
|
|
11
|
+
* - {@link PEKeyboardType.alphabet} — Optimized for alphabetic characters.
|
|
12
|
+
* - {@link PEKeyboardType.number} — Optimized for numeric input.
|
|
13
|
+
* - {@link PEKeyboardType.phone} — Designed for entering phone numbers.
|
|
14
|
+
* - {@link PEKeyboardType.normal} — Standard keyboard with alphanumeric characters.
|
|
15
|
+
*
|
|
16
|
+
* @category SecureFields
|
|
17
|
+
*/
|
|
18
|
+
export enum PEKeyboardType {
|
|
2
19
|
alphabet = 'alphabet',
|
|
3
20
|
number = 'number',
|
|
4
21
|
phone = 'phone',
|
package/src/index.tsx
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main Module
|
|
3
|
+
* @module PayEngine SDK
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
import PayEngine from './components/PayEngine';
|
|
2
7
|
import { NativeModules, Platform } from 'react-native';
|
|
3
8
|
import type { IPayEngineConfig } from './interfaces/index';
|
|
4
9
|
import { PayProvider } from './interfaces/index';
|
|
10
|
+
import type ITokenizationData from './components/v2/SecureFields/ITokenizationData'
|
|
5
11
|
import {
|
|
6
12
|
PECreditCardView,
|
|
7
|
-
|
|
13
|
+
type PECreditCardViewProps,
|
|
14
|
+
type PECreditCardViewMethods,
|
|
8
15
|
} from './components/v2/SecureFields/CreditCardView';
|
|
9
16
|
import {
|
|
10
17
|
PEBankAccountView,
|
|
11
|
-
|
|
18
|
+
type PEBankAccountViewProps,
|
|
19
|
+
type PEBankAccountViewMethods,
|
|
12
20
|
} from './components/v2/SecureFields/BankAccountView';
|
|
13
21
|
import type IPEField from './components/v2/SecureFields/IPEField';
|
|
14
22
|
import type PECard from './components/v2/SecureFields/PECard';
|
|
15
23
|
import type PEBankAccount from './components/v2/SecureFields/PEBankAccount';
|
|
16
24
|
import { PayEngineProvider } from './components/v2/PayEngineProvider';
|
|
17
25
|
import PayEngineNative from './components/v2/PayEngineNative';
|
|
18
|
-
import {
|
|
26
|
+
import { FetchAccessTokenCallback, AccessToken } from './components/v2/PayEngineNative';
|
|
27
|
+
import { PEApplePayButton, type PEApplePayButtonProps, type PEApplePayButtonMethods } from './components/v2/ApplePay/PEApplePayButton';
|
|
19
28
|
|
|
20
|
-
import { PEGooglePayButton } from './components/v2/GooglePay/PEGooglePayButton';
|
|
29
|
+
import { PEGooglePayButton, type PEGooglePayButtonProps, type PEGooglePayButtonMethods } from './components/v2/GooglePay/PEGooglePayButton';
|
|
21
30
|
import * as PayEngineUtils from './utils/index';
|
|
22
31
|
import PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';
|
|
23
32
|
import type { PEGooglePayAddress } from './components/v2/GooglePay/PEGooglePayAddress';
|
|
@@ -53,19 +62,26 @@ export {
|
|
|
53
62
|
PayEngineUtils,
|
|
54
63
|
PayEngineProvider,
|
|
55
64
|
PayEngineNative,
|
|
65
|
+
AccessToken,
|
|
66
|
+
FetchAccessTokenCallback,
|
|
56
67
|
// securefields
|
|
57
68
|
PEKeyboardType,
|
|
58
69
|
IPEField,
|
|
70
|
+
ITokenizationData,
|
|
59
71
|
// credit card
|
|
60
72
|
PECreditCardView,
|
|
73
|
+
PECreditCardViewProps,
|
|
61
74
|
PECreditCardViewMethods,
|
|
62
75
|
PECard,
|
|
63
76
|
// bank account
|
|
64
77
|
PEBankAccountView,
|
|
78
|
+
PEBankAccountViewProps,
|
|
65
79
|
PEBankAccountViewMethods,
|
|
66
80
|
PEBankAccount,
|
|
67
81
|
// Apple Pay
|
|
68
82
|
PEApplePayButton,
|
|
83
|
+
PEApplePayButtonProps,
|
|
84
|
+
PEApplePayButtonMethods,
|
|
69
85
|
// RNPEApplePayOptions,
|
|
70
86
|
// RNPEContactField,
|
|
71
87
|
PEApplePayContact,
|
|
@@ -73,5 +89,7 @@ export {
|
|
|
73
89
|
// RNPEGooglePayShippingAddressParameters,
|
|
74
90
|
// PEPaymentRequest,
|
|
75
91
|
PEGooglePayButton,
|
|
76
|
-
PEGooglePayAddress
|
|
92
|
+
PEGooglePayAddress,
|
|
93
|
+
PEGooglePayButtonProps,
|
|
94
|
+
PEGooglePayButtonMethods
|
|
77
95
|
};
|
package/src/interfaces/index.ts
CHANGED
|
@@ -1,11 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the configuration settings for PayEngine.
|
|
3
|
+
*
|
|
4
|
+
* The [IPayEngineConfig] interface holds essential details such as the public key,
|
|
5
|
+
* script version, and logging level. It is used to configure the PayEngine integration
|
|
6
|
+
* for API interactions.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
1
9
|
export interface IPayEngineConfig {
|
|
10
|
+
/**
|
|
11
|
+
* The public key associated with the PayEngine account.
|
|
12
|
+
* This key is required for authentication when making API requests.
|
|
13
|
+
*/
|
|
2
14
|
publicKey: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The version of the PayEngine integration.
|
|
18
|
+
* If provided, this specifies the version of the script or API being used.
|
|
19
|
+
*/
|
|
3
20
|
version?: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The script URL for loading the PayEngine JavaScript library.
|
|
24
|
+
* If provided, this URL is used instead of the default script URL.
|
|
25
|
+
*/
|
|
4
26
|
scriptURL?: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The log level for debugging.
|
|
30
|
+
* Higher values enable more detailed logging.
|
|
31
|
+
*/
|
|
5
32
|
logLevel?: number;
|
|
6
33
|
}
|
|
7
34
|
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Enum representing supported payment providers.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* This enum specifies the available payment providers supported by the PayEngine SDK.
|
|
41
|
+
* It is used to check which payment method (Apple Pay or Google Pay) is available for use.
|
|
42
|
+
*
|
|
43
|
+
* @enum {string}
|
|
44
|
+
* @category PayEngine
|
|
45
|
+
*/
|
|
8
46
|
export enum PayProvider {
|
|
9
|
-
googlePay,
|
|
10
|
-
applePay
|
|
47
|
+
googlePay, // Google Pay payment provider.
|
|
48
|
+
applePay // Apple Pay payment provider.
|
|
11
49
|
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import type { IPayEngineConfig } from '../interfaces/index';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Custom error thrown when an obsolete method is called.
|
|
6
|
+
*
|
|
7
|
+
* The `PEDeprecationError` indicates that the method being used is deprecated,
|
|
8
|
+
* and the user should check the package README for updated usage.
|
|
9
|
+
*/
|
|
4
10
|
export class PEDeprecationError extends Error {
|
|
5
11
|
constructor() {
|
|
6
12
|
super(
|
|
@@ -9,12 +15,18 @@ export class PEDeprecationError extends Error {
|
|
|
9
15
|
}
|
|
10
16
|
}
|
|
11
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
12
21
|
export const getHttpHeaders = (config: IPayEngineConfig) => {
|
|
13
22
|
return {
|
|
14
23
|
Authorization: `Signature key="${config.publicKey}",algorithm="hmac-sha256",identifier="secure-fields",signature=""`,
|
|
15
24
|
};
|
|
16
25
|
};
|
|
17
26
|
|
|
27
|
+
/**
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
18
30
|
export const getBaseURL = (config: IPayEngineConfig) => {
|
|
19
31
|
let baseUrl = config.publicKey.includes('_prod_')
|
|
20
32
|
? 'https://console.payengine.co'
|
|
@@ -26,6 +38,9 @@ export const getBaseURL = (config: IPayEngineConfig) => {
|
|
|
26
38
|
return baseUrl;
|
|
27
39
|
};
|
|
28
40
|
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
29
44
|
export const createHttpClient = (config: IPayEngineConfig) => {
|
|
30
45
|
return axios.create({
|
|
31
46
|
baseURL: getBaseURL(config),
|
|
@@ -33,6 +48,9 @@ export const createHttpClient = (config: IPayEngineConfig) => {
|
|
|
33
48
|
});
|
|
34
49
|
};
|
|
35
50
|
|
|
51
|
+
/**
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
36
54
|
export function getScriptURL(config: IPayEngineConfig) {
|
|
37
55
|
if (!config.publicKey) {
|
|
38
56
|
throw new Error('PayEngine Public Key is missing');
|
|
@@ -52,6 +70,9 @@ export function getScriptURL(config: IPayEngineConfig) {
|
|
|
52
70
|
return scriptURL;
|
|
53
71
|
}
|
|
54
72
|
|
|
73
|
+
/**
|
|
74
|
+
* @private
|
|
75
|
+
*/
|
|
55
76
|
export const debuggingScript = `
|
|
56
77
|
const consoleLog = (type, ...log) => window.ReactNativeWebView.postMessage(JSON.stringify({'type': 'Console', 'data': {'type': type, 'log': log}}));
|
|
57
78
|
console = {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/CustomWindow.h
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// CustomWindow.h
|
|
3
|
-
// TouchDemo
|
|
4
|
-
//
|
|
5
|
-
// Created by Astha Ameta on 19/08/20.
|
|
6
|
-
// Copyright © 2020 Kount Inc. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <UIKit/UIKit.h>
|
|
10
|
-
|
|
11
|
-
@protocol CustomWindowProtocol <NSObject>
|
|
12
|
-
-(void)touchesBeganCalledOfWindow:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
13
|
-
-(void)touchesEndedCalledOfWindow:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
14
|
-
-(void)touchesMovedCalledOfWindow:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
15
|
-
@end
|
|
16
|
-
|
|
17
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
18
|
-
|
|
19
|
-
@interface CustomWindow : UIWindow
|
|
20
|
-
|
|
21
|
-
@property(weak, nonatomic) id<CustomWindowProtocol> touchDelegate;
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// UIControl+CustomControl.h
|
|
3
|
-
// TouchDemo
|
|
4
|
-
//
|
|
5
|
-
// Created by Astha Ameta on 19/08/20.
|
|
6
|
-
// Copyright © 2020 Kount Inc. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <UIKit/UIKit.h>
|
|
10
|
-
|
|
11
|
-
@interface UIButton (CustomButton)
|
|
12
|
-
|
|
13
|
-
@end
|
|
14
|
-
|
|
15
|
-
@interface UISlider (CustomSlider)
|
|
16
|
-
|
|
17
|
-
@end
|
|
18
|
-
|
|
19
|
-
@interface UIStepper (CustomStepper)
|
|
20
|
-
|
|
21
|
-
@end
|
|
22
|
-
|
|
23
|
-
@interface UIPageControl (CustomPageControl)
|
|
24
|
-
|
|
25
|
-
@end
|
|
26
|
-
|
|
27
|
-
@interface UIColorWell (CustomColorWell)
|
|
28
|
-
|
|
29
|
-
@end
|
|
30
|
-
|
|
31
|
-
@interface UIScrollView (CustomScrollView)
|
|
32
|
-
|
|
33
|
-
@end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// UIViewController+TouchControl.h
|
|
3
|
-
// TouchDemo
|
|
4
|
-
//
|
|
5
|
-
// Created by Astha Ameta on 19/08/20.
|
|
6
|
-
// Copyright © 2020 Kount Inc. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <UIKit/UIKit.h>
|
|
10
|
-
#import "UIControl+CustomControl.h"
|
|
11
|
-
|
|
12
|
-
@protocol CustomControlDelegate <NSObject>
|
|
13
|
-
-(void)touchBeganCalledWith:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
14
|
-
-(void)touchMovedCalledWith:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
15
|
-
-(void)touchEndedCalledWith:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
16
|
-
// ... other methods here
|
|
17
|
-
@end
|
|
18
|
-
|
|
19
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
20
|
-
|
|
21
|
-
@interface UIViewController (TouchControl)
|
|
22
|
-
|
|
23
|
-
@property (nonatomic, strong) id<CustomControlDelegate> touchDelegate;
|
|
24
|
-
|
|
25
|
-
@end
|
|
26
|
-
|
|
27
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// CustomWindow.h
|
|
3
|
-
// TouchDemo
|
|
4
|
-
//
|
|
5
|
-
// Created by Astha Ameta on 19/08/20.
|
|
6
|
-
// Copyright © 2020 Kount Inc. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <UIKit/UIKit.h>
|
|
10
|
-
|
|
11
|
-
@protocol CustomWindowProtocol <NSObject>
|
|
12
|
-
-(void)touchesBeganCalledOfWindow:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
13
|
-
-(void)touchesEndedCalledOfWindow:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
14
|
-
-(void)touchesMovedCalledOfWindow:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
15
|
-
@end
|
|
16
|
-
|
|
17
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
18
|
-
|
|
19
|
-
@interface CustomWindow : UIWindow
|
|
20
|
-
|
|
21
|
-
@property(weak, nonatomic) id<CustomWindowProtocol> touchDelegate;
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// UIControl+CustomControl.h
|
|
3
|
-
// TouchDemo
|
|
4
|
-
//
|
|
5
|
-
// Created by Astha Ameta on 19/08/20.
|
|
6
|
-
// Copyright © 2020 Kount Inc. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <UIKit/UIKit.h>
|
|
10
|
-
|
|
11
|
-
@interface UIButton (CustomButton)
|
|
12
|
-
|
|
13
|
-
@end
|
|
14
|
-
|
|
15
|
-
@interface UISlider (CustomSlider)
|
|
16
|
-
|
|
17
|
-
@end
|
|
18
|
-
|
|
19
|
-
@interface UIStepper (CustomStepper)
|
|
20
|
-
|
|
21
|
-
@end
|
|
22
|
-
|
|
23
|
-
@interface UIPageControl (CustomPageControl)
|
|
24
|
-
|
|
25
|
-
@end
|
|
26
|
-
|
|
27
|
-
@interface UIColorWell (CustomColorWell)
|
|
28
|
-
|
|
29
|
-
@end
|
|
30
|
-
|
|
31
|
-
@interface UIScrollView (CustomScrollView)
|
|
32
|
-
|
|
33
|
-
@end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// UIViewController+TouchControl.h
|
|
3
|
-
// TouchDemo
|
|
4
|
-
//
|
|
5
|
-
// Created by Astha Ameta on 19/08/20.
|
|
6
|
-
// Copyright © 2020 Kount Inc. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <UIKit/UIKit.h>
|
|
10
|
-
#import "UIControl+CustomControl.h"
|
|
11
|
-
|
|
12
|
-
@protocol CustomControlDelegate <NSObject>
|
|
13
|
-
-(void)touchBeganCalledWith:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
14
|
-
-(void)touchMovedCalledWith:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
15
|
-
-(void)touchEndedCalledWith:(NSSet<UITouch *> *_Nullable)touches withEvent:(UIEvent *_Nullable)event;
|
|
16
|
-
// ... other methods here
|
|
17
|
-
@end
|
|
18
|
-
|
|
19
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
20
|
-
|
|
21
|
-
@interface UIViewController (TouchControl)
|
|
22
|
-
|
|
23
|
-
@property (nonatomic, strong) id<CustomControlDelegate> touchDelegate;
|
|
24
|
-
|
|
25
|
-
@end
|
|
26
|
-
|
|
27
|
-
NS_ASSUME_NONNULL_END
|