globalpayments-api 1.4.7 → 1.4.9
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/CHANGELOG.md +12 -0
- package/lib/src/Builders/PayFacBuilder.d.ts +96 -0
- package/lib/src/Builders/PayFacBuilder.js +184 -0
- package/lib/src/Entities/DocumentUploadData.d.ts +13 -0
- package/lib/src/Entities/DocumentUploadData.js +48 -0
- package/lib/src/Entities/Enums.d.ts +44 -1
- package/lib/src/Entities/Enums.js +119 -1
- package/lib/src/Entities/ProFac/AccountBalanceResponseData.d.ts +7 -0
- package/lib/src/Entities/ProFac/AccountBalanceResponseData.js +9 -0
- package/lib/src/Entities/ProFac/AccountPermissions.d.ts +15 -0
- package/lib/src/Entities/ProFac/AccountPermissions.js +9 -0
- package/lib/src/Entities/ProFac/BankAccountData.d.ts +10 -0
- package/lib/src/Entities/ProFac/BankAccountData.js +9 -0
- package/lib/src/Entities/ProFac/BankAccountOwnershipData.d.ts +8 -0
- package/lib/src/Entities/ProFac/BankAccountOwnershipData.js +11 -0
- package/lib/src/Entities/ProFac/BeneficialOwnerData.d.ts +6 -0
- package/lib/src/Entities/ProFac/BeneficialOwnerData.js +10 -0
- package/lib/src/Entities/ProFac/BeneficialOwnerDataResult.d.ts +5 -0
- package/lib/src/Entities/ProFac/BeneficialOwnerDataResult.js +9 -0
- package/lib/src/Entities/ProFac/BusinessData.d.ts +14 -0
- package/lib/src/Entities/ProFac/BusinessData.js +11 -0
- package/lib/src/Entities/ProFac/DeviceAttributeInfo.d.ts +4 -0
- package/lib/src/Entities/ProFac/DeviceAttributeInfo.js +9 -0
- package/lib/src/Entities/ProFac/DeviceData.d.ts +5 -0
- package/lib/src/Entities/ProFac/DeviceData.js +10 -0
- package/lib/src/Entities/ProFac/DeviceInfo.d.ts +6 -0
- package/lib/src/Entities/ProFac/DeviceInfo.js +9 -0
- package/lib/src/Entities/ProFac/FlashFundsPaymentCardData.d.ts +7 -0
- package/lib/src/Entities/ProFac/FlashFundsPaymentCardData.js +13 -0
- package/lib/src/Entities/ProFac/GrossBillingInformation.d.ts +8 -0
- package/lib/src/Entities/ProFac/GrossBillingInformation.js +9 -0
- package/lib/src/Entities/ProFac/OrderDevice.d.ts +18 -0
- package/lib/src/Entities/ProFac/OrderDevice.js +9 -0
- package/lib/src/Entities/ProFac/OwnersData.d.ts +12 -0
- package/lib/src/Entities/ProFac/OwnersData.js +11 -0
- package/lib/src/Entities/ProFac/PayFacResponseData.d.ts +55 -0
- package/lib/src/Entities/ProFac/PayFacResponseData.js +9 -0
- package/lib/src/Entities/ProFac/RenewAccountData.d.ts +10 -0
- package/lib/src/Entities/ProFac/RenewAccountData.js +11 -0
- package/lib/src/Entities/ProFac/SignificantOwnerData.d.ts +8 -0
- package/lib/src/Entities/ProFac/SignificantOwnerData.js +11 -0
- package/lib/src/Entities/ProFac/ThreatRiskData.d.ts +5 -0
- package/lib/src/Entities/ProFac/ThreatRiskData.js +9 -0
- package/lib/src/Entities/ProFac/UserPersonalData.d.ts +26 -0
- package/lib/src/Entities/ProFac/UserPersonalData.js +14 -0
- package/lib/src/Entities/SSORequestData.d.ts +5 -0
- package/lib/src/Entities/SSORequestData.js +9 -0
- package/lib/src/Entities/Transaction.d.ts +2 -0
- package/lib/src/Gateways/IPayFacProvider.d.ts +5 -0
- package/lib/src/Gateways/IPayFacProvider.js +2 -0
- package/lib/src/Gateways/PayPlanConnector.d.ts +1 -0
- package/lib/src/Gateways/PayPlanConnector.js +13 -1
- package/lib/src/Gateways/PorticoConnector.d.ts +1 -0
- package/lib/src/Gateways/PorticoConnector.js +6 -0
- package/lib/src/Gateways/ProPayConnector.d.ts +41 -0
- package/lib/src/Gateways/ProPayConnector.js +698 -0
- package/lib/src/Gateways/XmlGateway.d.ts +1 -0
- package/lib/src/Gateways/XmlGateway.js +9 -0
- package/lib/src/PaymentMethods/CreditCardData.d.ts +1 -0
- package/lib/src/PaymentMethods/CreditCardData.js +6 -0
- package/lib/src/Services/PayFacService.d.ts +26 -0
- package/lib/src/Services/PayFacService.js +77 -0
- package/lib/src/ServicesConfig.d.ts +5 -0
- package/lib/src/ServicesContainer.d.ts +4 -1
- package/lib/src/ServicesContainer.js +17 -2
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTests.js +100 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTests.js +352 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTests.js +123 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTests.js +146 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/TestData/TestAccountData.d.ts +39 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/TestData/TestAccountData.js +371 -0
- package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTests.js +100 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTests.js +535 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTests.js +124 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTests.js +144 -0
- package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestAccountData.d.ts +33 -0
- package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestAccountData.js +268 -0
- package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestFundsData.d.ts +4 -0
- package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestFundsData.js +30 -0
- package/logger.txt +478 -5
- package/package.json +1 -1
|
@@ -17,14 +17,23 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.XmlGateway = void 0;
|
|
19
19
|
var Gateway_1 = require("./Gateway");
|
|
20
|
+
var fs = require("fs");
|
|
20
21
|
var XmlGateway = /** @class */ (function (_super) {
|
|
21
22
|
__extends(XmlGateway, _super);
|
|
22
23
|
function XmlGateway() {
|
|
23
24
|
return _super.call(this, "text/xml") || this;
|
|
24
25
|
}
|
|
25
26
|
XmlGateway.prototype.doTransaction = function (requestData) {
|
|
27
|
+
this.log(requestData);
|
|
26
28
|
return this.sendRequest("POST", "", requestData);
|
|
27
29
|
};
|
|
30
|
+
XmlGateway.prototype.log = function (text) {
|
|
31
|
+
fs.appendFile('logger.txt', text + '\n', function (err) {
|
|
32
|
+
if (err)
|
|
33
|
+
throw err;
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
;
|
|
28
37
|
return XmlGateway;
|
|
29
38
|
}(Gateway_1.Gateway));
|
|
30
39
|
exports.XmlGateway = XmlGateway;
|
|
@@ -37,6 +37,12 @@ var CreditCardData = /** @class */ (function (_super) {
|
|
|
37
37
|
}
|
|
38
38
|
return "Unknown";
|
|
39
39
|
};
|
|
40
|
+
CreditCardData.prototype.getShortExpiry = function () {
|
|
41
|
+
if (this.expMonth != null && this.expYear != null) {
|
|
42
|
+
return this.expMonth + this.expYear.slice(-2);
|
|
43
|
+
}
|
|
44
|
+
return '';
|
|
45
|
+
};
|
|
40
46
|
CreditCardData.cardTypes = [
|
|
41
47
|
{ name: "Visa", regex: /^4/ },
|
|
42
48
|
{ name: "MC", regex: /^(5[1-5]|2[2-7])/ },
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PayFacBuilder } from "../Builders/PayFacBuilder";
|
|
2
|
+
export declare class PayFacService {
|
|
3
|
+
constructor();
|
|
4
|
+
createAccount(): PayFacBuilder;
|
|
5
|
+
editAccount(): PayFacBuilder;
|
|
6
|
+
resetPassword(): PayFacBuilder;
|
|
7
|
+
renewAccount(): PayFacBuilder;
|
|
8
|
+
updateBeneficialOwnershipInfo(): PayFacBuilder;
|
|
9
|
+
disownAccount(): PayFacBuilder;
|
|
10
|
+
uploadDocumentChargeback(): PayFacBuilder;
|
|
11
|
+
uploadDocument(): PayFacBuilder;
|
|
12
|
+
obtainSSOKey(): PayFacBuilder;
|
|
13
|
+
updateBankAccountOwnershipInfo(): PayFacBuilder;
|
|
14
|
+
addFunds(): PayFacBuilder;
|
|
15
|
+
sweepFunds(): PayFacBuilder;
|
|
16
|
+
addCardFlashFunds(): PayFacBuilder;
|
|
17
|
+
pushMoneyToFlashFundsCard(): PayFacBuilder;
|
|
18
|
+
disburseFunds(): PayFacBuilder;
|
|
19
|
+
spendBack(): PayFacBuilder;
|
|
20
|
+
reverseSplitPay(): PayFacBuilder;
|
|
21
|
+
splitFunds(): PayFacBuilder;
|
|
22
|
+
getAccountDetails(): PayFacBuilder;
|
|
23
|
+
getAccountDetailsEnhanced(): PayFacBuilder;
|
|
24
|
+
getAccountBalance(): PayFacBuilder;
|
|
25
|
+
orderDevice(): PayFacBuilder;
|
|
26
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PayFacService = void 0;
|
|
4
|
+
var PayFacBuilder_1 = require("../Builders/PayFacBuilder");
|
|
5
|
+
var Enums_1 = require("../Entities/Enums");
|
|
6
|
+
var PayFacService = /** @class */ (function () {
|
|
7
|
+
function PayFacService() {
|
|
8
|
+
}
|
|
9
|
+
PayFacService.prototype.createAccount = function () {
|
|
10
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.CreateAccount);
|
|
11
|
+
};
|
|
12
|
+
PayFacService.prototype.editAccount = function () {
|
|
13
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.EditAccount);
|
|
14
|
+
};
|
|
15
|
+
PayFacService.prototype.resetPassword = function () {
|
|
16
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.ResetPassword);
|
|
17
|
+
};
|
|
18
|
+
PayFacService.prototype.renewAccount = function () {
|
|
19
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.RenewAccount);
|
|
20
|
+
};
|
|
21
|
+
PayFacService.prototype.updateBeneficialOwnershipInfo = function () {
|
|
22
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.UpdateBeneficialOwnership);
|
|
23
|
+
};
|
|
24
|
+
PayFacService.prototype.disownAccount = function () {
|
|
25
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.DisownAccount);
|
|
26
|
+
};
|
|
27
|
+
PayFacService.prototype.uploadDocumentChargeback = function () {
|
|
28
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.UploadDocumentChargeback);
|
|
29
|
+
};
|
|
30
|
+
PayFacService.prototype.uploadDocument = function () {
|
|
31
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.UploadDocument);
|
|
32
|
+
};
|
|
33
|
+
PayFacService.prototype.obtainSSOKey = function () {
|
|
34
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.ObtainSSOKey);
|
|
35
|
+
};
|
|
36
|
+
PayFacService.prototype.updateBankAccountOwnershipInfo = function () {
|
|
37
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.UpdateBankAccountOwnership);
|
|
38
|
+
};
|
|
39
|
+
PayFacService.prototype.addFunds = function () {
|
|
40
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.AddFunds);
|
|
41
|
+
};
|
|
42
|
+
PayFacService.prototype.sweepFunds = function () {
|
|
43
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.SweepFunds);
|
|
44
|
+
};
|
|
45
|
+
PayFacService.prototype.addCardFlashFunds = function () {
|
|
46
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.AddCardFlashFunds);
|
|
47
|
+
};
|
|
48
|
+
PayFacService.prototype.pushMoneyToFlashFundsCard = function () {
|
|
49
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.PushMoneyFlashFunds);
|
|
50
|
+
};
|
|
51
|
+
PayFacService.prototype.disburseFunds = function () {
|
|
52
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.DisburseFunds);
|
|
53
|
+
};
|
|
54
|
+
PayFacService.prototype.spendBack = function () {
|
|
55
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.SpendBack);
|
|
56
|
+
};
|
|
57
|
+
PayFacService.prototype.reverseSplitPay = function () {
|
|
58
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.ReverseSplitPay);
|
|
59
|
+
};
|
|
60
|
+
PayFacService.prototype.splitFunds = function () {
|
|
61
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.SplitFunds);
|
|
62
|
+
};
|
|
63
|
+
PayFacService.prototype.getAccountDetails = function () {
|
|
64
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.GetAccountDetails);
|
|
65
|
+
};
|
|
66
|
+
PayFacService.prototype.getAccountDetailsEnhanced = function () {
|
|
67
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.GetAccountDetails, Enums_1.TransactionModifier.Additional);
|
|
68
|
+
};
|
|
69
|
+
PayFacService.prototype.getAccountBalance = function () {
|
|
70
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.GetAccountBalance);
|
|
71
|
+
};
|
|
72
|
+
PayFacService.prototype.orderDevice = function () {
|
|
73
|
+
return new PayFacBuilder_1.PayFacBuilder(Enums_1.TransactionType.OrderDevice);
|
|
74
|
+
};
|
|
75
|
+
return PayFacService;
|
|
76
|
+
}());
|
|
77
|
+
exports.PayFacService = PayFacService;
|
|
@@ -8,6 +8,7 @@ export declare class ServicesConfig {
|
|
|
8
8
|
developerId: string;
|
|
9
9
|
versionNumber: string;
|
|
10
10
|
secretApiKey: string;
|
|
11
|
+
sdkNameVersion: string;
|
|
11
12
|
accountId: string;
|
|
12
13
|
merchantId: string;
|
|
13
14
|
sharedSecret: string;
|
|
@@ -15,6 +16,10 @@ export declare class ServicesConfig {
|
|
|
15
16
|
rebatePassword: string;
|
|
16
17
|
refundPassword: string;
|
|
17
18
|
hostedPaymentConfig: HostedPaymentConfig;
|
|
19
|
+
certificationStr: string;
|
|
20
|
+
terminalID: string;
|
|
21
|
+
x509CertificateString: string;
|
|
22
|
+
x509CertificationPath: string;
|
|
18
23
|
serviceUrl: string;
|
|
19
24
|
timeout: number;
|
|
20
25
|
constructor();
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { IPaymentGateway, IRecurringService, ServicesConfig } from "./";
|
|
2
|
+
import { IPayFacProvider } from "./Gateways/IPayFacProvider";
|
|
2
3
|
export declare class ServicesContainer {
|
|
3
4
|
private static _instance;
|
|
4
5
|
private _gateway;
|
|
5
6
|
private _recurring;
|
|
7
|
+
private _xmlGateway;
|
|
6
8
|
static instance(): ServicesContainer;
|
|
7
9
|
static configure(config: ServicesConfig): void;
|
|
8
|
-
constructor(gateway?: IPaymentGateway, recurring?: IRecurringService);
|
|
10
|
+
constructor(gateway?: IPaymentGateway, recurring?: IRecurringService, xmlGateway?: IPayFacProvider);
|
|
9
11
|
getClient(): IPaymentGateway;
|
|
10
12
|
getRecurringClient(): IRecurringService;
|
|
13
|
+
getXmlClient(): IPayFacProvider;
|
|
11
14
|
}
|
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ServicesContainer = void 0;
|
|
4
4
|
var _1 = require("./");
|
|
5
|
+
var ProPayConnector_1 = require("./Gateways/ProPayConnector");
|
|
5
6
|
var ServicesContainer = /** @class */ (function () {
|
|
6
|
-
function ServicesContainer(gateway, recurring) {
|
|
7
|
+
function ServicesContainer(gateway, recurring, xmlGateway) {
|
|
7
8
|
if (gateway) {
|
|
8
9
|
this._gateway = gateway;
|
|
9
10
|
}
|
|
10
11
|
if (recurring) {
|
|
11
12
|
this._recurring = recurring;
|
|
12
13
|
}
|
|
14
|
+
if (xmlGateway) {
|
|
15
|
+
this._xmlGateway = xmlGateway;
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
ServicesContainer.instance = function () {
|
|
15
19
|
if (ServicesContainer._instance === null) {
|
|
@@ -43,6 +47,7 @@ var ServicesContainer = /** @class */ (function () {
|
|
|
43
47
|
gateway.secretApiKey = config.secretApiKey;
|
|
44
48
|
gateway.developerId = config.developerId;
|
|
45
49
|
gateway.versionNumber = config.versionNumber;
|
|
50
|
+
gateway.sdkNameVersion = config.sdkNameVersion;
|
|
46
51
|
gateway.timeout = config.timeout;
|
|
47
52
|
gateway.serviceUrl =
|
|
48
53
|
config.serviceUrl + "/Hps.Exchange.PosGateway/PosGatewayService.asmx";
|
|
@@ -58,7 +63,14 @@ var ServicesContainer = /** @class */ (function () {
|
|
|
58
63
|
payplan.timeout = config.timeout;
|
|
59
64
|
payplan.serviceUrl = config.serviceUrl
|
|
60
65
|
+ (config.serviceUrl.includes('cert.') ? "/Portico.PayPlan.v2/" : "/payplan.v2/");
|
|
61
|
-
|
|
66
|
+
var gatewayObj = new ProPayConnector_1.ProPayConnector();
|
|
67
|
+
gatewayObj.serviceUrl = config.serviceUrl;
|
|
68
|
+
gatewayObj.certStr = config.certificationStr;
|
|
69
|
+
gatewayObj.termID = config.terminalID;
|
|
70
|
+
gatewayObj.timeout = config.timeout;
|
|
71
|
+
gatewayObj.x509CertificatePath = config.x509CertificationPath;
|
|
72
|
+
gatewayObj.x509CertStr = config.x509CertificateString;
|
|
73
|
+
ServicesContainer._instance = new ServicesContainer(gateway, payplan, gatewayObj);
|
|
62
74
|
}
|
|
63
75
|
};
|
|
64
76
|
ServicesContainer.prototype.getClient = function () {
|
|
@@ -67,6 +79,9 @@ var ServicesContainer = /** @class */ (function () {
|
|
|
67
79
|
ServicesContainer.prototype.getRecurringClient = function () {
|
|
68
80
|
return this._recurring;
|
|
69
81
|
};
|
|
82
|
+
ServicesContainer.prototype.getXmlClient = function () {
|
|
83
|
+
return this._xmlGateway;
|
|
84
|
+
};
|
|
70
85
|
return ServicesContainer;
|
|
71
86
|
}());
|
|
72
87
|
exports.ServicesContainer = ServicesContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var ava_1 = require("ava");
|
|
40
|
+
var PayFacService_1 = require("../../../../../src/Services/PayFacService");
|
|
41
|
+
var src_1 = require("../../../../../src/");
|
|
42
|
+
var config = new src_1.ServicesConfig();
|
|
43
|
+
config.serviceUrl = "https://xmltest.propay.com/API/PropayAPI.aspx";
|
|
44
|
+
config.certificationStr = "d17d770d4734341aaedab32b7a7763";
|
|
45
|
+
config.terminalID = "7a7763";
|
|
46
|
+
var _service = new PayFacService_1.PayFacService();
|
|
47
|
+
ava_1.default.before(function (_t) {
|
|
48
|
+
src_1.ServicesContainer.configure(config);
|
|
49
|
+
});
|
|
50
|
+
ava_1.default("get account info", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
+
var response;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
switch (_a.label) {
|
|
54
|
+
case 0:
|
|
55
|
+
t.plan(2);
|
|
56
|
+
return [4 /*yield*/, _service.getAccountDetails()
|
|
57
|
+
.withAccountNumber("718570752")
|
|
58
|
+
.execute()];
|
|
59
|
+
case 1:
|
|
60
|
+
response = _a.sent();
|
|
61
|
+
t.truthy(response);
|
|
62
|
+
t.is("00", response.responseCode);
|
|
63
|
+
return [2 /*return*/];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}); });
|
|
67
|
+
ava_1.default("get account balance", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
|
+
var response;
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
switch (_a.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
t.plan(2);
|
|
73
|
+
return [4 /*yield*/, _service.getAccountBalance()
|
|
74
|
+
.withAccountNumber("718570752")
|
|
75
|
+
.execute()];
|
|
76
|
+
case 1:
|
|
77
|
+
response = _a.sent();
|
|
78
|
+
t.truthy(response);
|
|
79
|
+
t.is("00", response.responseCode);
|
|
80
|
+
return [2 /*return*/];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}); });
|
|
84
|
+
ava_1.default("get account info enchance", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
+
var response;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0:
|
|
89
|
+
t.plan(2);
|
|
90
|
+
return [4 /*yield*/, _service.getAccountDetailsEnhanced()
|
|
91
|
+
.withAccountNumber("718570752")
|
|
92
|
+
.execute()];
|
|
93
|
+
case 1:
|
|
94
|
+
response = _a.sent();
|
|
95
|
+
t.truthy(response);
|
|
96
|
+
t.is("00", response.responseCode);
|
|
97
|
+
return [2 /*return*/];
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}); });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|