@basis-theory/basis-theory-js 4.2.2 → 4.4.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/BasisTheory.d.ts +12 -8
- package/BasisTheory.js +22 -0
- package/applicationKeys/BasisTheoryApplicationKeys.d.ts +11 -0
- package/applicationKeys/BasisTheoryApplicationKeys.js +32 -0
- package/applicationKeys/index.d.ts +1 -0
- package/applicationKeys/index.js +13 -0
- package/applications/BasisTheoryApplications.d.ts +3 -0
- package/applications/BasisTheoryApplications.js +4 -0
- package/common/constants.js +3 -1
- package/package.json +1 -1
- package/threeds/BasisTheoryThreeDs.d.ts +8 -0
- package/threeds/BasisTheoryThreeDs.js +27 -0
- package/threeds/index.d.ts +1 -0
- package/threeds/index.js +18 -0
- package/types/models/applications.d.ts +14 -2
- package/types/models/threeds.d.ts +188 -0
- package/types/models/threeds.js +1 -0
- package/types/sdk/sdk.d.ts +4 -1
- package/types/sdk/services/applicationKeys.d.ts +8 -0
- package/types/sdk/services/applicationKeys.js +1 -0
- package/types/sdk/services/index.d.ts +2 -0
- package/types/sdk/services/index.js +26 -0
- package/types/sdk/services/threeds.d.ts +7 -0
- package/types/sdk/services/threeds.js +1 -0
package/BasisTheory.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import type { BasisTheoryElements, CardElement, CardExpirationDateElement, CardNumberElement, CardVerificationCodeElement, CreateCardElementOptions, CreateCardExpirationDateElementOptions, CreateCardNumberElementOptions, CreateCardVerificationCodeElementOptions, CreateTextElementOptions, TextElement, TokenizeData as ElementsTokenizeData, Tokens as ElementsTokens } from './types/elements';
|
|
2
2
|
import type { TokenizeData } from './types/models';
|
|
3
|
-
import type { Applications, ApplicationTemplates, BasisTheory as IBasisTheory, BasisTheoryInit, BasisTheoryInitOptions, BasisTheoryInitOptionsWithElements, BasisTheoryInitOptionsWithoutElements, HttpClient, Logs, Permissions, Proxies, Proxy, ReactorFormulas, Reactors, RequestOptions, Sessions, Tenants, Tokens } from './types/sdk';
|
|
3
|
+
import type { ApplicationKeys, Applications, ApplicationTemplates, BasisTheory as IBasisTheory, BasisTheoryInit, BasisTheoryInitOptions, BasisTheoryInitOptionsWithElements, BasisTheoryInitOptionsWithoutElements, HttpClient, Logs, Permissions, Proxies, Proxy, ReactorFormulas, Reactors, RequestOptions, Sessions, Tenants, ThreeDS, Tokens } from './types/sdk';
|
|
4
4
|
export declare class BasisTheory implements BasisTheoryInit, IBasisTheory, BasisTheoryElements {
|
|
5
5
|
private _initStatus;
|
|
6
|
-
private
|
|
7
|
-
private _tokens?;
|
|
8
|
-
private _tokenize?;
|
|
9
|
-
private _elements?;
|
|
6
|
+
private _applicationKeys?;
|
|
10
7
|
private _applications?;
|
|
11
8
|
private _applicationTemplates?;
|
|
12
|
-
private
|
|
9
|
+
private _elements?;
|
|
10
|
+
private _initOptions?;
|
|
13
11
|
private _logs?;
|
|
14
|
-
private _reactorFormulas?;
|
|
15
|
-
private _reactors?;
|
|
16
12
|
private _permissions?;
|
|
17
13
|
private _proxies?;
|
|
18
14
|
private _proxy?;
|
|
15
|
+
private _reactorFormulas?;
|
|
16
|
+
private _reactors?;
|
|
19
17
|
private _sessions?;
|
|
18
|
+
private _tenants?;
|
|
19
|
+
private _threeds?;
|
|
20
|
+
private _tokenize?;
|
|
21
|
+
private _tokens?;
|
|
20
22
|
init(apiKey: string | undefined, options?: BasisTheoryInitOptionsWithoutElements): Promise<IBasisTheory>;
|
|
21
23
|
init(apiKey: string | undefined, options: BasisTheoryInitOptionsWithElements): Promise<IBasisTheory & BasisTheoryElements>;
|
|
22
24
|
createElement(type: 'card', options?: CreateCardElementOptions): CardElement;
|
|
@@ -29,6 +31,7 @@ export declare class BasisTheory implements BasisTheoryInit, IBasisTheory, Basis
|
|
|
29
31
|
get initOptions(): Required<BasisTheoryInitOptions>;
|
|
30
32
|
get tokens(): Tokens & ElementsTokens;
|
|
31
33
|
get applications(): Applications;
|
|
34
|
+
get applicationKeys(): ApplicationKeys;
|
|
32
35
|
get applicationTemplates(): ApplicationTemplates;
|
|
33
36
|
get client(): HttpClient | undefined;
|
|
34
37
|
get tenants(): Tenants;
|
|
@@ -43,6 +46,7 @@ export declare class BasisTheory implements BasisTheoryInit, IBasisTheory, Basis
|
|
|
43
46
|
get proxies(): Proxies;
|
|
44
47
|
get proxy(): Proxy;
|
|
45
48
|
get sessions(): Sessions;
|
|
49
|
+
get threeds(): ThreeDS;
|
|
46
50
|
/**
|
|
47
51
|
* @deprecated
|
|
48
52
|
*/
|
package/BasisTheory.js
CHANGED
|
@@ -7,6 +7,8 @@ exports.BasisTheory = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _applicationTemplates = require("./application-templates");
|
|
9
9
|
|
|
10
|
+
var _applicationKeys = require("./applicationKeys");
|
|
11
|
+
|
|
10
12
|
var _applications = require("./applications");
|
|
11
13
|
|
|
12
14
|
var _common = require("./common");
|
|
@@ -29,6 +31,8 @@ var _sessions = require("./sessions");
|
|
|
29
31
|
|
|
30
32
|
var _tenants = require("./tenants");
|
|
31
33
|
|
|
34
|
+
var _threeds = require("./threeds");
|
|
35
|
+
|
|
32
36
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
37
|
|
|
34
38
|
const defaultInitOptions = {
|
|
@@ -90,6 +94,11 @@ class BasisTheory {
|
|
|
90
94
|
baseURL: new URL(_common.CLIENT_BASE_PATHS.applications, baseUrl).toString(),
|
|
91
95
|
appInfo
|
|
92
96
|
});
|
|
97
|
+
this._applicationKeys = new _applicationKeys.BasisTheoryApplicationKeys({
|
|
98
|
+
apiKey,
|
|
99
|
+
baseURL: new URL(_common.CLIENT_BASE_PATHS.applicationKeys, baseUrl).toString(),
|
|
100
|
+
appInfo
|
|
101
|
+
});
|
|
93
102
|
this._applicationTemplates = new _applicationTemplates.BasisTheoryApplicationTemplates({
|
|
94
103
|
apiKey,
|
|
95
104
|
baseURL: new URL(_common.CLIENT_BASE_PATHS.applicationTemplates, baseUrl).toString(),
|
|
@@ -135,6 +144,11 @@ class BasisTheory {
|
|
|
135
144
|
baseURL: new URL(_common.CLIENT_BASE_PATHS.sessions, baseUrl).toString(),
|
|
136
145
|
appInfo
|
|
137
146
|
});
|
|
147
|
+
this._threeds = new _threeds.BasisTheoryThreeDS({
|
|
148
|
+
apiKey,
|
|
149
|
+
baseURL: new URL(_common.CLIENT_BASE_PATHS.threeds, baseUrl).toString(),
|
|
150
|
+
appInfo
|
|
151
|
+
});
|
|
138
152
|
this._initStatus = 'done';
|
|
139
153
|
} catch (error) {
|
|
140
154
|
this._initStatus = 'error';
|
|
@@ -186,6 +200,10 @@ class BasisTheory {
|
|
|
186
200
|
return (0, _common.assertInit)(this._applications);
|
|
187
201
|
}
|
|
188
202
|
|
|
203
|
+
get applicationKeys() {
|
|
204
|
+
return (0, _common.assertInit)(this._applicationKeys);
|
|
205
|
+
}
|
|
206
|
+
|
|
189
207
|
get applicationTemplates() {
|
|
190
208
|
return (0, _common.assertInit)(this._applicationTemplates);
|
|
191
209
|
}
|
|
@@ -238,6 +256,10 @@ class BasisTheory {
|
|
|
238
256
|
get sessions() {
|
|
239
257
|
return (0, _common.assertInit)(this._sessions);
|
|
240
258
|
}
|
|
259
|
+
|
|
260
|
+
get threeds() {
|
|
261
|
+
return (0, _common.assertInit)(this._threeds);
|
|
262
|
+
}
|
|
241
263
|
/* eslint-enable accessor-pairs */
|
|
242
264
|
|
|
243
265
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ApplicationKey } from '../types/models';
|
|
2
|
+
export declare const BasisTheoryApplicationKeys: {
|
|
3
|
+
new (options: import("../service/types").BasisTheoryServiceOptions): {
|
|
4
|
+
create(applicationId: string): Promise<ApplicationKey>;
|
|
5
|
+
get(applicationId: string): Promise<ApplicationKey[]>;
|
|
6
|
+
getById(applicationId: string, keyId: string): Promise<ApplicationKey>;
|
|
7
|
+
delete(applicationId: string, keyId: string): Promise<void>;
|
|
8
|
+
readonly client: import("axios").AxiosInstance;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type BasisTheoryApplicationKeys = InstanceType<typeof BasisTheoryApplicationKeys>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BasisTheoryApplicationKeys = void 0;
|
|
7
|
+
|
|
8
|
+
var _common = require("./../common");
|
|
9
|
+
|
|
10
|
+
var _service = require("./../service");
|
|
11
|
+
|
|
12
|
+
var _CrudBuilder = require("./../service/CrudBuilder");
|
|
13
|
+
|
|
14
|
+
const BasisTheoryApplicationKeys = new _CrudBuilder.CrudBuilder(class BasisTheoryApplicationKeys extends _service.BasisTheoryService {
|
|
15
|
+
create(applicationId) {
|
|
16
|
+
return this.client.post(`${applicationId}/keys`).then(_common.dataExtractor);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
get(applicationId) {
|
|
20
|
+
return this.client.get(`${applicationId}/keys`).then(_common.dataExtractor);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getById(applicationId, keyId) {
|
|
24
|
+
return this.client.get(`${applicationId}/keys/${keyId}`).then(_common.dataExtractor);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
delete(applicationId, keyId) {
|
|
28
|
+
return this.client.delete(`${applicationId}/keys/${keyId}`).then(_common.dataExtractor);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}).build();
|
|
32
|
+
exports.BasisTheoryApplicationKeys = BasisTheoryApplicationKeys;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BasisTheoryApplicationKeys } from './BasisTheoryApplicationKeys';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BasisTheoryApplicationKeys", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _BasisTheoryApplicationKeys.BasisTheoryApplicationKeys;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _BasisTheoryApplicationKeys = require("./BasisTheoryApplicationKeys");
|
|
@@ -7,6 +7,9 @@ export declare const BasisTheoryApplications: {
|
|
|
7
7
|
*/
|
|
8
8
|
getApplicationByKey(): Promise<Application>;
|
|
9
9
|
retrieveByKey(options?: RequestOptions): Promise<Application>;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated This method is deprecated. Use Terraform or https://portal.basistheory.com to manage keys instead.
|
|
12
|
+
*/
|
|
10
13
|
regenerateKey(id: string, options?: RequestOptions): Promise<Application>;
|
|
11
14
|
readonly client: import("axios").AxiosInstance;
|
|
12
15
|
};
|
|
@@ -22,6 +22,10 @@ const BasisTheoryApplications = new _CrudBuilder.CrudBuilder(class BasisTheoryAp
|
|
|
22
22
|
retrieveByKey(options) {
|
|
23
23
|
return this.client.get('/key', (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated This method is deprecated. Use Terraform or https://portal.basistheory.com to manage keys instead.
|
|
27
|
+
*/
|
|
28
|
+
|
|
25
29
|
|
|
26
30
|
regenerateKey(id, options) {
|
|
27
31
|
return this.client.post(`${id}/regenerate`, undefined, (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
|
package/common/constants.js
CHANGED
|
@@ -30,6 +30,7 @@ const CLIENT_BASE_PATHS = {
|
|
|
30
30
|
tokens: 'tokens',
|
|
31
31
|
tokenize: 'tokenize',
|
|
32
32
|
applications: 'applications',
|
|
33
|
+
applicationKeys: 'applications',
|
|
33
34
|
applicationTemplates: 'application-templates',
|
|
34
35
|
tenants: 'tenants/self',
|
|
35
36
|
logs: 'logs',
|
|
@@ -38,7 +39,8 @@ const CLIENT_BASE_PATHS = {
|
|
|
38
39
|
permissions: 'permissions',
|
|
39
40
|
proxies: 'proxies',
|
|
40
41
|
proxy: 'proxy',
|
|
41
|
-
sessions: 'sessions'
|
|
42
|
+
sessions: 'sessions',
|
|
43
|
+
threeds: '3ds'
|
|
42
44
|
};
|
|
43
45
|
exports.CLIENT_BASE_PATHS = CLIENT_BASE_PATHS;
|
|
44
46
|
const BROWSER_LIST = [{
|
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BasisTheoryService } from '../service';
|
|
2
|
+
import { AuthenticateThreeDSSessionRequest, ThreeDSAuthentication, ThreeDSSession } from '../types/models/threeds';
|
|
3
|
+
import { ThreeDS } from '../types/sdk/services/threeds';
|
|
4
|
+
export declare class BasisTheoryThreeDS extends BasisTheoryService implements ThreeDS {
|
|
5
|
+
getSessionById(sessionId: string): Promise<ThreeDSSession>;
|
|
6
|
+
authenticateSession(sessionId: string, authenticateRequest: AuthenticateThreeDSSessionRequest): Promise<ThreeDSAuthentication>;
|
|
7
|
+
getChallengeResult(sessionId: string): Promise<ThreeDSAuthentication>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BasisTheoryThreeDS = void 0;
|
|
7
|
+
|
|
8
|
+
var _common = require("./../common");
|
|
9
|
+
|
|
10
|
+
var _service = require("./../service");
|
|
11
|
+
|
|
12
|
+
class BasisTheoryThreeDS extends _service.BasisTheoryService {
|
|
13
|
+
getSessionById(sessionId) {
|
|
14
|
+
return this.client.get(`/${sessionId}`).then(_common.dataExtractor);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
authenticateSession(sessionId, authenticateRequest) {
|
|
18
|
+
return this.client.post(`/${sessionId}/authenticate`, authenticateRequest).then(_common.dataExtractor);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
getChallengeResult(sessionId) {
|
|
22
|
+
return this.client.get(`/${sessionId}/challenge-result`).then(_common.dataExtractor);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.BasisTheoryThreeDS = BasisTheoryThreeDS;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BasisTheoryThreeDs';
|
package/threeds/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _BasisTheoryThreeDs = require("./BasisTheoryThreeDs");
|
|
8
|
+
|
|
9
|
+
Object.keys(_BasisTheoryThreeDs).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _BasisTheoryThreeDs[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _BasisTheoryThreeDs[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -7,7 +7,11 @@ interface Application extends Auditable {
|
|
|
7
7
|
id: string;
|
|
8
8
|
tenantId: string;
|
|
9
9
|
name?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated use `keys` instead.
|
|
12
|
+
*/
|
|
10
13
|
key?: string;
|
|
14
|
+
keys?: ApplicationKey[];
|
|
11
15
|
type: ApplicationType;
|
|
12
16
|
permissions?: string[];
|
|
13
17
|
rules?: AccessRule[];
|
|
@@ -26,7 +30,15 @@ type Condition = {
|
|
|
26
30
|
operator: string;
|
|
27
31
|
value: string;
|
|
28
32
|
};
|
|
29
|
-
type
|
|
33
|
+
type ApplicationKey = {
|
|
34
|
+
id?: string;
|
|
35
|
+
key?: string;
|
|
36
|
+
createdAt?: string;
|
|
37
|
+
createdBy?: string;
|
|
38
|
+
};
|
|
39
|
+
type CreateApplication = Pick<Application, 'name' | 'type' | 'permissions' | 'rules' | 'expiresAt'> & {
|
|
40
|
+
createKey?: boolean;
|
|
41
|
+
};
|
|
30
42
|
type UpdateApplication = Pick<Application, 'name' | 'permissions' | 'rules'>;
|
|
31
|
-
export type {
|
|
43
|
+
export type { Application, ApplicationKey, ApplicationType, CreateApplication, TransformType, UpdateApplication, };
|
|
32
44
|
export { APPLICATION_TYPES, TRANSFORM_TYPES, AccessRule };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
interface AuthenticateThreeDSSessionRequest {
|
|
2
|
+
authenticationCategory: string;
|
|
3
|
+
authenticationType: string;
|
|
4
|
+
challengePreference?: string;
|
|
5
|
+
purchaseInfo?: ThreeDSPurchaseInfo;
|
|
6
|
+
merchantInfo?: ThreeDSMerchantInfo;
|
|
7
|
+
requestorInfo?: ThreeDSRequestorInfo;
|
|
8
|
+
cardholderInfo?: ThreeDSCardholderInfo;
|
|
9
|
+
broadcastInfo?: unknown;
|
|
10
|
+
messageExtensions?: ThreeDSMessageExtension[];
|
|
11
|
+
}
|
|
12
|
+
interface ThreeDSPurchaseInfo {
|
|
13
|
+
amount: string;
|
|
14
|
+
currency: string;
|
|
15
|
+
exponent: string;
|
|
16
|
+
date: string;
|
|
17
|
+
transactionType?: string;
|
|
18
|
+
installmentCount?: string;
|
|
19
|
+
recurringExpiration?: string;
|
|
20
|
+
recurringFrequency?: string;
|
|
21
|
+
}
|
|
22
|
+
interface ThreeDSMerchantInfo {
|
|
23
|
+
mid: string;
|
|
24
|
+
acquirerBin: string;
|
|
25
|
+
name: string;
|
|
26
|
+
countryCode: string;
|
|
27
|
+
categoryCode: string;
|
|
28
|
+
riskInfo?: ThreeDSMerchantRiskInfo;
|
|
29
|
+
}
|
|
30
|
+
interface ThreeDSMerchantRiskInfo {
|
|
31
|
+
deliveryEmail?: string;
|
|
32
|
+
deliveryTimeframe?: string;
|
|
33
|
+
giftCardAmount?: string;
|
|
34
|
+
giftCardCount?: string;
|
|
35
|
+
giftCardCurrency?: string;
|
|
36
|
+
preOrderPurchase?: boolean;
|
|
37
|
+
preOrderDate?: string;
|
|
38
|
+
reorderedPurchase?: boolean;
|
|
39
|
+
shippingMethod?: string;
|
|
40
|
+
}
|
|
41
|
+
interface ThreeDSRequestorInfo {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
url: string;
|
|
45
|
+
}
|
|
46
|
+
interface ThreeDSCardholderInfo {
|
|
47
|
+
accountId?: string;
|
|
48
|
+
accountType?: string;
|
|
49
|
+
accountInfo?: ThreeDSCardholderAccountInfo;
|
|
50
|
+
authenticationInfo?: ThreeDSCardholderAuthenticationInfo;
|
|
51
|
+
priorAuthenticationInfo?: ThreeDSPriorAuthenticationInfo;
|
|
52
|
+
name: string;
|
|
53
|
+
email: string;
|
|
54
|
+
phoneNumber?: ThreeDSCardholderPhoneNumber;
|
|
55
|
+
mobilePhoneNumber?: ThreeDSCardholderPhoneNumber;
|
|
56
|
+
workPhoneNumber?: ThreeDSCardholderPhoneNumber;
|
|
57
|
+
billingShippingAddressMatch?: string;
|
|
58
|
+
billingAddress?: ThreeDSAddress;
|
|
59
|
+
shippingAddress?: ThreeDSAddress;
|
|
60
|
+
}
|
|
61
|
+
interface ThreeDSCardholderAccountInfo {
|
|
62
|
+
accountAge?: string;
|
|
63
|
+
accountLastChanged?: string;
|
|
64
|
+
accountChangeDate?: string;
|
|
65
|
+
accountCreatedDate?: string;
|
|
66
|
+
accountPasswordLastChanged?: string;
|
|
67
|
+
accountPasswordChangeDate?: string;
|
|
68
|
+
purchaseCountLastYear?: string;
|
|
69
|
+
transactionCountDay?: string;
|
|
70
|
+
paymentAccountAge?: string;
|
|
71
|
+
transactionCountYear?: string;
|
|
72
|
+
paymentAccountCreated?: string;
|
|
73
|
+
shippingAddressFirstUsed?: string;
|
|
74
|
+
shippingAddressUsageDate?: string;
|
|
75
|
+
shippingAccountNameMatch?: boolean;
|
|
76
|
+
suspiciousActivityObserved?: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface ThreeDSCardholderAuthenticationInfo {
|
|
79
|
+
method?: string;
|
|
80
|
+
timestamp?: string;
|
|
81
|
+
data?: string;
|
|
82
|
+
}
|
|
83
|
+
interface ThreeDSPriorAuthenticationInfo {
|
|
84
|
+
method?: string;
|
|
85
|
+
timestamp?: string;
|
|
86
|
+
referenceId?: string;
|
|
87
|
+
data?: string;
|
|
88
|
+
}
|
|
89
|
+
interface ThreeDSCardholderPhoneNumber {
|
|
90
|
+
countryCode: string;
|
|
91
|
+
number: string;
|
|
92
|
+
}
|
|
93
|
+
interface ThreeDSAddress {
|
|
94
|
+
line1: string;
|
|
95
|
+
line2?: string;
|
|
96
|
+
line3?: string;
|
|
97
|
+
postalCode: string;
|
|
98
|
+
city: string;
|
|
99
|
+
stateCode: string;
|
|
100
|
+
countryCode: string;
|
|
101
|
+
}
|
|
102
|
+
interface ThreeDSMessageExtension {
|
|
103
|
+
id: string;
|
|
104
|
+
name: string;
|
|
105
|
+
critical: boolean | null;
|
|
106
|
+
data: any;
|
|
107
|
+
}
|
|
108
|
+
interface ThreeDSSession {
|
|
109
|
+
id: string;
|
|
110
|
+
tenantId: string;
|
|
111
|
+
panTokenId: string;
|
|
112
|
+
cardBrand: string;
|
|
113
|
+
expirationDate: string;
|
|
114
|
+
createdDate: string;
|
|
115
|
+
createdBy: string;
|
|
116
|
+
modifiedDate: string;
|
|
117
|
+
modifiedBy: string;
|
|
118
|
+
device: string;
|
|
119
|
+
deviceInfo: ThreeDSDeviceInfo;
|
|
120
|
+
version: ThreeDSVersion;
|
|
121
|
+
method: ThreeDSMethod;
|
|
122
|
+
authentication: ThreeDSAuthentication;
|
|
123
|
+
}
|
|
124
|
+
interface ThreeDSDeviceInfo {
|
|
125
|
+
browserAcceptHeader: string;
|
|
126
|
+
browserIpAddress: string;
|
|
127
|
+
browserJavascriptEnabled: boolean | null;
|
|
128
|
+
browserJavaEnabled: boolean | null;
|
|
129
|
+
browserLanguage: string;
|
|
130
|
+
browserColorDepth: string;
|
|
131
|
+
browserScreenHeight: string;
|
|
132
|
+
browserScreenWidth: string;
|
|
133
|
+
browserTimezone: string;
|
|
134
|
+
browserUserAgent: string;
|
|
135
|
+
sdkTransactionId: string;
|
|
136
|
+
sdkApplicationId: string;
|
|
137
|
+
sdkEncryptionData: string;
|
|
138
|
+
sdkEphemeralPublicKey: string;
|
|
139
|
+
sdkMaxTimeout: string;
|
|
140
|
+
sdkReferenceNumber: string;
|
|
141
|
+
sdkRenderOptions: ThreeDSMobileSdkRenderOptions;
|
|
142
|
+
}
|
|
143
|
+
interface ThreeDSMobileSdkRenderOptions {
|
|
144
|
+
sdkInterface: string;
|
|
145
|
+
sdkUiType: string;
|
|
146
|
+
}
|
|
147
|
+
interface ThreeDSVersion {
|
|
148
|
+
recommendedVersion: string;
|
|
149
|
+
availableVersions: string[];
|
|
150
|
+
earliestAcsSupportedVersion: string;
|
|
151
|
+
earliestDsSupportedVersion: string;
|
|
152
|
+
latestAcsSupportedVersion: string;
|
|
153
|
+
latestDsSupportedVersion: string;
|
|
154
|
+
acsInformation: string[];
|
|
155
|
+
}
|
|
156
|
+
interface ThreeDSMethod {
|
|
157
|
+
methodUrl: string;
|
|
158
|
+
methodCompletionIndicator: string;
|
|
159
|
+
}
|
|
160
|
+
interface ThreeDSAuthentication {
|
|
161
|
+
threedsVersion: string;
|
|
162
|
+
acsTransactionId: string | null;
|
|
163
|
+
dsTransactionId: string | null;
|
|
164
|
+
sdkTransactionId: string | null;
|
|
165
|
+
acsReferenceNumber: string;
|
|
166
|
+
dsReferenceNumber: string;
|
|
167
|
+
authenticationValue: string;
|
|
168
|
+
authenticationStatus: string;
|
|
169
|
+
authenticationStatusReason: string;
|
|
170
|
+
eci: string;
|
|
171
|
+
acsChallengeMandated: string;
|
|
172
|
+
acsDecoupledAuthentication: string;
|
|
173
|
+
authenticationChallengeType: string;
|
|
174
|
+
acsRenderingType: ThreeDSAcsRenderingType;
|
|
175
|
+
acsSignedContent: string;
|
|
176
|
+
acsChallengeUrl: string;
|
|
177
|
+
challengeAttempts: string;
|
|
178
|
+
challengeCancelReason: string;
|
|
179
|
+
cardholderInfo: string;
|
|
180
|
+
whitelistStatus: string;
|
|
181
|
+
whitelistStatusSource: string;
|
|
182
|
+
messageExtensions: ThreeDSMessageExtension[];
|
|
183
|
+
}
|
|
184
|
+
interface ThreeDSAcsRenderingType {
|
|
185
|
+
acsInterface: string;
|
|
186
|
+
acsUiTemplate: string;
|
|
187
|
+
}
|
|
188
|
+
export type { AuthenticateThreeDSSessionRequest, ThreeDSPurchaseInfo, ThreeDSMerchantInfo, ThreeDSMerchantRiskInfo, ThreeDSRequestorInfo, ThreeDSCardholderInfo, ThreeDSCardholderAccountInfo, ThreeDSCardholderAuthenticationInfo, ThreeDSPriorAuthenticationInfo, ThreeDSCardholderPhoneNumber, ThreeDSAddress, ThreeDSMessageExtension, ThreeDSSession, ThreeDSDeviceInfo, ThreeDSMobileSdkRenderOptions, ThreeDSVersion, ThreeDSMethod, ThreeDSAuthentication, ThreeDSAcsRenderingType, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/types/sdk/sdk.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BasisTheoryElements } from '../../types/elements';
|
|
2
|
-
import type { Applications, ApplicationTemplates, HttpClient, Logs, Permissions, Proxies, Proxy, ReactorFormulas, Reactors, Sessions, Tenants, Tokenize, Tokens } from './services';
|
|
2
|
+
import type { Applications, ApplicationTemplates, HttpClient, Logs, Permissions, Proxies, Proxy, ReactorFormulas, Reactors, Sessions, Tenants, Tokenize, Tokens, ThreeDS } from './services';
|
|
3
|
+
import { ApplicationKeys } from './services/applicationKeys';
|
|
3
4
|
interface ApplicationInfo {
|
|
4
5
|
name?: string;
|
|
5
6
|
version?: string;
|
|
@@ -24,6 +25,7 @@ interface BasisTheoryInit {
|
|
|
24
25
|
}
|
|
25
26
|
interface BasisTheory extends Tokenize {
|
|
26
27
|
applications: Applications;
|
|
28
|
+
applicationKeys: ApplicationKeys;
|
|
27
29
|
applicationTemplates: ApplicationTemplates;
|
|
28
30
|
/**
|
|
29
31
|
* @description Allows you to utilize element values in requests to a third-party API using our HTTP client service.
|
|
@@ -40,6 +42,7 @@ interface BasisTheory extends Tokenize {
|
|
|
40
42
|
sessions: Sessions;
|
|
41
43
|
tenants: Tenants;
|
|
42
44
|
tokens: Tokens;
|
|
45
|
+
threeds: ThreeDS;
|
|
43
46
|
}
|
|
44
47
|
interface ClientUserAgent {
|
|
45
48
|
client: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ApplicationKey } from '../../../types/models';
|
|
2
|
+
interface ApplicationKeys {
|
|
3
|
+
create(id: string): Promise<ApplicationKey>;
|
|
4
|
+
delete(applicationId: string, keyId: string): Promise<void>;
|
|
5
|
+
get(applicationId: string): Promise<ApplicationKey[]>;
|
|
6
|
+
getById(applicationId: string, keyId: string): Promise<ApplicationKey>;
|
|
7
|
+
}
|
|
8
|
+
export type { ApplicationKeys };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -2,6 +2,7 @@ export * from './shared';
|
|
|
2
2
|
export * from './tokens';
|
|
3
3
|
export * from './tokenize';
|
|
4
4
|
export * from './applications';
|
|
5
|
+
export * from './applicationKeys';
|
|
5
6
|
export * from './tenants';
|
|
6
7
|
export * from './logs';
|
|
7
8
|
export * from './reactor-formulas';
|
|
@@ -12,3 +13,4 @@ export * from './proxy';
|
|
|
12
13
|
export * from './sessions';
|
|
13
14
|
export * from './http';
|
|
14
15
|
export * from './application-templates';
|
|
16
|
+
export * from './threeds';
|
|
@@ -56,6 +56,19 @@ Object.keys(_applications).forEach(function (key) {
|
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
+
var _applicationKeys = require("./applicationKeys");
|
|
60
|
+
|
|
61
|
+
Object.keys(_applicationKeys).forEach(function (key) {
|
|
62
|
+
if (key === "default" || key === "__esModule") return;
|
|
63
|
+
if (key in exports && exports[key] === _applicationKeys[key]) return;
|
|
64
|
+
Object.defineProperty(exports, key, {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () {
|
|
67
|
+
return _applicationKeys[key];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
59
72
|
var _tenants = require("./tenants");
|
|
60
73
|
|
|
61
74
|
Object.keys(_tenants).forEach(function (key) {
|
|
@@ -184,4 +197,17 @@ Object.keys(_applicationTemplates).forEach(function (key) {
|
|
|
184
197
|
return _applicationTemplates[key];
|
|
185
198
|
}
|
|
186
199
|
});
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
var _threeds = require("./threeds");
|
|
203
|
+
|
|
204
|
+
Object.keys(_threeds).forEach(function (key) {
|
|
205
|
+
if (key === "default" || key === "__esModule") return;
|
|
206
|
+
if (key in exports && exports[key] === _threeds[key]) return;
|
|
207
|
+
Object.defineProperty(exports, key, {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function () {
|
|
210
|
+
return _threeds[key];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
187
213
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AuthenticateThreeDSSessionRequest, ThreeDSAuthentication, ThreeDSSession } from '../../../types/models/threeds';
|
|
2
|
+
interface ThreeDS {
|
|
3
|
+
getSessionById(sessionId: string): Promise<ThreeDSSession>;
|
|
4
|
+
authenticateSession(sessionId: string, authenticateRequest: AuthenticateThreeDSSessionRequest): Promise<ThreeDSAuthentication>;
|
|
5
|
+
getChallengeResult(sessionId: string): Promise<ThreeDSAuthentication>;
|
|
6
|
+
}
|
|
7
|
+
export type { ThreeDS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|