@blockchyp/blockchyp-ts 1.0.0
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/.eslintrc.json +20 -0
- package/LICENSE +21 -0
- package/README.md +4314 -0
- package/index.js +24 -0
- package/index.ts +3 -0
- package/itest/ActivateTerminalITestSpec.js +87 -0
- package/itest/ActivateTerminalITestSpec.ts +58 -0
- package/itest/AddTestMerchantITestSpec.js +89 -0
- package/itest/AddTestMerchantITestSpec.ts +60 -0
- package/itest/BatchHistoryITestSpec.js +101 -0
- package/itest/BatchHistoryITestSpec.ts +73 -0
- package/itest/BooleanPromptITestSpec.js +104 -0
- package/itest/BooleanPromptITestSpec.ts +76 -0
- package/itest/CancelPaymentLinkITestSpec.js +116 -0
- package/itest/CancelPaymentLinkITestSpec.ts +93 -0
- package/itest/CaptureSignatureITestSpec.js +101 -0
- package/itest/CaptureSignatureITestSpec.ts +73 -0
- package/itest/DeactivateTerminalITestSpec.js +82 -0
- package/itest/DeactivateTerminalITestSpec.ts +52 -0
- package/itest/DeleteBrandingAssetITestSpec.js +96 -0
- package/itest/DeleteBrandingAssetITestSpec.ts +69 -0
- package/itest/DeleteCustomerITestSpec.js +102 -0
- package/itest/DeleteCustomerITestSpec.ts +75 -0
- package/itest/DeleteMediaAssetITestSpec.js +100 -0
- package/itest/DeleteMediaAssetITestSpec.ts +71 -0
- package/itest/DeleteQueuedTransactionITestSpec.js +117 -0
- package/itest/DeleteQueuedTransactionITestSpec.ts +89 -0
- package/itest/DeleteSlideShowITestSpec.js +96 -0
- package/itest/DeleteSlideShowITestSpec.ts +69 -0
- package/itest/DeleteSurveyQuestionITestSpec.js +97 -0
- package/itest/DeleteSurveyQuestionITestSpec.ts +70 -0
- package/itest/DeleteTestMerchantITestSpec.js +96 -0
- package/itest/DeleteTestMerchantITestSpec.ts +69 -0
- package/itest/DeleteTokenITestSpec.js +102 -0
- package/itest/DeleteTokenITestSpec.ts +75 -0
- package/itest/EmptyBrandingAssetITestSpec.js +85 -0
- package/itest/EmptyBrandingAssetITestSpec.ts +57 -0
- package/itest/EmptySlideShowITestSpec.js +87 -0
- package/itest/EmptySlideShowITestSpec.ts +58 -0
- package/itest/GatewayTimeoutITestSpec.js +103 -0
- package/itest/GatewayTimeoutITestSpec.ts +73 -0
- package/itest/GetCustomerITestSpec.js +102 -0
- package/itest/GetCustomerITestSpec.ts +75 -0
- package/itest/GetMerchantsITestSpec.js +84 -0
- package/itest/GetMerchantsITestSpec.ts +56 -0
- package/itest/InviteMerchantUserITestSpec.js +86 -0
- package/itest/InviteMerchantUserITestSpec.ts +58 -0
- package/itest/LinkTokenITestSpec.js +103 -0
- package/itest/LinkTokenITestSpec.ts +76 -0
- package/itest/ListQueuedTransactionsITestSpec.js +116 -0
- package/itest/ListQueuedTransactionsITestSpec.ts +88 -0
- package/itest/ListTerminalsITestSpec.js +83 -0
- package/itest/ListTerminalsITestSpec.ts +56 -0
- package/itest/MediaAssetITestSpec.js +105 -0
- package/itest/MediaAssetITestSpec.ts +75 -0
- package/itest/MediaITestSpec.js +83 -0
- package/itest/MediaITestSpec.ts +56 -0
- package/itest/MediaUploadITestSpec.js +94 -0
- package/itest/MediaUploadITestSpec.ts +63 -0
- package/itest/MerchantCredentialGenerationITestSpec.js +85 -0
- package/itest/MerchantCredentialGenerationITestSpec.ts +57 -0
- package/itest/MerchantInvoiceDetailITestSpec.js +84 -0
- package/itest/MerchantInvoiceDetailITestSpec.ts +56 -0
- package/itest/MerchantInvoicesITestSpec.js +84 -0
- package/itest/MerchantInvoicesITestSpec.ts +56 -0
- package/itest/MerchantPlatformsITestSpec.js +96 -0
- package/itest/MerchantPlatformsITestSpec.ts +69 -0
- package/itest/MerchantProfileITestSpec.js +84 -0
- package/itest/MerchantProfileITestSpec.ts +56 -0
- package/itest/MerchantUsersITestSpec.js +83 -0
- package/itest/MerchantUsersITestSpec.ts +56 -0
- package/itest/NewTransactionDisplayITestSpec.js +115 -0
- package/itest/NewTransactionDisplayITestSpec.ts +92 -0
- package/itest/PANChargeITestSpec.js +118 -0
- package/itest/PANChargeITestSpec.ts +88 -0
- package/itest/PANEnrollITestSpec.js +118 -0
- package/itest/PANEnrollITestSpec.ts +90 -0
- package/itest/PANPreauthITestSpec.js +116 -0
- package/itest/PANPreauthITestSpec.ts +87 -0
- package/itest/PartialRefundITestSpec.js +119 -0
- package/itest/PartialRefundITestSpec.ts +91 -0
- package/itest/PartnerCommissionBreakdownITestSpec.js +84 -0
- package/itest/PartnerCommissionBreakdownITestSpec.ts +56 -0
- package/itest/PartnerStatementDetailITestSpec.js +84 -0
- package/itest/PartnerStatementDetailITestSpec.ts +56 -0
- package/itest/PartnerStatementsITestSpec.js +84 -0
- package/itest/PartnerStatementsITestSpec.ts +56 -0
- package/itest/PaymentLinkStatusITestSpec.js +116 -0
- package/itest/PaymentLinkStatusITestSpec.ts +93 -0
- package/itest/PricingPolicyITestSpec.js +85 -0
- package/itest/PricingPolicyITestSpec.ts +57 -0
- package/itest/ResendPaymentLinkITestSpec.js +116 -0
- package/itest/ResendPaymentLinkITestSpec.ts +93 -0
- package/itest/SearchCustomerITestSpec.js +101 -0
- package/itest/SearchCustomerITestSpec.ts +75 -0
- package/itest/SendPaymentLinkITestSpec.js +107 -0
- package/itest/SendPaymentLinkITestSpec.ts +82 -0
- package/itest/SimpleBatchCloseITestSpec.js +101 -0
- package/itest/SimpleBatchCloseITestSpec.ts +73 -0
- package/itest/SimpleCaptureITestSpec.js +101 -0
- package/itest/SimpleCaptureITestSpec.ts +74 -0
- package/itest/SimpleGiftActivateITestSpec.js +104 -0
- package/itest/SimpleGiftActivateITestSpec.ts +75 -0
- package/itest/SimpleLocateITestSpec.js +85 -0
- package/itest/SimpleLocateITestSpec.ts +57 -0
- package/itest/SimpleMessageITestSpec.js +101 -0
- package/itest/SimpleMessageITestSpec.ts +73 -0
- package/itest/SimplePingITestSpec.js +100 -0
- package/itest/SimplePingITestSpec.ts +72 -0
- package/itest/SimpleRefundITestSpec.js +118 -0
- package/itest/SimpleRefundITestSpec.ts +90 -0
- package/itest/SimpleReversalITestSpec.js +103 -0
- package/itest/SimpleReversalITestSpec.ts +75 -0
- package/itest/SimpleVoidITestSpec.js +103 -0
- package/itest/SimpleVoidITestSpec.ts +75 -0
- package/itest/SlideShowITestSpec.js +98 -0
- package/itest/SlideShowITestSpec.ts +70 -0
- package/itest/SlideShowsITestSpec.js +95 -0
- package/itest/SlideShowsITestSpec.ts +69 -0
- package/itest/SurveyQuestionITestSpec.js +95 -0
- package/itest/SurveyQuestionITestSpec.ts +68 -0
- package/itest/SurveyQuestionsITestSpec.js +96 -0
- package/itest/SurveyQuestionsITestSpec.ts +70 -0
- package/itest/SurveyResultsITestSpec.js +95 -0
- package/itest/SurveyResultsITestSpec.ts +68 -0
- package/itest/TCDeleteTemplateITestSpec.js +98 -0
- package/itest/TCDeleteTemplateITestSpec.ts +70 -0
- package/itest/TCEntryITestSpec.js +103 -0
- package/itest/TCEntryITestSpec.ts +76 -0
- package/itest/TCLogITestSpec.js +83 -0
- package/itest/TCLogITestSpec.ts +56 -0
- package/itest/TCTemplateITestSpec.js +101 -0
- package/itest/TCTemplateITestSpec.ts +72 -0
- package/itest/TCTemplateUpdateITestSpec.js +91 -0
- package/itest/TCTemplateUpdateITestSpec.ts +61 -0
- package/itest/TCTemplatesITestSpec.js +83 -0
- package/itest/TCTemplatesITestSpec.ts +56 -0
- package/itest/TerminalBrandingITestSpec.js +83 -0
- package/itest/TerminalBrandingITestSpec.ts +56 -0
- package/itest/TerminalChargeITestSpec.js +113 -0
- package/itest/TerminalChargeITestSpec.ts +84 -0
- package/itest/TerminalClearITestSpec.js +100 -0
- package/itest/TerminalClearITestSpec.ts +72 -0
- package/itest/TerminalEBTBalanceITestSpec.js +103 -0
- package/itest/TerminalEBTBalanceITestSpec.ts +74 -0
- package/itest/TerminalEBTChargeITestSpec.js +115 -0
- package/itest/TerminalEBTChargeITestSpec.ts +86 -0
- package/itest/TerminalEnrollITestSpec.js +112 -0
- package/itest/TerminalEnrollITestSpec.ts +83 -0
- package/itest/TerminalGiftCardBalanceITestSpec.js +102 -0
- package/itest/TerminalGiftCardBalanceITestSpec.ts +73 -0
- package/itest/TerminalKeyedChargeITestSpec.js +114 -0
- package/itest/TerminalKeyedChargeITestSpec.ts +85 -0
- package/itest/TerminalManualEBTChargeITestSpec.js +116 -0
- package/itest/TerminalManualEBTChargeITestSpec.ts +87 -0
- package/itest/TerminalPreauthITestSpec.js +113 -0
- package/itest/TerminalPreauthITestSpec.ts +84 -0
- package/itest/TerminalQueuedTransactionITestSpec.js +108 -0
- package/itest/TerminalQueuedTransactionITestSpec.ts +78 -0
- package/itest/TerminalStatusITestSpec.js +100 -0
- package/itest/TerminalStatusITestSpec.ts +72 -0
- package/itest/TerminalTimeoutITestSpec.js +99 -0
- package/itest/TerminalTimeoutITestSpec.ts +70 -0
- package/itest/TermsAndConditionsITestSpec.js +105 -0
- package/itest/TermsAndConditionsITestSpec.ts +77 -0
- package/itest/TextPromptITestSpec.js +103 -0
- package/itest/TextPromptITestSpec.ts +74 -0
- package/itest/TokenMetadataITestSpec.js +102 -0
- package/itest/TokenMetadataITestSpec.ts +75 -0
- package/itest/TransactionHistoryITestSpec.js +101 -0
- package/itest/TransactionHistoryITestSpec.ts +73 -0
- package/itest/UnlinkTokenITestSpec.js +103 -0
- package/itest/UnlinkTokenITestSpec.ts +76 -0
- package/itest/UpdateBrandingAssetITestSpec.js +109 -0
- package/itest/UpdateBrandingAssetITestSpec.ts +80 -0
- package/itest/UpdateCustomerITestSpec.js +90 -0
- package/itest/UpdateCustomerITestSpec.ts +63 -0
- package/itest/UpdateMerchantITestSpec.js +92 -0
- package/itest/UpdateMerchantITestSpec.ts +65 -0
- package/itest/UpdateMerchantPlatformsITestSpec.js +98 -0
- package/itest/UpdateMerchantPlatformsITestSpec.ts +71 -0
- package/itest/UpdateSlideShowITestSpec.js +106 -0
- package/itest/UpdateSlideShowITestSpec.ts +78 -0
- package/itest/UpdateSurveyQuestionITestSpec.js +89 -0
- package/itest/UpdateSurveyQuestionITestSpec.ts +60 -0
- package/itest/UpdateTransactionDisplayITestSpec.js +115 -0
- package/itest/UpdateTransactionDisplayITestSpec.ts +92 -0
- package/itest/UploadStatusITestSpec.js +100 -0
- package/itest/UploadStatusITestSpec.ts +71 -0
- package/itest/support/aviato.png +0 -0
- package/itest/support/config.js +67 -0
- package/itest/support/config.ts +106 -0
- package/itest/support/jasmine.json +11 -0
- package/package.json +73 -0
- package/spec/CryptoSpec.js +35 -0
- package/spec/CryptoSpec.ts +35 -0
- package/spec/SanitySpec.js +26 -0
- package/spec/SanitySpec.ts +23 -0
- package/spec/support/jasmine.json +11 -0
- package/src/client.js +941 -0
- package/src/client.ts +1012 -0
- package/src/cryptoutils.js +89 -0
- package/src/cryptoutils.ts +80 -0
- package/src/global.js +9 -0
- package/src/global.ts +5 -0
- package/src/models.js +9382 -0
- package/src/models.ts +16509 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is governed
|
|
3
|
+
* by a license that can be found in the LICENSE file.
|
|
4
|
+
*
|
|
5
|
+
* This file was generated automatically by the BlockChyp SDK Generator. Changes to this
|
|
6
|
+
* file will be lost every time the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import { Config } from './support/config';
|
|
11
|
+
import * as BlockChyp from '../index';
|
|
12
|
+
|
|
13
|
+
describe('GetMerchants', function () {
|
|
14
|
+
let originalTimeout: number;
|
|
15
|
+
let client: typeof BlockChyp.BlockChypClient;
|
|
16
|
+
Config.load();
|
|
17
|
+
|
|
18
|
+
beforeEach(function () {
|
|
19
|
+
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
|
20
|
+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('returns a pageable list of merchants.', function (done) {
|
|
24
|
+
client = BlockChyp.newClient(Config.getCreds("partner"));
|
|
25
|
+
client.setGatewayHost(Config.getGatewayHost());
|
|
26
|
+
client.setTestGatewayHost(Config.getTestGatewayHost());
|
|
27
|
+
client.setDashboardHost(Config.getDashboardHost());
|
|
28
|
+
|
|
29
|
+
const testDelay = process.env.BC_TEST_DELAY;
|
|
30
|
+
let testDelayInt = 0;
|
|
31
|
+
if (testDelay) {
|
|
32
|
+
testDelayInt = parseInt(testDelay);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
console.log('Running getMerchants...');
|
|
36
|
+
|
|
37
|
+
setTimeout(async function () {
|
|
38
|
+
try {
|
|
39
|
+
// setup request object
|
|
40
|
+
const request = new BlockChyp.GetMerchantsRequest();
|
|
41
|
+
request.test = true;
|
|
42
|
+
|
|
43
|
+
const httpResponse = await client.getMerchants(request)
|
|
44
|
+
const response: BlockChyp.GetMerchantsResponse = httpResponse.data;
|
|
45
|
+
// response assertions
|
|
46
|
+
expect(response.success).toBe(true);
|
|
47
|
+
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.log('Error:', error);
|
|
50
|
+
fail(error);
|
|
51
|
+
} finally {
|
|
52
|
+
done();
|
|
53
|
+
}
|
|
54
|
+
}, testDelayInt * 1000);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is governed
|
|
4
|
+
* by a license that can be found in the LICENSE file.
|
|
5
|
+
*
|
|
6
|
+
* This file was generated automatically by the BlockChyp SDK Generator. Changes to this
|
|
7
|
+
* file will be lost every time the code is regenerated.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
36
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
37
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
38
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
const config_1 = require("./support/config");
|
|
43
|
+
const BlockChyp = __importStar(require("../index"));
|
|
44
|
+
describe('InviteMerchantUser', function () {
|
|
45
|
+
let originalTimeout;
|
|
46
|
+
let client;
|
|
47
|
+
config_1.Config.load();
|
|
48
|
+
beforeEach(function () {
|
|
49
|
+
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
|
50
|
+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
|
51
|
+
});
|
|
52
|
+
it('invites a user to join a merchant account.', function (done) {
|
|
53
|
+
client = BlockChyp.newClient(config_1.Config.getCreds(""));
|
|
54
|
+
client.setGatewayHost(config_1.Config.getGatewayHost());
|
|
55
|
+
client.setTestGatewayHost(config_1.Config.getTestGatewayHost());
|
|
56
|
+
client.setDashboardHost(config_1.Config.getDashboardHost());
|
|
57
|
+
const testDelay = process.env.BC_TEST_DELAY;
|
|
58
|
+
let testDelayInt = 0;
|
|
59
|
+
if (testDelay) {
|
|
60
|
+
testDelayInt = parseInt(testDelay);
|
|
61
|
+
}
|
|
62
|
+
console.log('Running inviteMerchantUser...');
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
try {
|
|
66
|
+
// setup request object
|
|
67
|
+
const request = new BlockChyp.InviteMerchantUserRequest();
|
|
68
|
+
request.email = 'doublea@blockchypteam.m8r.co';
|
|
69
|
+
request.firstName = 'Aaron';
|
|
70
|
+
request.lastName = 'Anderson';
|
|
71
|
+
const httpResponse = yield client.inviteMerchantUser(request);
|
|
72
|
+
const response = httpResponse.data;
|
|
73
|
+
// response assertions
|
|
74
|
+
expect(response.success).toBe(true);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.log('Error:', error);
|
|
78
|
+
fail(error);
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
done();
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}, testDelayInt * 1000);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is governed
|
|
3
|
+
* by a license that can be found in the LICENSE file.
|
|
4
|
+
*
|
|
5
|
+
* This file was generated automatically by the BlockChyp SDK Generator. Changes to this
|
|
6
|
+
* file will be lost every time the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import { Config } from './support/config';
|
|
11
|
+
import * as BlockChyp from '../index';
|
|
12
|
+
|
|
13
|
+
describe('InviteMerchantUser', function () {
|
|
14
|
+
let originalTimeout: number;
|
|
15
|
+
let client: typeof BlockChyp.BlockChypClient;
|
|
16
|
+
Config.load();
|
|
17
|
+
|
|
18
|
+
beforeEach(function () {
|
|
19
|
+
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
|
20
|
+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('invites a user to join a merchant account.', function (done) {
|
|
24
|
+
client = BlockChyp.newClient(Config.getCreds(""));
|
|
25
|
+
client.setGatewayHost(Config.getGatewayHost());
|
|
26
|
+
client.setTestGatewayHost(Config.getTestGatewayHost());
|
|
27
|
+
client.setDashboardHost(Config.getDashboardHost());
|
|
28
|
+
|
|
29
|
+
const testDelay = process.env.BC_TEST_DELAY;
|
|
30
|
+
let testDelayInt = 0;
|
|
31
|
+
if (testDelay) {
|
|
32
|
+
testDelayInt = parseInt(testDelay);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
console.log('Running inviteMerchantUser...');
|
|
36
|
+
|
|
37
|
+
setTimeout(async function () {
|
|
38
|
+
try {
|
|
39
|
+
// setup request object
|
|
40
|
+
const request = new BlockChyp.InviteMerchantUserRequest();
|
|
41
|
+
request.email = 'doublea@blockchypteam.m8r.co';
|
|
42
|
+
request.firstName = 'Aaron';
|
|
43
|
+
request.lastName = 'Anderson';
|
|
44
|
+
|
|
45
|
+
const httpResponse = await client.inviteMerchantUser(request)
|
|
46
|
+
const response: BlockChyp.Acknowledgement = httpResponse.data;
|
|
47
|
+
// response assertions
|
|
48
|
+
expect(response.success).toBe(true);
|
|
49
|
+
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.log('Error:', error);
|
|
52
|
+
fail(error);
|
|
53
|
+
} finally {
|
|
54
|
+
done();
|
|
55
|
+
}
|
|
56
|
+
}, testDelayInt * 1000);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is governed
|
|
4
|
+
* by a license that can be found in the LICENSE file.
|
|
5
|
+
*
|
|
6
|
+
* This file was generated automatically by the BlockChyp SDK Generator. Changes to this
|
|
7
|
+
* file will be lost every time the code is regenerated.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
36
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
37
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
38
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
const config_1 = require("./support/config");
|
|
43
|
+
const BlockChyp = __importStar(require("../index"));
|
|
44
|
+
describe('LinkToken', function () {
|
|
45
|
+
let originalTimeout;
|
|
46
|
+
let client;
|
|
47
|
+
config_1.Config.load();
|
|
48
|
+
beforeEach(function () {
|
|
49
|
+
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
|
50
|
+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
|
51
|
+
});
|
|
52
|
+
it('can link a token with a customer record', function (done) {
|
|
53
|
+
client = BlockChyp.newClient(config_1.Config.getCreds(""));
|
|
54
|
+
client.setGatewayHost(config_1.Config.getGatewayHost());
|
|
55
|
+
client.setTestGatewayHost(config_1.Config.getTestGatewayHost());
|
|
56
|
+
client.setDashboardHost(config_1.Config.getDashboardHost());
|
|
57
|
+
const testDelay = process.env.BC_TEST_DELAY;
|
|
58
|
+
let testDelayInt = 0;
|
|
59
|
+
if (testDelay) {
|
|
60
|
+
testDelayInt = parseInt(testDelay);
|
|
61
|
+
}
|
|
62
|
+
console.log('Running linkToken...');
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
var _a, _b, _c;
|
|
66
|
+
try {
|
|
67
|
+
// setup request object
|
|
68
|
+
const setupRequest = new BlockChyp.EnrollRequest();
|
|
69
|
+
setupRequest.pan = '4111111111111111';
|
|
70
|
+
setupRequest.test = true;
|
|
71
|
+
const customer = new BlockChyp.Customer();
|
|
72
|
+
customer.customerRef = 'TESTCUSTOMER';
|
|
73
|
+
customer.firstName = 'Test';
|
|
74
|
+
customer.lastName = 'Customer';
|
|
75
|
+
setupRequest.customer = customer;
|
|
76
|
+
let setupResponse = new BlockChyp.EnrollResponse();
|
|
77
|
+
const setupHttpResponse = yield client.enroll(setupRequest);
|
|
78
|
+
if (setupHttpResponse.status !== 200) {
|
|
79
|
+
console.log('Error:', setupHttpResponse.statusText);
|
|
80
|
+
fail(setupHttpResponse.statusText);
|
|
81
|
+
done();
|
|
82
|
+
}
|
|
83
|
+
setupResponse = setupHttpResponse.data;
|
|
84
|
+
// setup request object
|
|
85
|
+
const request = new BlockChyp.LinkTokenRequest();
|
|
86
|
+
request.token = (_a = setupResponse.token) !== null && _a !== void 0 ? _a : null;
|
|
87
|
+
request.customerId = (_c = (_b = setupResponse.customer) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : null;
|
|
88
|
+
const httpResponse = yield client.linkToken(request);
|
|
89
|
+
const response = httpResponse.data;
|
|
90
|
+
// response assertions
|
|
91
|
+
expect(response.success).toBe(true);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.log('Error:', error);
|
|
95
|
+
fail(error);
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
done();
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}, testDelayInt * 1000);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is governed
|
|
3
|
+
* by a license that can be found in the LICENSE file.
|
|
4
|
+
*
|
|
5
|
+
* This file was generated automatically by the BlockChyp SDK Generator. Changes to this
|
|
6
|
+
* file will be lost every time the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import { Config } from './support/config';
|
|
11
|
+
import * as BlockChyp from '../index';
|
|
12
|
+
|
|
13
|
+
describe('LinkToken', function () {
|
|
14
|
+
let originalTimeout: number;
|
|
15
|
+
let client: typeof BlockChyp.BlockChypClient;
|
|
16
|
+
Config.load();
|
|
17
|
+
|
|
18
|
+
beforeEach(function () {
|
|
19
|
+
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
|
20
|
+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('can link a token with a customer record', function (done) {
|
|
24
|
+
client = BlockChyp.newClient(Config.getCreds(""));
|
|
25
|
+
client.setGatewayHost(Config.getGatewayHost());
|
|
26
|
+
client.setTestGatewayHost(Config.getTestGatewayHost());
|
|
27
|
+
client.setDashboardHost(Config.getDashboardHost());
|
|
28
|
+
|
|
29
|
+
const testDelay = process.env.BC_TEST_DELAY;
|
|
30
|
+
let testDelayInt = 0;
|
|
31
|
+
if (testDelay) {
|
|
32
|
+
testDelayInt = parseInt(testDelay);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
console.log('Running linkToken...');
|
|
36
|
+
|
|
37
|
+
setTimeout(async function () {
|
|
38
|
+
try {
|
|
39
|
+
// setup request object
|
|
40
|
+
const setupRequest = new BlockChyp.EnrollRequest();
|
|
41
|
+
setupRequest.pan = '4111111111111111';
|
|
42
|
+
setupRequest.test = true;
|
|
43
|
+
|
|
44
|
+
const customer = new BlockChyp.Customer();
|
|
45
|
+
customer.customerRef = 'TESTCUSTOMER';
|
|
46
|
+
customer.firstName = 'Test';
|
|
47
|
+
customer.lastName = 'Customer';
|
|
48
|
+
setupRequest.customer = customer;
|
|
49
|
+
let setupResponse: BlockChyp.EnrollResponse = new BlockChyp.EnrollResponse();
|
|
50
|
+
const setupHttpResponse = await client.enroll(setupRequest);
|
|
51
|
+
if (setupHttpResponse.status !== 200) {
|
|
52
|
+
console.log('Error:', setupHttpResponse.statusText);
|
|
53
|
+
fail(setupHttpResponse.statusText);
|
|
54
|
+
done();
|
|
55
|
+
}
|
|
56
|
+
setupResponse = setupHttpResponse.data
|
|
57
|
+
|
|
58
|
+
// setup request object
|
|
59
|
+
const request = new BlockChyp.LinkTokenRequest();
|
|
60
|
+
request.token = setupResponse.token ?? null;
|
|
61
|
+
request.customerId = setupResponse.customer?.id ?? null;
|
|
62
|
+
|
|
63
|
+
const httpResponse = await client.linkToken(request)
|
|
64
|
+
const response: BlockChyp.Acknowledgement = httpResponse.data;
|
|
65
|
+
// response assertions
|
|
66
|
+
expect(response.success).toBe(true);
|
|
67
|
+
|
|
68
|
+
} catch (error) {
|
|
69
|
+
console.log('Error:', error);
|
|
70
|
+
fail(error);
|
|
71
|
+
} finally {
|
|
72
|
+
done();
|
|
73
|
+
}
|
|
74
|
+
}, testDelayInt * 1000);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is governed
|
|
4
|
+
* by a license that can be found in the LICENSE file.
|
|
5
|
+
*
|
|
6
|
+
* This file was generated automatically by the BlockChyp SDK Generator. Changes to this
|
|
7
|
+
* file will be lost every time the code is regenerated.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
36
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
37
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
38
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
const uuid_1 = require("uuid");
|
|
43
|
+
const config_1 = require("./support/config");
|
|
44
|
+
const BlockChyp = __importStar(require("../index"));
|
|
45
|
+
describe('ListQueuedTransactions', function () {
|
|
46
|
+
let originalTimeout;
|
|
47
|
+
let client;
|
|
48
|
+
config_1.Config.load();
|
|
49
|
+
beforeEach(function () {
|
|
50
|
+
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
|
51
|
+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
|
52
|
+
});
|
|
53
|
+
it('lists queued transactions on terminal.', function (done) {
|
|
54
|
+
client = BlockChyp.newClient(config_1.Config.getCreds(""));
|
|
55
|
+
client.setGatewayHost(config_1.Config.getGatewayHost());
|
|
56
|
+
client.setTestGatewayHost(config_1.Config.getTestGatewayHost());
|
|
57
|
+
client.setDashboardHost(config_1.Config.getDashboardHost());
|
|
58
|
+
const testDelay = process.env.BC_TEST_DELAY;
|
|
59
|
+
let testDelayInt = 0;
|
|
60
|
+
if (testDelay) {
|
|
61
|
+
testDelayInt = parseInt(testDelay);
|
|
62
|
+
}
|
|
63
|
+
if (testDelayInt > 0) {
|
|
64
|
+
const messageRequest = new BlockChyp.MessageRequest();
|
|
65
|
+
messageRequest.test = true;
|
|
66
|
+
messageRequest.terminalName = config_1.Config.getTerminalName();
|
|
67
|
+
messageRequest.message = 'Running ListQueuedTransactions in ' + testDelay + ' seconds...';
|
|
68
|
+
client.message(messageRequest)
|
|
69
|
+
.then(function (httpResponse) {
|
|
70
|
+
const response = httpResponse.data;
|
|
71
|
+
expect(response.success).toBe(true);
|
|
72
|
+
})
|
|
73
|
+
.catch(function (error) {
|
|
74
|
+
console.log('Error:', error);
|
|
75
|
+
done();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
console.log('Running listQueuedTransactions...');
|
|
79
|
+
setTimeout(function () {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
try {
|
|
82
|
+
// setup request object
|
|
83
|
+
const setupRequest = new BlockChyp.AuthorizationRequest();
|
|
84
|
+
setupRequest.terminalName = config_1.Config.getTerminalName();
|
|
85
|
+
setupRequest.transactionRef = (0, uuid_1.v4)();
|
|
86
|
+
setupRequest.description = '1060 West Addison';
|
|
87
|
+
setupRequest.amount = '25.15';
|
|
88
|
+
setupRequest.test = true;
|
|
89
|
+
setupRequest.queue = true;
|
|
90
|
+
let setupResponse = new BlockChyp.AuthorizationResponse();
|
|
91
|
+
const setupHttpResponse = yield client.charge(setupRequest);
|
|
92
|
+
if (setupHttpResponse.status !== 200) {
|
|
93
|
+
console.log('Error:', setupHttpResponse.statusText);
|
|
94
|
+
fail(setupHttpResponse.statusText);
|
|
95
|
+
done();
|
|
96
|
+
}
|
|
97
|
+
setupResponse = setupHttpResponse.data;
|
|
98
|
+
// setup request object
|
|
99
|
+
const request = new BlockChyp.ListQueuedTransactionsRequest();
|
|
100
|
+
request.terminalName = config_1.Config.getTerminalName();
|
|
101
|
+
const httpResponse = yield client.listQueuedTransactions(request);
|
|
102
|
+
const response = httpResponse.data;
|
|
103
|
+
// response assertions
|
|
104
|
+
expect(response.success).toBe(true);
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
console.log('Error:', error);
|
|
108
|
+
fail(error);
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
done();
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}, testDelayInt * 1000);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is governed
|
|
3
|
+
* by a license that can be found in the LICENSE file.
|
|
4
|
+
*
|
|
5
|
+
* This file was generated automatically by the BlockChyp SDK Generator. Changes to this
|
|
6
|
+
* file will be lost every time the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import { Config } from './support/config';
|
|
11
|
+
import * as BlockChyp from '../index';
|
|
12
|
+
|
|
13
|
+
describe('ListQueuedTransactions', function () {
|
|
14
|
+
let originalTimeout: number;
|
|
15
|
+
let client: typeof BlockChyp.BlockChypClient;
|
|
16
|
+
Config.load();
|
|
17
|
+
|
|
18
|
+
beforeEach(function () {
|
|
19
|
+
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
|
20
|
+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('lists queued transactions on terminal.', function (done) {
|
|
24
|
+
client = BlockChyp.newClient(Config.getCreds(""));
|
|
25
|
+
client.setGatewayHost(Config.getGatewayHost());
|
|
26
|
+
client.setTestGatewayHost(Config.getTestGatewayHost());
|
|
27
|
+
client.setDashboardHost(Config.getDashboardHost());
|
|
28
|
+
|
|
29
|
+
const testDelay = process.env.BC_TEST_DELAY;
|
|
30
|
+
let testDelayInt = 0;
|
|
31
|
+
if (testDelay) {
|
|
32
|
+
testDelayInt = parseInt(testDelay);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (testDelayInt > 0) {
|
|
36
|
+
const messageRequest = new BlockChyp.MessageRequest();
|
|
37
|
+
messageRequest.test = true;
|
|
38
|
+
messageRequest.terminalName = Config.getTerminalName();
|
|
39
|
+
messageRequest.message = 'Running ListQueuedTransactions in ' + testDelay + ' seconds...';
|
|
40
|
+
client.message(messageRequest)
|
|
41
|
+
.then(function (httpResponse) {
|
|
42
|
+
const response = httpResponse.data;
|
|
43
|
+
expect(response.success).toBe(true);
|
|
44
|
+
})
|
|
45
|
+
.catch(function (error: any) {
|
|
46
|
+
console.log('Error:', error);
|
|
47
|
+
done();
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
console.log('Running listQueuedTransactions...');
|
|
51
|
+
|
|
52
|
+
setTimeout(async function () {
|
|
53
|
+
try {
|
|
54
|
+
// setup request object
|
|
55
|
+
const setupRequest = new BlockChyp.AuthorizationRequest();
|
|
56
|
+
setupRequest.terminalName = Config.getTerminalName();
|
|
57
|
+
setupRequest.transactionRef = uuidv4();
|
|
58
|
+
setupRequest.description = '1060 West Addison';
|
|
59
|
+
setupRequest.amount = '25.15';
|
|
60
|
+
setupRequest.test = true;
|
|
61
|
+
setupRequest.queue = true;
|
|
62
|
+
let setupResponse: BlockChyp.AuthorizationResponse = new BlockChyp.AuthorizationResponse();
|
|
63
|
+
const setupHttpResponse = await client.charge(setupRequest);
|
|
64
|
+
if (setupHttpResponse.status !== 200) {
|
|
65
|
+
console.log('Error:', setupHttpResponse.statusText);
|
|
66
|
+
fail(setupHttpResponse.statusText);
|
|
67
|
+
done();
|
|
68
|
+
}
|
|
69
|
+
setupResponse = setupHttpResponse.data
|
|
70
|
+
|
|
71
|
+
// setup request object
|
|
72
|
+
const request = new BlockChyp.ListQueuedTransactionsRequest();
|
|
73
|
+
request.terminalName = Config.getTerminalName();
|
|
74
|
+
|
|
75
|
+
const httpResponse = await client.listQueuedTransactions(request)
|
|
76
|
+
const response: BlockChyp.ListQueuedTransactionsResponse = httpResponse.data;
|
|
77
|
+
// response assertions
|
|
78
|
+
expect(response.success).toBe(true);
|
|
79
|
+
|
|
80
|
+
} catch (error) {
|
|
81
|
+
console.log('Error:', error);
|
|
82
|
+
fail(error);
|
|
83
|
+
} finally {
|
|
84
|
+
done();
|
|
85
|
+
}
|
|
86
|
+
}, testDelayInt * 1000);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is governed
|
|
4
|
+
* by a license that can be found in the LICENSE file.
|
|
5
|
+
*
|
|
6
|
+
* This file was generated automatically by the BlockChyp SDK Generator. Changes to this
|
|
7
|
+
* file will be lost every time the code is regenerated.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
36
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
37
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
38
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
const config_1 = require("./support/config");
|
|
43
|
+
const BlockChyp = __importStar(require("../index"));
|
|
44
|
+
describe('ListTerminals', function () {
|
|
45
|
+
let originalTimeout;
|
|
46
|
+
let client;
|
|
47
|
+
config_1.Config.load();
|
|
48
|
+
beforeEach(function () {
|
|
49
|
+
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
|
50
|
+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
|
51
|
+
});
|
|
52
|
+
it('lists all terminals associated with an account.', function (done) {
|
|
53
|
+
client = BlockChyp.newClient(config_1.Config.getCreds(""));
|
|
54
|
+
client.setGatewayHost(config_1.Config.getGatewayHost());
|
|
55
|
+
client.setTestGatewayHost(config_1.Config.getTestGatewayHost());
|
|
56
|
+
client.setDashboardHost(config_1.Config.getDashboardHost());
|
|
57
|
+
const testDelay = process.env.BC_TEST_DELAY;
|
|
58
|
+
let testDelayInt = 0;
|
|
59
|
+
if (testDelay) {
|
|
60
|
+
testDelayInt = parseInt(testDelay);
|
|
61
|
+
}
|
|
62
|
+
console.log('Running listTerminals...');
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
try {
|
|
66
|
+
// setup request object
|
|
67
|
+
const request = new BlockChyp.TerminalProfileRequest();
|
|
68
|
+
const httpResponse = yield client.terminals(request);
|
|
69
|
+
const response = httpResponse.data;
|
|
70
|
+
// response assertions
|
|
71
|
+
expect(response.success).toBe(true);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.log('Error:', error);
|
|
75
|
+
fail(error);
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
done();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}, testDelayInt * 1000);
|
|
82
|
+
});
|
|
83
|
+
});
|