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.
- 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 +1785 -5517
- 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 +1785 -5517
- 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 +1785 -5517
- 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/Assets.car +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,170 @@
|
|
|
1
1
|
import { PayProvider } from "../../interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an access token used for authenticating with the PayEngine SDK.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* The access token contains the actual token string and the duration (in seconds)
|
|
7
|
+
* for which the token remains valid. This is typically retrieved from your backend
|
|
8
|
+
* and used for making authenticated requests.
|
|
9
|
+
*
|
|
10
|
+
* @property accessToken - The access token string.
|
|
11
|
+
* @property expiresIn - The time (in seconds) until the token expires.
|
|
12
|
+
*
|
|
13
|
+
* @category PayEngine
|
|
14
|
+
*/
|
|
15
|
+
export type AccessToken = {
|
|
16
|
+
accessToken: string;
|
|
17
|
+
expiresIn: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A callback function that provides an access token to the PayEngine SDK.
|
|
21
|
+
*
|
|
22
|
+
* @returns A promise resolving to a valid {@link AccessToken}.
|
|
23
|
+
*
|
|
24
|
+
* @category PayEngine
|
|
25
|
+
*/
|
|
26
|
+
export type FetchAccessTokenCallback = () => Promise<AccessToken>;
|
|
27
|
+
/**
|
|
28
|
+
* Provides an interface for interacting with the native PayEngine SDK.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* `PayEngineNative` acts as a bridge between your React Native JavaScript code and
|
|
32
|
+
* the native PayEngine SDKs on iOS and Android. It utilizes React Native's
|
|
33
|
+
* Native Modules and platform channels to enable core payment functionalities.
|
|
34
|
+
*
|
|
35
|
+
* These include:
|
|
36
|
+
* - Fraud monitoring
|
|
37
|
+
* - Browser/device info retrieval
|
|
38
|
+
* - Support detection for Apple Pay and Google Pay
|
|
39
|
+
*
|
|
40
|
+
*
|
|
41
|
+
* @category PayEngine
|
|
42
|
+
*/
|
|
2
43
|
export default class PayEngineNative {
|
|
3
|
-
static
|
|
4
|
-
static
|
|
44
|
+
private static emitter;
|
|
45
|
+
private static isFetchCallbackListenerRegistered;
|
|
46
|
+
private static fetchAccessTokenCallback;
|
|
47
|
+
private constructor();
|
|
5
48
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
49
|
+
* Retrieves a fraud monitoring session ID from the native PayEngine SDK.
|
|
50
|
+
*
|
|
51
|
+
*
|
|
52
|
+
* @param merchantId - The unique identifier for the merchant.
|
|
53
|
+
* @returns A `Promise<string>` containing the fraud monitoring session ID.
|
|
9
54
|
*/
|
|
10
|
-
static
|
|
11
|
-
|
|
55
|
+
static createFraudMonitorSession(merchantId: string): Promise<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Retrieves browser-related information from the native PayEngine SDK.
|
|
58
|
+
*
|
|
59
|
+
* @returns A `Promise<string>` containing browser and device details.
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
static getBrowserInfo(): Promise<string>;
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Use {@link PayEngineNative.userCanPay} instead.
|
|
65
|
+
*
|
|
66
|
+
* Checks if platform-native payments (Apple Pay or Google Pay) are supported on the current device.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* This method has been deprecated in favor of {@link PayEngineNative.userCanPay}, which allows specifying
|
|
70
|
+
* the payment provider explicitly.
|
|
71
|
+
*
|
|
72
|
+
* @param merchantId - The unique identifier for the merchant.
|
|
73
|
+
* @returns A `Promise<boolean>` indicating whether the platform-specific payment method is supported.
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
static isPlatformPaySupported(merchantId: string): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Checks if the user can make payments using Apple Pay (iOS) or Google Pay (Android).
|
|
79
|
+
*
|
|
80
|
+
* @remarks
|
|
81
|
+
* This method verifies whether the current device and platform support the selected payment provider.
|
|
82
|
+
* It performs a platform-specific check using the native PayEngine SDK for either Apple Pay or Google Pay.
|
|
83
|
+
*
|
|
84
|
+
* ## Supported Providers
|
|
85
|
+
* - `PayProvider.googlePay` (Android only)
|
|
86
|
+
* - `PayProvider.applePay` (iOS only)
|
|
87
|
+
*
|
|
88
|
+
* @param provider - The payment provider to check support for.
|
|
89
|
+
* @param merchantId - The unique identifier for the merchant.
|
|
90
|
+
* @returns A `Promise<boolean>` indicating whether the selected payment method is supported.
|
|
91
|
+
*/
|
|
92
|
+
static userCanPay(provider: PayProvider, merchantId: string): Promise<boolean>;
|
|
93
|
+
/**
|
|
94
|
+
* Sets the callback function that provides an access token when required by PayEngine.
|
|
95
|
+
*
|
|
96
|
+
* @remarks
|
|
97
|
+
* When the PayEngine SDK needs an access token, it will call this callback function
|
|
98
|
+
* to request the host application to fetch a new token from its backend.
|
|
99
|
+
*
|
|
100
|
+
* The SDK uses this token internally to make calls to merchant related APIs which require merchant's credentials.
|
|
101
|
+
*
|
|
102
|
+
* ## Important:
|
|
103
|
+
* - PayEngine will invoke this callback **whenever an access token is needed or needs to be refreshed**.
|
|
104
|
+
* - The integrator must ensure that the token retrieval logic is secure and efficient in their backend.
|
|
105
|
+
* - For more details on how to retrieve the access token from Payengine, refer to the official documentation:
|
|
106
|
+
* [PayEngine Merchant Session](https://docs.payengine.co/merchant-session#obtaining-a-new-merchant-session)
|
|
107
|
+
*
|
|
108
|
+
* ## Example Usage
|
|
109
|
+
* ```ts
|
|
110
|
+
* const fetchAccessToken = async (): Promise<AccessToken> => {
|
|
111
|
+
* try {
|
|
112
|
+
* // Make a network request to your server to fetch the token
|
|
113
|
+
* // Your server then makes a request to Payengine securely and returns the results back in response
|
|
114
|
+
* const response = await fetch("https://yourserver.com/accessToken");
|
|
115
|
+
*
|
|
116
|
+
* if (!response.ok) {
|
|
117
|
+
* throw new Error(`Server responded with status ${response.status}`);
|
|
118
|
+
* }
|
|
119
|
+
*
|
|
120
|
+
* const data = await response.json();
|
|
121
|
+
*
|
|
122
|
+
* // Extract the token and expiration from your server's response
|
|
123
|
+
* const token = data.access_token;
|
|
124
|
+
* const expiresIn = data.expires_in;
|
|
125
|
+
*
|
|
126
|
+
* return { accessToken: token, expiresIn };
|
|
127
|
+
* } catch (e) {
|
|
128
|
+
* throw new Error("Failed to fetch access token: " + e);
|
|
129
|
+
* }
|
|
130
|
+
* };
|
|
131
|
+
*
|
|
132
|
+
* // This is where you supply the callback to the SDK
|
|
133
|
+
* PayEngineNative.setFetchAccessTokenCallback(fetchAccessToken);
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* @param callback - A function that returns a `Promise<AccessToken>`. The function must handle
|
|
137
|
+
* errors properly in case token retrieval fails.
|
|
138
|
+
*/
|
|
139
|
+
static setFetchAccessTokenCallback(callback: FetchAccessTokenCallback): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Logs out the current merchant by invalidating the access token.
|
|
142
|
+
*
|
|
143
|
+
* @remarks
|
|
144
|
+
* While access tokens automatically expire, it's **strongly recommended** to explicitly invalidate
|
|
145
|
+
* them when a merchant's session ends on the server.
|
|
146
|
+
*
|
|
147
|
+
* Relying solely on token expiration can introduce **security vulnerabilities**
|
|
148
|
+
* and result in a **suboptimal user experience**.
|
|
149
|
+
*
|
|
150
|
+
* Calling this method ensures that the merchant's session is terminated,
|
|
151
|
+
* preventing any further authenticated requests until a new login is performed.
|
|
152
|
+
*
|
|
153
|
+
* For more details, refer to the official documentation:
|
|
154
|
+
* [PayEngine Merchant Session](https://docs.payengine.co/merchant-session)
|
|
155
|
+
*
|
|
156
|
+
* ## Example Usage
|
|
157
|
+
* ```ts
|
|
158
|
+
* const merchantId = "your_merchant_id_here";
|
|
159
|
+
* await PayEngineNative.logout(merchantId);
|
|
160
|
+
* console.log("Merchant session terminated.");
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* This ensures that no further authenticated requests can be made
|
|
164
|
+
* until a new access token is fetched.
|
|
165
|
+
*
|
|
166
|
+
* @param merchantId - The unique identifier of the merchant whose session should be invalidated.
|
|
167
|
+
* @returns A `Promise` indicating the completion of the logout process.
|
|
168
|
+
*/
|
|
169
|
+
static logout(merchantId: string): Promise<void>;
|
|
12
170
|
}
|
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { IPayEngineConfig } from "../../interfaces";
|
|
3
3
|
declare const PayEngineContext: React.Context<IPayEngineConfig | undefined>;
|
|
4
|
+
/**
|
|
5
|
+
* A provider that initializes and manages PayEngine's configuration across the app.
|
|
6
|
+
*
|
|
7
|
+
* `PayEngineProvider` ensures that PayEngine's SDK is properly set up by loading
|
|
8
|
+
* the necessary configurations before rendering the app. It must wrap the root widget
|
|
9
|
+
* for the payment functionalities to work correctly.
|
|
10
|
+
*
|
|
11
|
+
* ## Usage
|
|
12
|
+
*
|
|
13
|
+
* Before using PayEngine in your application, wrap your app inside [PayEngineProvider]
|
|
14
|
+
* and pass an `IPayEngineConfig` instance containing your public key, script URL, and optional log level.
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* const PE_CONFIG: IPayEngineConfig = {
|
|
18
|
+
* publicKey: PUBLIC_KEY,
|
|
19
|
+
* scriptURL: "https://staging-sandbox.payengine.dev/",
|
|
20
|
+
* logLevel: 1,
|
|
21
|
+
* };
|
|
22
|
+
*
|
|
23
|
+
* return (
|
|
24
|
+
* <PayEngineProvider config={PE_CONFIG}>
|
|
25
|
+
* <NavigationContainer>
|
|
26
|
+
* <DrawerNavigator />
|
|
27
|
+
* </NavigationContainer>
|
|
28
|
+
* </PayEngineProvider>
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* ## How It Works
|
|
33
|
+
*
|
|
34
|
+
* 1. The `PayEngineProvider` component accepts a configuration object (`IPayEngineConfig`) containing
|
|
35
|
+
* the `publicKey`, `scriptURL`, and `logLevel`.
|
|
36
|
+
* 2. It initializes the PayEngine SDK with the `publicKey`
|
|
37
|
+
* and `scriptURL` from the configuration.
|
|
38
|
+
* 3. The provider uses the `React.useEffect` hook to ensure that the configuration is set up
|
|
39
|
+
* before rendering the children.
|
|
40
|
+
* 4. While loading the configuration, an `ActivityIndicator` is displayed. Once the SDK is set up,
|
|
41
|
+
* it renders the provided child components.
|
|
42
|
+
*
|
|
43
|
+
* ## Properties:
|
|
44
|
+
*
|
|
45
|
+
* - **`config`**: The configuration required for PayEngine (type: `IPayEngineConfig`).
|
|
46
|
+
* - `publicKey`: The public key for authentication.
|
|
47
|
+
* - `scriptURL`: The URL for the PayEngine script.
|
|
48
|
+
* - `logLevel`: The log level for debugging (optional).
|
|
49
|
+
*
|
|
50
|
+
* - **`children`**: The child components or widgets to be rendered after PayEngine is initialized.
|
|
51
|
+
*
|
|
52
|
+
*
|
|
53
|
+
* @category SecureFields
|
|
54
|
+
*/
|
|
4
55
|
declare const PayEngineProvider: ({ config, children }: {
|
|
5
56
|
config: IPayEngineConfig;
|
|
6
57
|
children: React.ReactNode;
|
|
@@ -2,12 +2,115 @@ import * as React from 'react';
|
|
|
2
2
|
import type IPEField from './IPEField';
|
|
3
3
|
import type PEBankAccount from './PEBankAccount';
|
|
4
4
|
import type ITokenizationData from './ITokenizationData';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the `PEBankAccountView` component.
|
|
7
|
+
*
|
|
8
|
+
* Allows optional configuration of additional input fields that can be rendered
|
|
9
|
+
* alongside the standard bank account fields.
|
|
10
|
+
*
|
|
11
|
+
* These fields can be used to collect extra information such as account holder type,
|
|
12
|
+
* billing address, or custom metadata required by the merchant.
|
|
13
|
+
*
|
|
14
|
+
* @category SecureFields
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const fields: IPEField[] = [
|
|
19
|
+
* {
|
|
20
|
+
* name: "accountHolderType",
|
|
21
|
+
* type: "text",
|
|
22
|
+
* placeholder: "Account Holder Type",
|
|
23
|
+
* keyboardType: PEKeyboardType.Alphabet,
|
|
24
|
+
* isRequired: false
|
|
25
|
+
* }
|
|
26
|
+
* ];
|
|
27
|
+
*
|
|
28
|
+
* <PEBankAccountView additionalFields={fields} />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
5
31
|
export interface PEBankAccountViewProps {
|
|
32
|
+
/**
|
|
33
|
+
* (Optional) A list of additional fields to be displayed in the bank account form.
|
|
34
|
+
*
|
|
35
|
+
* These are rendered below the standard account number and routing number fields.
|
|
36
|
+
*/
|
|
6
37
|
additionalFields?: IPEField[];
|
|
7
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Provides methods to control and interact with the PayEngine Bank Account input view.
|
|
41
|
+
*
|
|
42
|
+
* This interface defines methods for submitting bank account details for tokenization
|
|
43
|
+
* and managing keyboard visibility.
|
|
44
|
+
*
|
|
45
|
+
* @category SecureFields
|
|
46
|
+
*/
|
|
8
47
|
export interface PEBankAccountViewMethods {
|
|
48
|
+
/**
|
|
49
|
+
* Submits the entered bank account information to PayEngine for tokenization.
|
|
50
|
+
*
|
|
51
|
+
* @param data - Optional merchant info and additional metadata.
|
|
52
|
+
* @returns A promise that resolves to a tokenized bank account object (`PEBankAccount`).
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const result = await bankAccountRef.current?.submit({
|
|
57
|
+
* merchantId: "merchant_456",
|
|
58
|
+
* additionalData: { accountType: "checking" }
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
9
62
|
submit: (data: ITokenizationData) => Promise<PEBankAccount>;
|
|
63
|
+
/**
|
|
64
|
+
* Programmatically displays the keyboard for the bank account input fields.
|
|
65
|
+
*/
|
|
10
66
|
showKeyboard: () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Programmatically hides the keyboard for the bank account input fields.
|
|
69
|
+
*/
|
|
11
70
|
hideKeyboard: () => void;
|
|
12
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* A secure form widget for entering a customer's bank account information.
|
|
74
|
+
*
|
|
75
|
+
* [PEBankAccountView] provides a UI component for securely collecting bank account details.
|
|
76
|
+
* It does not store data locally and instead tokenizes the information using PayEngine.
|
|
77
|
+
*
|
|
78
|
+
* ## Features:
|
|
79
|
+
* - Securely collects bank account details.
|
|
80
|
+
* - Supports additional customizable fields.
|
|
81
|
+
* - Provides methods to show/hide the keyboard.
|
|
82
|
+
* - Allows tokenizing the entered data for safe storage.
|
|
83
|
+
*
|
|
84
|
+
* ## Usage Example:
|
|
85
|
+
*
|
|
86
|
+
* ```tsx
|
|
87
|
+
* const formRef = React.createRef<PEBankAccountViewMethods>();
|
|
88
|
+
*
|
|
89
|
+
* return (
|
|
90
|
+
* <View style={styles.container}>
|
|
91
|
+
* <Text>Welcome to PayEngine React Native SDK example</Text>
|
|
92
|
+
* <View style={{ width: '100%' }}>
|
|
93
|
+
* <PEBankAccountView ref={formRef} />
|
|
94
|
+
* <Button disabled={submitting} onPress={() => createBankAccount()} title="Create Bank Account" />
|
|
95
|
+
* </View>
|
|
96
|
+
* <ScrollView style={{ flex: 1, width: '100%', backgroundColor: 'lightyellow', padding: 10, marginVertical: 20 }}>
|
|
97
|
+
* <Text>{JSON.stringify(secureFieldsResult, null, 4)}</Text>
|
|
98
|
+
* </ScrollView>
|
|
99
|
+
* </View>
|
|
100
|
+
* );
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* ## How It Works:
|
|
104
|
+
* 1. Create an instance of [PEBankAccountView], optionally passing additional fields.
|
|
105
|
+
* 2. Display the form inside your widget tree.
|
|
106
|
+
* 3. Use [showKeyboard] and [hideKeyboard] to manage input focus.
|
|
107
|
+
* 4. Call [submit] to securely send the bank account data and receive a token.
|
|
108
|
+
*
|
|
109
|
+
* ## Methods:
|
|
110
|
+
* - **`showKeyboard()`**: Manually shows the on-screen keyboard.
|
|
111
|
+
* - **`hideKeyboard()`**: Hides the on-screen keyboard.
|
|
112
|
+
* - **`submit()`**: Submits the entered data and retrieves a tokenized version of the bank account data.
|
|
113
|
+
*
|
|
114
|
+
* @category SecureFields
|
|
115
|
+
*/
|
|
13
116
|
export declare const PEBankAccountView: React.ForwardRefExoticComponent<PEBankAccountViewProps & React.RefAttributes<PEBankAccountViewMethods>>;
|
|
@@ -2,12 +2,126 @@ import * as React from 'react';
|
|
|
2
2
|
import type IPEField from './IPEField';
|
|
3
3
|
import type PECard from './PECard';
|
|
4
4
|
import type ITokenizationData from './ITokenizationData';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the `PECreditCardView` component.
|
|
7
|
+
*
|
|
8
|
+
* Allows optional configuration of additional input fields that can be rendered
|
|
9
|
+
* alongside the standard credit card fields.
|
|
10
|
+
*
|
|
11
|
+
* These fields can be used to collect extra information such as ZIP code, billing address,
|
|
12
|
+
* or custom metadata required by the merchant.
|
|
13
|
+
*
|
|
14
|
+
* @category SecureFields
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const fields: IPEField[] = [
|
|
19
|
+
* {
|
|
20
|
+
* name: "zipCode",
|
|
21
|
+
* type: "text",
|
|
22
|
+
* placeholder: "ZIP Code",
|
|
23
|
+
* keyboardType: PEKeyboardType.Numeric,
|
|
24
|
+
* isRequired: true
|
|
25
|
+
* }
|
|
26
|
+
* ];
|
|
27
|
+
*
|
|
28
|
+
* <PECreditCardView additionalFields={fields} />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
5
31
|
export interface PECreditCardViewProps {
|
|
32
|
+
/**
|
|
33
|
+
* (Optional) A list of additional fields to be displayed in the credit card form.
|
|
34
|
+
*
|
|
35
|
+
* These are rendered below the standard card number, expiry, and CVV fields.
|
|
36
|
+
*/
|
|
6
37
|
additionalFields?: IPEField[];
|
|
7
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Provides methods to control and interact with the PayEngine Credit Card input view.
|
|
41
|
+
*
|
|
42
|
+
* This interface defines methods for submitting credit card details for tokenization
|
|
43
|
+
* and managing keyboard visibility.
|
|
44
|
+
*
|
|
45
|
+
* @category SecureFields
|
|
46
|
+
*/
|
|
8
47
|
export interface PECreditCardViewMethods {
|
|
48
|
+
/**
|
|
49
|
+
* Submits the entered credit card information to PayEngine for tokenization.
|
|
50
|
+
*
|
|
51
|
+
* @param data - Optional merchant info and additional metadata.
|
|
52
|
+
* @returns A promise that resolves to a tokenized credit card object (`PECard`).
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const result = await creditCardRef.current?.submit({
|
|
57
|
+
* merchantId: "merchant_123",
|
|
58
|
+
* additionalData: { source: "checkout" }
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
9
62
|
submit: (data: ITokenizationData) => Promise<PECard>;
|
|
63
|
+
/**
|
|
64
|
+
* Programmatically displays the keyboard for the credit card input fields.
|
|
65
|
+
*/
|
|
10
66
|
showKeyboard: () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Programmatically hides the keyboard for the credit card input fields.
|
|
69
|
+
*/
|
|
11
70
|
hideKeyboard: () => void;
|
|
12
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* A secure form for entering a customer's credit card information safely.
|
|
74
|
+
*
|
|
75
|
+
* [PECreditCardView] provides an interface for users to input their credit card details securely.
|
|
76
|
+
* It integrates with PayEngine to tokenize the card details and forward them to a PCI-compliant
|
|
77
|
+
* third party without storing sensitive information locally.
|
|
78
|
+
*
|
|
79
|
+
* ## How It Works
|
|
80
|
+
*
|
|
81
|
+
* 1. Create an instance of [PECreditCardView], optionally passing additional fields.
|
|
82
|
+
* 2. Display the form inside your UI.
|
|
83
|
+
* 3. Once the user enters their details, call [submit] to securely process and retrieve a tokenized version of the card.
|
|
84
|
+
* 4. Use [showKeyboard] and [hideKeyboard] to manually control the keyboard.
|
|
85
|
+
*
|
|
86
|
+
* ## Example Usage
|
|
87
|
+
*
|
|
88
|
+
* ```tsx
|
|
89
|
+
* const formRef = React.createRef<PECreditCardViewMethods>();
|
|
90
|
+
*
|
|
91
|
+
*
|
|
92
|
+
* const additionalFields = [
|
|
93
|
+
* {
|
|
94
|
+
* name: 'address_zip',
|
|
95
|
+
* type: 'text',
|
|
96
|
+
* placeholder: 'Zip code',
|
|
97
|
+
* keyboardType: PEKeyboardType.alphabet,
|
|
98
|
+
* isRequired: true,
|
|
99
|
+
* pattern: '^(?:\\d{5}(?:-\\d{4})?|[ABCEGHJKLMNPRSTVXY]\\d[A-Z] ?\\d[A-Z]\\d)$'
|
|
100
|
+
* }
|
|
101
|
+
* ]
|
|
102
|
+
*
|
|
103
|
+
* return (
|
|
104
|
+
* <View style={styles.container}>
|
|
105
|
+
* <Text>Welcome to PayEngine React Native SDK example</Text>
|
|
106
|
+
* <View style={{ width: '100%' }}>
|
|
107
|
+
* <PECreditCardView ref={formRef} additionalFields={additionalFields} />
|
|
108
|
+
* <Button disabled={submitting} onPress={() => createCard()} title="Create Card" />
|
|
109
|
+
* <Button onPress={() => formRef.current?.showKeyboard()} title="Show keyboard" />
|
|
110
|
+
* <Button onPress={() => formRef.current?.hideKeyboard()} title="Hide keyboard" />
|
|
111
|
+
* </View>
|
|
112
|
+
* <ScrollView style={{ flex: 1, width: '100%', backgroundColor: 'lightyellow', padding: 10, marginVertical: 20 }}>
|
|
113
|
+
* <Text>{JSON.stringify(secureFieldsResult, null, 4)}</Text>
|
|
114
|
+
* </ScrollView>
|
|
115
|
+
* </View>
|
|
116
|
+
* );
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* ## Features:
|
|
120
|
+
* - Securely collects credit card details.
|
|
121
|
+
* - Supports additional customizable fields.
|
|
122
|
+
* - Provides methods to show/hide the keyboard.
|
|
123
|
+
* - Allows submitting the entered data for tokenization and safe storage.
|
|
124
|
+
*
|
|
125
|
+
* @category SecureFields
|
|
126
|
+
*/
|
|
13
127
|
export declare const PECreditCardView: React.ForwardRefExoticComponent<PECreditCardViewProps & React.RefAttributes<PECreditCardViewMethods>>;
|
|
@@ -1,10 +1,59 @@
|
|
|
1
1
|
import type PEKeyboardType from "./PEKeyboardType";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an input field in the PayEngine system.
|
|
4
|
+
*
|
|
5
|
+
* The `IPEField` interface defines a form field with properties such as
|
|
6
|
+
* its name, type, placeholder, keyboard type, whether it is required, and
|
|
7
|
+
* an optional validation pattern.
|
|
8
|
+
*
|
|
9
|
+
* @category SecureFields
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const emailField: IPEField = {
|
|
14
|
+
* name: "email",
|
|
15
|
+
* type: "text",
|
|
16
|
+
* placeholder: "Enter your email",
|
|
17
|
+
* keyboardType: PEKeyboardType.Alphabet,
|
|
18
|
+
* isRequired: true,
|
|
19
|
+
* pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
|
|
20
|
+
* };
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
2
23
|
interface IPEField {
|
|
24
|
+
/**
|
|
25
|
+
* The unique identifier for the field.
|
|
26
|
+
*
|
|
27
|
+
* Typically used as the key when submitting form data.
|
|
28
|
+
*/
|
|
3
29
|
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* The type of the field (e.g., "text", "password", "email").
|
|
32
|
+
*
|
|
33
|
+
* Defines how the field’s value should be interpreted.
|
|
34
|
+
*/
|
|
4
35
|
type: string;
|
|
36
|
+
/**
|
|
37
|
+
* The placeholder text shown when the field is empty.
|
|
38
|
+
*/
|
|
5
39
|
placeholder: string;
|
|
40
|
+
/**
|
|
41
|
+
* Specifies the type of keyboard to display for this field.
|
|
42
|
+
*
|
|
43
|
+
* Example: `PEKeyboardType.Numeric`, `PEKeyboardType.Alphabet`
|
|
44
|
+
*/
|
|
6
45
|
keyboardType: PEKeyboardType;
|
|
46
|
+
/**
|
|
47
|
+
* Indicates whether the field is required for form submission.
|
|
48
|
+
*
|
|
49
|
+
* If `true`, the field must be filled in with a valid value.
|
|
50
|
+
*/
|
|
7
51
|
isRequired: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Optional regular expression used to validate the field's value.
|
|
54
|
+
*
|
|
55
|
+
* If omitted, no validation is enforced.
|
|
56
|
+
*/
|
|
8
57
|
pattern?: string;
|
|
9
58
|
}
|
|
10
59
|
export default IPEField;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the data used for tokenizing a credit card or bank account.
|
|
3
|
+
*
|
|
4
|
+
* This interface allows passing additional metadata or specifying the merchant
|
|
5
|
+
* for whom the data is being tokenized.
|
|
6
|
+
*
|
|
7
|
+
* @category SecureFields
|
|
8
|
+
*/
|
|
1
9
|
interface ITokenizationData {
|
|
10
|
+
/**
|
|
11
|
+
* (Optional) The merchant ID on behalf of whom the tokenization is performed.
|
|
12
|
+
*/
|
|
2
13
|
merchantId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* (Optional) A key-value map of additional metadata to include in the request.
|
|
16
|
+
*/
|
|
3
17
|
additionalData?: {
|
|
4
18
|
[key: string]: string;
|
|
5
19
|
};
|
|
@@ -1,10 +1,46 @@
|
|
|
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
|
+
* A secure token representing the bank account.
|
|
18
|
+
*
|
|
19
|
+
* This token is used for referencing the account in API operations without exposing raw bank details.
|
|
20
|
+
*/
|
|
3
21
|
token: string;
|
|
22
|
+
/**
|
|
23
|
+
* The associated bank account details.
|
|
24
|
+
*
|
|
25
|
+
* Includes essential information such as the account holder's name,
|
|
26
|
+
* the routing number, and the last four digits of the account number.
|
|
27
|
+
*/
|
|
4
28
|
account_data: {
|
|
29
|
+
/**
|
|
30
|
+
* The first name of the account holder.
|
|
31
|
+
*/
|
|
5
32
|
first_name: string;
|
|
33
|
+
/**
|
|
34
|
+
* The last name of the account holder.
|
|
35
|
+
*/
|
|
6
36
|
last_name: string;
|
|
37
|
+
/**
|
|
38
|
+
* The bank's routing number.
|
|
39
|
+
*/
|
|
7
40
|
routing_number: string;
|
|
41
|
+
/**
|
|
42
|
+
* The last four digits of the bank account number.
|
|
43
|
+
*/
|
|
8
44
|
last_4: string;
|
|
9
45
|
};
|
|
10
46
|
}
|
|
@@ -1,12 +1,56 @@
|
|
|
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
|
+
* The associated card details.
|
|
18
|
+
*
|
|
19
|
+
* Includes essential information such as brand, expiration date,
|
|
20
|
+
* the last four digits, cardholder name, and optional billing ZIP code.
|
|
21
|
+
*/
|
|
3
22
|
card_data: {
|
|
23
|
+
/**
|
|
24
|
+
* A unique identifier for the card.
|
|
25
|
+
*
|
|
26
|
+
* This ID is typically used to reference the card object in system operations.
|
|
27
|
+
*/
|
|
4
28
|
id: string;
|
|
29
|
+
/**
|
|
30
|
+
* The brand of the card (e.g., Visa, MasterCard).
|
|
31
|
+
*/
|
|
5
32
|
brand: string;
|
|
33
|
+
/**
|
|
34
|
+
* The last four digits of the card number.
|
|
35
|
+
*
|
|
36
|
+
* Useful for displaying or confirming the card to the user.
|
|
37
|
+
*/
|
|
6
38
|
last_4: string;
|
|
39
|
+
/**
|
|
40
|
+
* The expiration year of the card.
|
|
41
|
+
*/
|
|
7
42
|
exp_year: string;
|
|
43
|
+
/**
|
|
44
|
+
* The expiration month of the card.
|
|
45
|
+
*/
|
|
8
46
|
exp_month: string;
|
|
47
|
+
/**
|
|
48
|
+
* The name of the cardholder.
|
|
49
|
+
*/
|
|
9
50
|
name: string;
|
|
51
|
+
/**
|
|
52
|
+
* The ZIP code associated with the card's billing address (optional).
|
|
53
|
+
*/
|
|
10
54
|
address_zip?: string;
|
|
11
55
|
};
|
|
12
56
|
}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Defines the keyboard type for a PayEngine secure input field.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This enum is used in {@link IPEField.keyboardType} to control the keyboard layout
|
|
6
|
+
* shown to the user based on the input field's context.
|
|
7
|
+
*
|
|
8
|
+
* The available keyboard types are:
|
|
9
|
+
* - {@link PEKeyboardType.alphabet} — Optimized for alphabetic characters.
|
|
10
|
+
* - {@link PEKeyboardType.number} — Optimized for numeric input.
|
|
11
|
+
* - {@link PEKeyboardType.phone} — Designed for entering phone numbers.
|
|
12
|
+
* - {@link PEKeyboardType.normal} — Standard keyboard with alphanumeric characters.
|
|
13
|
+
*
|
|
14
|
+
* @category SecureFields
|
|
15
|
+
*/
|
|
16
|
+
export declare enum PEKeyboardType {
|
|
2
17
|
alphabet = "alphabet",
|
|
3
18
|
number = "number",
|
|
4
19
|
phone = "phone",
|