@aptos-scp/scp-component-rn-device-services 0.2.5 → 0.2.7
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/ios/AurusEnterpriseSDK.framework/AurusEnterpriseSDK +0 -0
- package/ios/AurusEnterpriseSDK.framework/Headers/AurusEnterpriseSDK.h +30 -36
- package/ios/SCPRNDeviceServices/AurusPaymentTerminal.m +33 -37
- package/lib/AurusDevice/AurusDevice.d.ts +18 -16
- package/lib/AurusDevice/AurusDevice.js +174 -228
- package/lib/AurusDevice/AurusDevice.js.map +1 -1
- package/lib/AurusDevice/constants.d.ts +6 -5
- package/lib/AurusDevice/constants.js +8 -7
- package/lib/AurusDevice/constants.js.map +1 -1
- package/lib/AurusDevice/sdk-interface/AurusPaymentSupport.d.ts +1 -0
- package/lib/AurusDevice/sdk-interface/AurusPaymentSupport.js +12 -0
- package/lib/AurusDevice/sdk-interface/AurusPaymentSupport.js.map +1 -1
- package/lib/AurusDevice/sdk-interface/Upgrade.d.ts +23 -0
- package/lib/AurusDevice/sdk-interface/Upgrade.js +9 -0
- package/lib/AurusDevice/sdk-interface/Upgrade.js.map +1 -0
- package/lib/constants/constants.d.ts +6 -4
- package/lib/constants/constants.js +6 -4
- package/lib/constants/constants.js.map +1 -1
- package/package.json +1 -1
|
Binary file
|
|
@@ -49,45 +49,39 @@ typedef void(^onAESDKCompletionResponse)(NSString *xmlResponse);
|
|
|
49
49
|
-(NSMutableDictionary *)getLogFileDetails;
|
|
50
50
|
|
|
51
51
|
typedef enum {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
EventEnterPasscode,
|
|
65
|
-
EventEnterExpiryDate,
|
|
66
|
-
EventEnterCVV,
|
|
67
|
-
EventEnterTIP,
|
|
68
|
-
//EventConfirmProcessAsCredit, //Debit to Credit Confirmation.
|
|
69
|
-
EventConfirmation,
|
|
70
|
-
EventProcessingTransaction,
|
|
52
|
+
EventSwipeOrInsertOrTap = 501, // Notify when insert/swipe prompt on swiper device.
|
|
53
|
+
EventEnterManualCardEntry, // Notify Manual entry prompt on swiper device.
|
|
54
|
+
EventProcessing, // Notify
|
|
55
|
+
EventEnterPIN, // Notify when Pin prompt appears on Swiper device
|
|
56
|
+
EventEnterZIP, // Notify when Zip prompt appears on Swiper device
|
|
57
|
+
EventEnterSSN, // Notify when SSN prompt appears on Swiper device
|
|
58
|
+
EventEnterExpiryDate, // Notify when ExpiryDate prompt appears on Swiper device
|
|
59
|
+
EventEnterCVV, // Notify when CVV prompt appears on Swiper device
|
|
60
|
+
EventEnterTIP, // Notify when TIP prompt appears on Swiper device
|
|
61
|
+
EventConfirmation, // Notify when Confirmation prompt appears on Swiper device
|
|
62
|
+
EventProcessingTransaction, // Notify when Processing Transaction Request
|
|
63
|
+
|
|
71
64
|
//E355 Device Events
|
|
72
|
-
EventBarcodeInformation,
|
|
73
|
-
EventDeviceNotConnected,
|
|
74
|
-
EventDeviceConnecting,
|
|
75
|
-
EventDeviceConnected,
|
|
76
|
-
EventDeviceConfigurationStarted,
|
|
77
|
-
EventDeviceConfigurationCompleted,
|
|
78
|
-
EventDeviceConfigurationFailed,
|
|
79
|
-
EventDeviceAlreadyConfigured,
|
|
80
|
-
|
|
81
|
-
EventFileDownloadFailed,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
65
|
+
EventBarcodeInformation, // Notify when device reads barcode data
|
|
66
|
+
EventDeviceNotConnected, // Notify when device not connected
|
|
67
|
+
EventDeviceConnecting, // Notify when device is in connecting state but not connected yet
|
|
68
|
+
EventDeviceConnected, // Notify when device is connected
|
|
69
|
+
EventDeviceConfigurationStarted, // Notify when EMV Configuration started
|
|
70
|
+
EventDeviceConfigurationCompleted, // Notify when EMV Configuration Completed
|
|
71
|
+
EventDeviceConfigurationFailed, // Notify when EMV Configuration failed
|
|
72
|
+
EventDeviceAlreadyConfigured, // Notify when EMV Configuration already configured.
|
|
73
|
+
EventFileDownloadProgress, // Notify when File downloading is in progress.
|
|
74
|
+
EventFileDownloadFailed, // Notify when File downloading Failed.
|
|
75
|
+
EventFileDownloadRetry, // Notify when File download retrying.
|
|
76
|
+
EventPEDFileUpgrade, // Notify when File upgrade process running on PED device.
|
|
77
|
+
EventPEDFileUpgradeFailed, // Notify when File upgrades/pushed failed.
|
|
78
|
+
EventPEDFileUpgradeCompleted, // Notify when File upgrades/pushed Completed.
|
|
79
|
+
EventPEDFileTransferInfo, // Notify with transfer details.
|
|
80
|
+
EventPEDFileTransferProgress, // Notify with file transfer progress
|
|
81
|
+
|
|
82
|
+
EventTakeSignatureOnPOS,
|
|
88
83
|
EventNone = 0
|
|
89
84
|
|
|
90
85
|
}NotificationEvent;
|
|
91
86
|
|
|
92
|
-
|
|
93
87
|
@end
|
|
@@ -41,40 +41,33 @@ RCT_EXPORT_MODULE();
|
|
|
41
41
|
native_onAESDKResponse_name: native_onAESDKResponse,
|
|
42
42
|
native_onNotificationReceived_name: native_onNotificationReceived,
|
|
43
43
|
native_onAESDKLogResponse_name: native_onAESDKLogResponse,
|
|
44
|
-
@"NotificationEvent": @{ @"
|
|
45
|
-
@"SwipeOrInsertOrTap" : @(EventSwipeOrInsertOrTap),
|
|
44
|
+
@"NotificationEvent": @{ @"SwipeOrInsertOrTap" : @(EventSwipeOrInsertOrTap), //501
|
|
46
45
|
@"EnterManualCardEntry" : @(EventEnterManualCardEntry),
|
|
47
46
|
@"Processing" : @(EventProcessing),
|
|
48
|
-
@"CardAuthorization" : @(EventCardAuthorization),
|
|
49
47
|
@"EnterPIN" : @(EventEnterPIN),
|
|
50
48
|
@"EnterZIP" : @(EventEnterZIP),
|
|
51
49
|
@"EnterSSN" : @(EventEnterSSN),
|
|
52
|
-
@"EnterSIN" : @(EventEnterSIN),
|
|
53
|
-
@"EnterAnnualDebitIncome" : @(EventEnterAnnualDebitIncome),
|
|
54
|
-
@"EnterMonthlyDebitIncome" : @(EventEnterMonthlyDebitIncome),
|
|
55
|
-
@"EnterPhoneNumber" : @(EventEnterPhoneNumber),
|
|
56
|
-
@"EnterPasscode" : @(EventEnterPasscode),
|
|
57
50
|
@"EnterExpiryDate" : @(EventEnterExpiryDate),
|
|
58
51
|
@"EnterCVV" : @(EventEnterCVV),
|
|
59
52
|
@"EnterTIP" : @(EventEnterTIP),
|
|
60
53
|
@"Confirmation" : @(EventConfirmation),
|
|
61
54
|
@"ProcessingTransaction" : @(EventProcessingTransaction),
|
|
62
|
-
@"BarcodeInformation" : @(EventBarcodeInformation), //
|
|
63
|
-
@"DeviceNotConnected" : @(EventDeviceNotConnected), //
|
|
64
|
-
@"DeviceConnecting" : @(EventDeviceConnecting), //
|
|
65
|
-
@"DeviceConnected" : @(EventDeviceConnected), //
|
|
66
|
-
@"DeviceConfigurationStarted" : @(EventDeviceConfigurationStarted), //
|
|
67
|
-
@"DeviceConfigurationCompleted" : @(EventDeviceConfigurationCompleted), //
|
|
68
|
-
@"DeviceConfigurationFailed" : @(EventDeviceConfigurationFailed), //
|
|
69
|
-
@"DeviceAlreadyConfigured" : @(EventDeviceAlreadyConfigured), //
|
|
70
|
-
@"
|
|
55
|
+
@"BarcodeInformation" : @(EventBarcodeInformation), //512
|
|
56
|
+
@"DeviceNotConnected" : @(EventDeviceNotConnected), //513
|
|
57
|
+
@"DeviceConnecting" : @(EventDeviceConnecting), //514
|
|
58
|
+
@"DeviceConnected" : @(EventDeviceConnected), //515
|
|
59
|
+
@"DeviceConfigurationStarted" : @(EventDeviceConfigurationStarted), //516
|
|
60
|
+
@"DeviceConfigurationCompleted" : @(EventDeviceConfigurationCompleted), //517
|
|
61
|
+
@"DeviceConfigurationFailed" : @(EventDeviceConfigurationFailed), //518
|
|
62
|
+
@"DeviceAlreadyConfigured" : @(EventDeviceAlreadyConfigured), //519
|
|
63
|
+
@"FileDownloadProgress" : @(EventFileDownloadProgress),
|
|
71
64
|
@"FileDownloadFailed" : @(EventFileDownloadFailed),
|
|
72
|
-
@"
|
|
73
|
-
@"
|
|
74
|
-
@"
|
|
75
|
-
@"
|
|
76
|
-
@"
|
|
77
|
-
@"
|
|
65
|
+
@"FileDownloadRetry" : @(EventFileDownloadRetry),
|
|
66
|
+
@"PEDFileUpgrade" : @(EventPEDFileUpgrade),
|
|
67
|
+
@"PEDFileUpgradeFailed" : @(EventPEDFileUpgradeFailed),
|
|
68
|
+
@"PEDFileUpgradeCompleted" : @(EventPEDFileUpgradeCompleted),
|
|
69
|
+
@"PEDFileTransferInfo" : @(EventPEDFileTransferInfo),
|
|
70
|
+
@"PEDFileTransferProgress" : @(EventPEDFileTransferProgress),
|
|
78
71
|
@"None" : @(EventNone)
|
|
79
72
|
}
|
|
80
73
|
};
|
|
@@ -82,32 +75,29 @@ RCT_EXPORT_MODULE();
|
|
|
82
75
|
|
|
83
76
|
#pragma mark - Exported to JavaScript methods
|
|
84
77
|
|
|
85
|
-
static BOOL
|
|
78
|
+
static BOOL firstTimeConnectionComplete = NO;
|
|
86
79
|
static id observer;
|
|
87
80
|
|
|
88
81
|
RCT_EXPORT_METHOD(initialize) {
|
|
89
82
|
if (!self.aesdk) {
|
|
90
83
|
RCTLog(@"In AurusPaymentTerminal.initialize, adding %@ observer.", AURUS_NOTIFICATION);
|
|
91
84
|
if (observer) {
|
|
85
|
+
RCTLog(@"In AurusPaymentTerminal.initialize, app was reloaded after adding observers. This should only happen in DEV. Attempting to work-around this scenario.");
|
|
92
86
|
[[NSNotificationCenter defaultCenter] removeObserver:observer name:AURUS_NOTIFICATION object:nil];
|
|
93
87
|
}
|
|
94
88
|
observer = self;
|
|
95
89
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onNotificationReceived:) name:AURUS_NOTIFICATION object:nil];
|
|
96
|
-
|
|
90
|
+
|
|
97
91
|
RCTLog(@"In AurusPaymentTerminal.initialize, creating AurusEnterpriseSDK.");
|
|
98
92
|
self.aesdk = [[AurusEnterpriseSDK alloc] init];
|
|
99
93
|
self.aesdk.setAESDKDelegateRefference = self;
|
|
100
94
|
[self.aesdk OnAESDKLogProcessRequest];
|
|
101
|
-
|
|
102
|
-
if (
|
|
103
|
-
RCTLog(@"In AurusPaymentTerminal.initialize, EMV configuration should be starting.");
|
|
104
|
-
} else {
|
|
95
|
+
|
|
96
|
+
if (firstTimeConnectionComplete) {
|
|
105
97
|
// allows payment to function as normal when app is reloaded
|
|
106
|
-
RCTLog(@"In AurusPaymentTerminal.initialize, app was reloaded
|
|
98
|
+
RCTLog(@"In AurusPaymentTerminal.initialize, app was reloaded after being previously connected. This should only happen in DEV. Attempting to work-around this scenario.");
|
|
107
99
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
108
|
-
|
|
109
|
-
NSDictionary *userInfo = @{ USER_INFO_CODE : @(EventDeviceAlreadyConfigured) };
|
|
110
|
-
[[NSNotificationCenter defaultCenter] postNotificationName:AURUS_NOTIFICATION object:nil userInfo:userInfo];
|
|
100
|
+
[self performSelector:@selector(notifyFakeEventDeviceConnected) withObject:nil afterDelay:10.0];
|
|
111
101
|
});
|
|
112
102
|
}
|
|
113
103
|
} else {
|
|
@@ -115,7 +105,13 @@ RCT_EXPORT_METHOD(initialize) {
|
|
|
115
105
|
}
|
|
116
106
|
}
|
|
117
107
|
|
|
118
|
-
|
|
108
|
+
- (void)notifyFakeEventDeviceConnected {
|
|
109
|
+
RCTLog(@"In AurusPaymentTerminal.notifyFakeEventDeviceConnected, app was reloaded after being previously connected. This should only happen in DEV. Attempting to work-around this scenario.");
|
|
110
|
+
NSDictionary *userInfo = @{ USER_INFO_CODE : @(EventDeviceConnected) };
|
|
111
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:AURUS_NOTIFICATION object:nil userInfo:userInfo];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
RCT_EXPORT_METHOD(OnAESDKProcessRequest:(NSString *)WithRequest) {
|
|
119
115
|
RCTLog(@"%@", [NSString stringWithFormat:@"In AurusPaymentTerminal.OnAESDKProcessRequest, calling OnAESDKProcessRequest:%@", WithRequest]);
|
|
120
116
|
[self.aesdk OnAESDKProcessRequest:WithRequest];
|
|
121
117
|
}
|
|
@@ -134,10 +130,10 @@ RCT_EXPORT_METHOD(OnAESDKProcessRequest:(NSString*)WithRequest) {
|
|
|
134
130
|
|
|
135
131
|
- (void)onNotificationReceived:(NSNotification *)notification {
|
|
136
132
|
RCTLog(@"%@", [NSString stringWithFormat:@"In AurusPaymentTerminal.onNotificationReceived, calling sendEventWithName:%@ body:%@", native_onNotificationReceived, notification.userInfo]);
|
|
137
|
-
if (!
|
|
133
|
+
if (!firstTimeConnectionComplete && notification && notification.userInfo) {
|
|
138
134
|
int code = [notification.userInfo[USER_INFO_CODE] intValue];
|
|
139
|
-
if (code ==
|
|
140
|
-
|
|
135
|
+
if (code == EventDeviceConnected) {
|
|
136
|
+
firstTimeConnectionComplete = YES;
|
|
141
137
|
}
|
|
142
138
|
}
|
|
143
139
|
[self sendEventWithName:native_onNotificationReceived body:notification.userInfo];
|
|
@@ -2,15 +2,6 @@ import { EventEmitter } from "fbemitter";
|
|
|
2
2
|
import { IBankCardRequest, IGiftCardRequest, IPaymentDeviceConfiguration, IScannerDeviceConfiguration } from "../";
|
|
3
3
|
import { IVendorPaymentDevice } from "../interfaces/payment/IPayment";
|
|
4
4
|
import { IVendorScannerDevice } from "../interfaces/scanner/IScanner";
|
|
5
|
-
/**
|
|
6
|
-
* This is the interface that the native (bridge) class implements.
|
|
7
|
-
*
|
|
8
|
-
* Note: any changes to the native API must be reflected here and vice-versa.
|
|
9
|
-
*/
|
|
10
|
-
export interface INativeAurusPaymentTerminal {
|
|
11
|
-
initialize(): void;
|
|
12
|
-
OnAESDKProcessRequest(WithRequest: string): void;
|
|
13
|
-
}
|
|
14
5
|
export declare class AurusDevice implements IVendorPaymentDevice, IVendorScannerDevice {
|
|
15
6
|
private _paymentConfig;
|
|
16
7
|
private _scannerConfig;
|
|
@@ -18,13 +9,15 @@ export declare class AurusDevice implements IVendorPaymentDevice, IVendorScanner
|
|
|
18
9
|
private _nativeSubscriptions;
|
|
19
10
|
private _paymentEmitter;
|
|
20
11
|
private _scannerEmitter;
|
|
21
|
-
private
|
|
22
|
-
private _initialized;
|
|
12
|
+
private _initializeCalled;
|
|
23
13
|
private _listenersAdded;
|
|
24
14
|
private _nativeEventEmitter;
|
|
25
15
|
private _registrationInProgress;
|
|
16
|
+
private _waitingForDeviceConnected;
|
|
26
17
|
private _scannerEnabled;
|
|
27
18
|
private _paymentEnvironment;
|
|
19
|
+
private _requestInProgress;
|
|
20
|
+
private _requestQueue;
|
|
28
21
|
/**
|
|
29
22
|
* To avoid pushing native component awareness onto the rest of the app, the native objects
|
|
30
23
|
* are created in the constructor, which only accepts JavaScript parameters.
|
|
@@ -70,6 +63,7 @@ export declare class AurusDevice implements IVendorPaymentDevice, IVendorScanner
|
|
|
70
63
|
* @param authRequest
|
|
71
64
|
*/
|
|
72
65
|
private sendAESDKRegistration(authRequest);
|
|
66
|
+
private sendUpgradeRequest(upgradeType);
|
|
73
67
|
private handleAESDKResponse(xml);
|
|
74
68
|
private convertXmlToJs(xml);
|
|
75
69
|
private processTrans(response);
|
|
@@ -84,15 +78,23 @@ export declare class AurusDevice implements IVendorPaymentDevice, IVendorScanner
|
|
|
84
78
|
private mapAurusSignatureRequired(signatureReceiptFlag);
|
|
85
79
|
private mapAurusPinCaptured(signatureReceiptFlag);
|
|
86
80
|
private parseEMVData(data);
|
|
87
|
-
private handleBarcodeDataReceived(xml);
|
|
88
|
-
private processBarcodeData(barcode);
|
|
89
81
|
/**
|
|
90
82
|
* This method handles events published by the native components. This is an adapter between the native and JavaScript
|
|
91
83
|
* components for asynchronous events from the native layer.
|
|
92
|
-
*
|
|
93
|
-
* @param args
|
|
94
|
-
* @return {any}
|
|
95
84
|
*/
|
|
96
85
|
private onNotificationReceived(...args);
|
|
86
|
+
private handleNotificationEvent(userInfo);
|
|
87
|
+
private handleBarcodeInformationEvent(xmlBarcodeInfo);
|
|
88
|
+
private processBarcodeData(barcode);
|
|
89
|
+
private handleDeviceNotConnectedEvent();
|
|
90
|
+
private handleDeviceConnectedEvent();
|
|
91
|
+
private handleDeviceConfigurationStartedEvent();
|
|
92
|
+
private handleDeviceConfigurationCompletedEvent();
|
|
93
|
+
private handleDeviceConfigurationFailedEvent();
|
|
94
|
+
private handleDeviceAlreadyConfiguredEvent();
|
|
95
|
+
private handleDefaultEvent(userInfoCode);
|
|
96
|
+
private emitPaymentStatus(deviceAvailable, statusCode);
|
|
97
|
+
private emitAuthorizationResponse(responseCode, status);
|
|
97
98
|
private onAESDKLogResponse(...args);
|
|
99
|
+
private sendRequest(xmlRequest);
|
|
98
100
|
}
|