@aptos-scp/scp-component-rn-device-services 0.0.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.
Files changed (82) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +57 -0
  3. package/constants/package.json +7 -0
  4. package/interfaces/package.json +7 -0
  5. package/ios/AurusEnterpriseSDK.framework/AurusEnterpriseSDK +0 -0
  6. package/ios/AurusEnterpriseSDK.framework/Headers/AurusEnterpriseSDK.h +96 -0
  7. package/ios/SCPRNDeviceServices/AdyenPaymentTerminal.h +18 -0
  8. package/ios/SCPRNDeviceServices/AdyenPaymentTerminal.m +63 -0
  9. package/ios/SCPRNDeviceServices/AurusPaymentTerminal.h +19 -0
  10. package/ios/SCPRNDeviceServices/AurusPaymentTerminal.m +72 -0
  11. package/ios/SCPRNDeviceServices/VendorPaymentTerminal.h +24 -0
  12. package/ios/SCPRNDeviceServices/VendorPaymentTerminal.m +58 -0
  13. package/ios/SCPRNDeviceServices.xcodeproj/project.pbxproj +551 -0
  14. package/lib/AurusDevice/AurusPaymentDevice.d.ts +77 -0
  15. package/lib/AurusDevice/AurusPaymentDevice.js +473 -0
  16. package/lib/AurusDevice/AurusPaymentDevice.js.map +1 -0
  17. package/lib/AurusDevice/constants.d.ts +89 -0
  18. package/lib/AurusDevice/constants.js +94 -0
  19. package/lib/AurusDevice/constants.js.map +1 -0
  20. package/lib/AurusDevice/index.d.ts +2 -0
  21. package/lib/AurusDevice/index.js +8 -0
  22. package/lib/AurusDevice/index.js.map +1 -0
  23. package/lib/AurusDevice/sdk-interface/AESDKRegistration.d.ts +43 -0
  24. package/lib/AurusDevice/sdk-interface/AESDKRegistration.js +9 -0
  25. package/lib/AurusDevice/sdk-interface/AESDKRegistration.js.map +1 -0
  26. package/lib/AurusDevice/sdk-interface/AurusPaymentSupport.d.ts +40 -0
  27. package/lib/AurusDevice/sdk-interface/AurusPaymentSupport.js +307 -0
  28. package/lib/AurusDevice/sdk-interface/AurusPaymentSupport.js.map +1 -0
  29. package/lib/AurusDevice/sdk-interface/CancelTransaction.d.ts +49 -0
  30. package/lib/AurusDevice/sdk-interface/CancelTransaction.js +9 -0
  31. package/lib/AurusDevice/sdk-interface/CancelTransaction.js.map +1 -0
  32. package/lib/AurusDevice/sdk-interface/GetCardBinRequest.d.ts +35 -0
  33. package/lib/AurusDevice/sdk-interface/GetCardBinRequest.js +9 -0
  34. package/lib/AurusDevice/sdk-interface/GetCardBinRequest.js.map +1 -0
  35. package/lib/AurusDevice/sdk-interface/PLCCApplication.d.ts +64 -0
  36. package/lib/AurusDevice/sdk-interface/PLCCApplication.js +9 -0
  37. package/lib/AurusDevice/sdk-interface/PLCCApplication.js.map +1 -0
  38. package/lib/AurusDevice/sdk-interface/TransactionRequest.d.ts +159 -0
  39. package/lib/AurusDevice/sdk-interface/TransactionRequest.js +9 -0
  40. package/lib/AurusDevice/sdk-interface/TransactionRequest.js.map +1 -0
  41. package/lib/AurusDevice/sdk-interface/index.d.ts +6 -0
  42. package/lib/AurusDevice/sdk-interface/index.js +7 -0
  43. package/lib/AurusDevice/sdk-interface/index.js.map +1 -0
  44. package/lib/PaymentDeviceFactory.d.ts +11 -0
  45. package/lib/PaymentDeviceFactory.js +33 -0
  46. package/lib/PaymentDeviceFactory.js.map +1 -0
  47. package/lib/PaymentDeviceService.d.ts +19 -0
  48. package/lib/PaymentDeviceService.js +129 -0
  49. package/lib/PaymentDeviceService.js.map +1 -0
  50. package/lib/constants/constants.d.ts +52 -0
  51. package/lib/constants/constants.js +64 -0
  52. package/lib/constants/constants.js.map +1 -0
  53. package/lib/constants/index.d.ts +1 -0
  54. package/lib/constants/index.js +7 -0
  55. package/lib/constants/index.js.map +1 -0
  56. package/lib/index.d.ts +3 -0
  57. package/lib/index.js +8 -0
  58. package/lib/index.js.map +1 -0
  59. package/lib/interfaces/IDeviceStatus.d.ts +7 -0
  60. package/lib/interfaces/IDeviceStatus.js +4 -0
  61. package/lib/interfaces/IDeviceStatus.js.map +1 -0
  62. package/lib/interfaces/index.d.ts +2 -0
  63. package/lib/interfaces/index.js +3 -0
  64. package/lib/interfaces/index.js.map +1 -0
  65. package/lib/interfaces/payment/IPayment.d.ts +25 -0
  66. package/lib/interfaces/payment/IPayment.js +3 -0
  67. package/lib/interfaces/payment/IPayment.js.map +1 -0
  68. package/lib/interfaces/payment/index.d.ts +2 -0
  69. package/lib/interfaces/payment/index.js +3 -0
  70. package/lib/interfaces/payment/index.js.map +1 -0
  71. package/lib/interfaces/payment/messages/index.d.ts +2 -0
  72. package/lib/interfaces/payment/messages/index.js +3 -0
  73. package/lib/interfaces/payment/messages/index.js.map +1 -0
  74. package/lib/interfaces/payment/messages/requests.d.ts +47 -0
  75. package/lib/interfaces/payment/messages/requests.js +3 -0
  76. package/lib/interfaces/payment/messages/requests.js.map +1 -0
  77. package/lib/interfaces/payment/messages/responses.d.ts +57 -0
  78. package/lib/interfaces/payment/messages/responses.js +3 -0
  79. package/lib/interfaces/payment/messages/responses.js.map +1 -0
  80. package/package.json +84 -0
  81. package/types/money-works/index.d.ts +49 -0
  82. package/types/react-native-xml2js/index.d.ts +6 -0
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import { IBankCardRequest, IGiftCardRequest } from "./messages/requests";
2
+ export interface IAuthorizationContext {
3
+ sessionId: string;
4
+ }
5
+ export interface IPaymentDevice {
6
+ initialize(): Promise<void>;
7
+ start(): Promise<void>;
8
+ stop(): Promise<void>;
9
+ tearDown(): Promise<void>;
10
+ captureSale(authRequest: IBankCardRequest): Promise<IAuthorizationContext>;
11
+ captureRefund(authRequest: IBankCardRequest): Promise<IAuthorizationContext>;
12
+ giftcardActivate(authRequest: IGiftCardRequest): Promise<IAuthorizationContext>;
13
+ giftcardBalance(authRequest: IGiftCardRequest): Promise<IAuthorizationContext>;
14
+ giftcardIssue(authRequest: IGiftCardRequest): Promise<IAuthorizationContext>;
15
+ giftcardRedeem(authRequest: IGiftCardRequest): Promise<IAuthorizationContext>;
16
+ void(authRequest: IBankCardRequest): Promise<IAuthorizationContext>;
17
+ }
18
+ export interface IPaymentDeviceConfiguration {
19
+ deviceProvider: string;
20
+ productionEnv?: boolean;
21
+ storeNumber?: string;
22
+ terminalNumber?: string;
23
+ }
24
+ export interface IPaymentDeviceService extends IPaymentDevice {
25
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IPayment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPayment.js","sourceRoot":"","sources":["../../../src/interfaces/payment/IPayment.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./messages";
2
+ export * from "./IPayment";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/payment/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./requests";
2
+ export * from "./responses";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/payment/messages/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ /// <reference types="money-works" />
2
+ import Money = require("money-works");
3
+ import { CardType, PaymentRequestType, TenderType } from "../../../constants/constants";
4
+ export interface ICoreRequest {
5
+ amount?: Money;
6
+ cardNumber?: string;
7
+ cardType?: CardType;
8
+ keyedEntry?: boolean;
9
+ requestType?: PaymentRequestType | string;
10
+ storeNumber?: string;
11
+ terminalNumber?: string;
12
+ transactionNumber?: number;
13
+ }
14
+ export interface IPLCCData {
15
+ amount?: string;
16
+ annualIncome?: string;
17
+ balance?: string;
18
+ cardNumber?: string;
19
+ dob?: string;
20
+ expiryDate?: string;
21
+ firstName?: string;
22
+ lastName?: string;
23
+ middleName?: string;
24
+ phoneNuumber?: string;
25
+ ssn?: string;
26
+ }
27
+ export interface ICustomerAddress {
28
+ Address1?: string;
29
+ Address2?: string;
30
+ Address3?: string;
31
+ Address4?: string;
32
+ City?: string;
33
+ State?: string;
34
+ PostalCode?: string;
35
+ }
36
+ export interface IGiftCardRequest extends ICoreRequest {
37
+ }
38
+ export interface IBankCardRequest extends ICoreRequest {
39
+ referenceNumber?: string;
40
+ tenderType?: TenderType;
41
+ timeout?: number;
42
+ }
43
+ export interface IAuthorizationRequest extends ICoreRequest, IBankCardRequest, IGiftCardRequest {
44
+ customerAddress?: ICustomerAddress;
45
+ operatorID?: string;
46
+ plccData?: IPLCCData;
47
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=requests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/interfaces/payment/messages/requests.ts"],"names":[],"mappings":""}
@@ -0,0 +1,57 @@
1
+ /// <reference types="money-works" />
2
+ import Money = require("money-works");
3
+ import { IPLCCData } from "../../";
4
+ import { CardType, PaymentRequestType, ResponseCodes, TenderType } from "../../../constants/constants";
5
+ export interface IEMVData {
6
+ AID?: string;
7
+ CEM?: string;
8
+ CVM?: string;
9
+ TVR?: string;
10
+ TSI?: string;
11
+ IAD?: string;
12
+ appPreferredName?: string;
13
+ appLabel?: string;
14
+ tranCert?: string;
15
+ additionalData?: string;
16
+ }
17
+ export interface IDCCData {
18
+ foreignAmount?: string;
19
+ foreignCodeAlpha?: string;
20
+ foreignCodeNum?: number;
21
+ foreignRate?: string;
22
+ }
23
+ export interface ICoreResponse {
24
+ cardNumber?: string;
25
+ responseCode?: ResponseCodes;
26
+ status?: string;
27
+ }
28
+ export interface IGiftCardResponse extends ICoreResponse {
29
+ balance?: string;
30
+ }
31
+ export interface IBankCardResponse extends ICoreResponse {
32
+ amount?: Money;
33
+ approvalCode?: string;
34
+ approvedAmount?: Money;
35
+ cardType?: CardType;
36
+ cardUsage?: string;
37
+ customerName?: string;
38
+ entryMethod?: string;
39
+ offlineToken?: string;
40
+ plccData?: IPLCCData;
41
+ rawResponseData?: string;
42
+ receiptData?: string[];
43
+ requestType?: PaymentRequestType | string;
44
+ signatureData?: string;
45
+ signatureRequired?: boolean;
46
+ tenderType?: TenderType;
47
+ userData?: string;
48
+ voidData?: string;
49
+ EMVData?: IEMVData;
50
+ DCCData?: IDCCData;
51
+ }
52
+ export interface IAuthorizationResponse extends IGiftCardResponse, IBankCardResponse {
53
+ date?: string;
54
+ posReference?: string;
55
+ referenceNumber?: string;
56
+ time?: string;
57
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=responses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../../src/interfaces/payment/messages/responses.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@aptos-scp/scp-component-rn-device-services",
3
+ "version": "0.0.1",
4
+ "description": "A react-native component for integrating with devices.",
5
+ "private": false,
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://bitbucket.org/aptosretail/scp-component-rn-device-services.git"
9
+ },
10
+ "publishConfig": {
11
+ "registry": "https://registry.npmjs.com/"
12
+ },
13
+ "files": [
14
+ "constants",
15
+ "interfaces",
16
+ "ios",
17
+ "lib",
18
+ "types"
19
+ ],
20
+ "main": "lib/index.js",
21
+ "types": "lib/index",
22
+ "scripts": {
23
+ "build": "npm run build_src_only && npm run lint",
24
+ "build_src_only": "tsc",
25
+ "build_tests_only": "tsc --project test",
26
+ "clean": "rimraf 'lib/*' 'doc/*' && npm run clean:coverage && npm run clean:test",
27
+ "clean:all": "npm run clean && npm run clean:android && npm run clean:ios && npm run clean:coverage && npm run clean:test",
28
+ "clean:android": "rimraf 'android/build/*' && rimraf 'android/app/build/*'",
29
+ "clean_build_and_lint_all": "npm run clean && npm run pretest",
30
+ "clean:coverage": "rimraf 'coverage/*'",
31
+ "clean:ios": "rimraf 'ios/build/*'",
32
+ "clean:test": "rimraf 'test-js/*'",
33
+ "coverage": "npm run clean:coverage && npm run pretest && istanbul cover --config istanbul.yml _mocha -- --opts mocha.opts 'test-js/**/*.spec.js' && remap-istanbul --input coverage/coverage.json --output coverage --type html",
34
+ "coverage:ci": "npm run clean:coverage && istanbul cover --config istanbul.yml _mocha -- --opts mocha.opts 'test-js/**/*.spec.js' && remap-istanbul --input coverage/coverage.json --output coverage/lcov-ts.info --type lcovonly",
35
+ "lint": "./node_modules/.bin/tslint '@(src|test)/**/*.ts?(x)'",
36
+ "postinstall": "rimraf node_modules/@types/node",
37
+ "prepublishOnly": "npm run clean && npm run test",
38
+ "pretest": "npm run build_src_only && npm run build_tests_only && npm run lint",
39
+ "pretest:ci": "npm run build_tests_only && npm run lint",
40
+ "sonar": "./sonar.sh",
41
+ "test": "mocha --opts mocha.opts --reporter spec 'test-js/**/*.spec.js'",
42
+ "test:ci": "mocha --opts mocha.opts 'test-js/**/*.spec.js'",
43
+ "watch": "tsc --watch",
44
+ "watch_tests": "tsc --project test --watch"
45
+ },
46
+ "license": "SEE LICENSE IN LICENSE.md",
47
+ "dependencies": {
48
+ "@aptos-scp/scp-component-logging": "^0.3.1",
49
+ "@types/big.js": "0.0.31",
50
+ "fbemitter": "2.1.1",
51
+ "inversify": "4.1.1",
52
+ "money-works": "1.5.2",
53
+ "react-native-xml2js": "1.0.3"
54
+ },
55
+ "devDependencies": {
56
+ "@types/chai": "3.5.2",
57
+ "@types/chai-as-promised": "0.0.30",
58
+ "@types/fbemitter": "2.0.32",
59
+ "@types/react": "15.0.30",
60
+ "@types/react-native": "0.44.11",
61
+ "@types/mocha": "2.2.41",
62
+ "@types/sinon": "2.3.2",
63
+ "@types/sinon-chai": "2.7.28",
64
+ "babel-polyfill": "6.23.0",
65
+ "babel-preset-react-native": "2.0.0",
66
+ "chai": "4.0.2",
67
+ "chai-as-promised": "7.0.0",
68
+ "istanbul": "0.4.5",
69
+ "mocha": "3.4.2",
70
+ "react": "16.0.0-alpha.6",
71
+ "react-native": "0.44.2",
72
+ "react-native-mock": "0.3.1",
73
+ "remap-istanbul": "0.9.5",
74
+ "rimraf": "2.6.1",
75
+ "sinon": "2.3.6",
76
+ "sinon-chai": "2.11.0",
77
+ "source-map-support": "0.4.15",
78
+ "tslint": "^4.4.2",
79
+ "typescript": "2.3.0"
80
+ },
81
+ "peerDependencies": {
82
+ "react-native": ">=0.40.x <=0.44.x"
83
+ }
84
+ }
@@ -0,0 +1,49 @@
1
+ // Type definitions for money-works
2
+ // Created by Wesley Anderson <Aptos.com>
3
+
4
+ import * as BigJsLibrary from "big.js";
5
+
6
+ export = Money;
7
+
8
+ /*~ Write your module's methods and properties in this class */
9
+ declare class Money {
10
+ /**
11
+ * Constructor for Money. Instances are immutable.
12
+ *
13
+ * @param amount An amount expressed as a string (optionally containing the currency after a space), an object with an
14
+ * amount and currency properties (like Money or from JSON), a number or a Big value.
15
+ * @param currency The ISO-4217 string identifying the currency.
16
+ */
17
+ constructor(amount: (string| Money | Object | BigJsLibrary.BigNumberInputType), currency?: string);
18
+
19
+ /**
20
+ * Foreign exchange service function. The function returns the exchange rate to convert between the two currencies.
21
+ */
22
+ public static forexService: (fromCurrency: string, toCurrency: string) => BigJsLibrary.BigNumberInputType;
23
+
24
+ public amount: number;
25
+ public currency: Object;
26
+
27
+ public precision(): number;
28
+ public plus(that: Money): Money;
29
+ public minus(that: Money): Money;
30
+ public times(that: number): Money;
31
+ public allocate(ratios: number[], precision: number): Money[];
32
+ public round(precision: number): Money;
33
+ public toString(): string;
34
+ //TODO: Double-check the type of the locale parameter on toLocaleString.
35
+ public toLocaleString(locale: string, options: Object): string;
36
+ //TODO: Double-check the return type on compare.
37
+ public compare(that: Money): number;
38
+ public eq(that: Money): boolean;
39
+ public ne(that: Money): boolean;
40
+ public lt(that: Money): boolean;
41
+ public lte(that: Money): boolean;
42
+ public gt(that: Money): boolean;
43
+ public gte(that: Money): boolean;
44
+ public isZero(): boolean;
45
+ public isNotZero(): boolean;
46
+ public isPositive(): boolean;
47
+ public isNegative(): boolean;
48
+ public to(currency: string): Money;
49
+ }
@@ -0,0 +1,6 @@
1
+ export declare class Parser {
2
+ public assignOrPush(obj: any, key: any, newValue: any): any;
3
+ public parseString(xml: string, callback: any): any;
4
+ public processAsync(): any;
5
+ public reset(): void;
6
+ }