@basis-theory/basis-theory-js 4.9.0 → 4.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/basis-theory-js",
3
- "version": "4.9.0",
3
+ "version": "4.10.0",
4
4
  "repository": "https://github.com/Basis-Theory/basis-theory-js",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -1,7 +1,8 @@
1
1
  import { BasisTheoryService } from '../service';
2
- import { AuthenticateThreeDSSessionRequest, ThreeDSAuthentication, ThreeDSSession } from '../types/models/threeds';
2
+ import { AuthenticateThreeDSSessionRequest, CreateThreeDSSessionRequest, CreateThreeDSSessionResponse, ThreeDSAuthentication, ThreeDSSession } from '../types/models/threeds';
3
3
  import { ThreeDS } from '../types/sdk/services/threeds';
4
4
  export declare class BasisTheoryThreeDS extends BasisTheoryService implements ThreeDS {
5
+ createSession(createRequest: CreateThreeDSSessionRequest): Promise<CreateThreeDSSessionResponse>;
5
6
  getSessionById(sessionId: string): Promise<ThreeDSSession>;
6
7
  authenticateSession(sessionId: string, authenticateRequest: AuthenticateThreeDSSessionRequest): Promise<ThreeDSAuthentication>;
7
8
  getChallengeResult(sessionId: string): Promise<ThreeDSAuthentication>;
@@ -10,6 +10,10 @@ var _common = require("./../common");
10
10
  var _service = require("./../service");
11
11
 
12
12
  class BasisTheoryThreeDS extends _service.BasisTheoryService {
13
+ createSession(createRequest) {
14
+ return this.client.post('/sessions', createRequest).then(_common.dataExtractor);
15
+ }
16
+
13
17
  getSessionById(sessionId) {
14
18
  return this.client.get(`/sessions/${sessionId}`).then(_common.dataExtractor);
15
19
  }
@@ -1,3 +1,18 @@
1
+ interface CreateThreeDSSessionRequest {
2
+ pan: string;
3
+ type: 'customer' | 'merchant';
4
+ device?: string;
5
+ deviceInfo?: ThreeDSDeviceInfo;
6
+ }
7
+ interface CreateThreeDSSessionResponse {
8
+ id: string;
9
+ type: 'customer' | 'merchant';
10
+ cardBrand?: string;
11
+ methodUrl?: string;
12
+ methodNotificationUrl?: string;
13
+ directoryServerId?: string;
14
+ recommendedVersion?: string;
15
+ }
1
16
  interface AuthenticateThreeDSSessionRequest {
2
17
  authenticationCategory: string;
3
18
  authenticationType: string;
@@ -107,6 +122,7 @@ interface ThreeDSMessageExtension {
107
122
  }
108
123
  interface ThreeDSSession {
109
124
  id: string;
125
+ type?: 'customer' | 'merchant';
110
126
  tenantId: string;
111
127
  panTokenId: string;
112
128
  cardBrand: string;
@@ -122,27 +138,27 @@ interface ThreeDSSession {
122
138
  authentication: ThreeDSAuthentication;
123
139
  }
124
140
  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;
141
+ browserAcceptHeader?: string;
142
+ browserIpAddress?: string;
143
+ browserJavascriptEnabled?: boolean | null;
144
+ browserJavaEnabled?: boolean | null;
145
+ browserLanguage?: string;
146
+ browserColorDepth?: string;
147
+ browserScreenHeight?: string;
148
+ browserScreenWidth?: string;
149
+ browserTimezone?: string;
150
+ browserUserAgent?: string;
151
+ sdkTransactionId?: string;
152
+ sdkApplicationId?: string;
153
+ sdkEncryptionData?: string;
154
+ sdkEphemeralPublicKey?: string;
155
+ sdkMaxTimeout?: string;
156
+ sdkReferenceNumber?: string;
157
+ sdkRenderOptions?: ThreeDSMobileSdkRenderOptions;
142
158
  }
143
159
  interface ThreeDSMobileSdkRenderOptions {
144
- sdkInterface: string;
145
- sdkUiType: string;
160
+ sdkInterface?: string;
161
+ sdkUiType?: string;
146
162
  }
147
163
  interface ThreeDSVersion {
148
164
  recommendedVersion: string;
@@ -185,4 +201,4 @@ interface ThreeDSAcsRenderingType {
185
201
  acsInterface: string;
186
202
  acsUiTemplate: string;
187
203
  }
188
- export type { AuthenticateThreeDSSessionRequest, ThreeDSPurchaseInfo, ThreeDSMerchantInfo, ThreeDSMerchantRiskInfo, ThreeDSRequestorInfo, ThreeDSCardholderInfo, ThreeDSCardholderAccountInfo, ThreeDSCardholderAuthenticationInfo, ThreeDSPriorAuthenticationInfo, ThreeDSCardholderPhoneNumber, ThreeDSAddress, ThreeDSMessageExtension, ThreeDSSession, ThreeDSDeviceInfo, ThreeDSMobileSdkRenderOptions, ThreeDSVersion, ThreeDSMethod, ThreeDSAuthentication, ThreeDSAcsRenderingType, };
204
+ export type { CreateThreeDSSessionRequest, CreateThreeDSSessionResponse, AuthenticateThreeDSSessionRequest, ThreeDSPurchaseInfo, ThreeDSMerchantInfo, ThreeDSMerchantRiskInfo, ThreeDSRequestorInfo, ThreeDSCardholderInfo, ThreeDSCardholderAccountInfo, ThreeDSCardholderAuthenticationInfo, ThreeDSPriorAuthenticationInfo, ThreeDSCardholderPhoneNumber, ThreeDSAddress, ThreeDSMessageExtension, ThreeDSSession, ThreeDSDeviceInfo, ThreeDSMobileSdkRenderOptions, ThreeDSVersion, ThreeDSMethod, ThreeDSAuthentication, ThreeDSAcsRenderingType, };
@@ -1,5 +1,6 @@
1
- import { AuthenticateThreeDSSessionRequest, ThreeDSAuthentication, ThreeDSSession } from '../../../types/models/threeds';
1
+ import { AuthenticateThreeDSSessionRequest, CreateThreeDSSessionRequest, CreateThreeDSSessionResponse, ThreeDSAuthentication, ThreeDSSession } from '../../../types/models/threeds';
2
2
  interface ThreeDS {
3
+ createSession(createRequest: CreateThreeDSSessionRequest): Promise<CreateThreeDSSessionResponse>;
3
4
  getSessionById(sessionId: string): Promise<ThreeDSSession>;
4
5
  authenticateSession(sessionId: string, authenticateRequest: AuthenticateThreeDSSessionRequest): Promise<ThreeDSAuthentication>;
5
6
  getChallengeResult(sessionId: string): Promise<ThreeDSAuthentication>;