@vantagepay/vantagepay 0.15.1 → 0.15.3

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/README.md CHANGED
@@ -71,7 +71,7 @@ The API will respond with typical REST HTTP error status codes (4xx and 5xx) for
71
71
 
72
72
  ```js
73
73
  try {
74
- // ... Call a method on the client library.
74
+ // ... Call a method on the client library.
75
75
  } catch (error) {
76
76
  // First check if it's an API error.
77
77
  if (error instanceof ApiError) {
@@ -106,8 +106,7 @@ try {
106
106
  console.error('Unknown status code from VantagePay client library: ' + error.statusCode)
107
107
  throw error
108
108
  }
109
- }
110
- else {
109
+ } else {
111
110
  // Not a client library error...
112
111
  throw error
113
112
  }
@@ -153,7 +152,7 @@ try {
153
152
  await VantagePayClient.auth.changePassword('NewComplexP@55word!')
154
153
  }
155
154
 
156
- if (authError.mustValidatePhoneNumber) {
155
+ if (authError.mustValidatePhoneNumber || authError.mustValidateEmailAddress) {
157
156
  console.log('Navigate to the OTP page password page, the token is internally set to allow calls to auth.resendOtp() and auth.validateOtp()')
158
157
 
159
158
  // A successful OTP verification will automatically log you in.
@@ -1,10 +1,14 @@
1
1
  import { BaseApi } from '../baseApi';
2
+ import { FaceCheckResult } from '../common/types';
3
+ import { FaceMovementDetectionLevel } from '../lookups/types';
2
4
  import { TokenResponse } from './types';
3
5
  export declare class Authentication extends BaseApi {
4
6
  isLoggedIn(): boolean;
5
7
  login(username: string, password: string): Promise<TokenResponse>;
6
8
  logout(): Promise<void>;
7
9
  refresh(token?: string): Promise<TokenResponse>;
10
+ checkLiveness(base64Images: string[]): Promise<FaceMovementDetectionLevel>;
11
+ checkFace(base64Image: string): Promise<FaceCheckResult>;
8
12
  changePassword(oldPassword: string, newPassword: string): Promise<TokenResponse>;
9
13
  forgotPassword(username: string): Promise<void>;
10
14
  validateOtp(otpValue: string): Promise<void>;
@@ -12,6 +12,9 @@ export declare class ChangePasswordRequest {
12
12
  export declare class ForgotPasswordRequest {
13
13
  username: string;
14
14
  }
15
+ export declare class LivenessRequest {
16
+ base64Images: string[];
17
+ }
15
18
  /** Model to hold login information that can be used to access the system and generate tokens. */
16
19
  export declare class LoginCredentials {
17
20
  /** Gets or sets the username (required). */
@@ -56,6 +59,9 @@ export declare class OtpVerificationResponse {
56
59
  userAccountExists: boolean;
57
60
  accessToken: string;
58
61
  }
62
+ export declare class SelfieRequest {
63
+ base64Image?: string;
64
+ }
59
65
  /** Provides token information for successful login and refresh operations. */
60
66
  export declare class TokenResponse {
61
67
  /** Gets or sets a JWT Refresh token that can be used to request a new Access tokens. */
package/dist/baseApi.d.ts CHANGED
@@ -6,4 +6,5 @@ export declare abstract class BaseApi {
6
6
  protected readonly events: PubSubJS.Base<any, PubSubJS.Message>;
7
7
  constructor(axiosInstance: AxiosInstance, consoleLogging?: boolean);
8
8
  protected request<T>(endpoint: string, method: string, body?: any, token?: string | null): Promise<T>;
9
+ private convertDatesToIso;
9
10
  }
@@ -41,6 +41,12 @@ export declare enum BankAccountType {
41
41
  MONEYMARKET = "MONEYMARKET",
42
42
  CODA = "CODA"
43
43
  }
44
+ /** Model to capture generic contact/lead data. */
45
+ export declare class ContactDetails {
46
+ details: {
47
+ [key: string]: string;
48
+ };
49
+ }
44
50
  export declare class FaceCheckResult {
45
51
  faceCount: number;
46
52
  containsNoise: boolean;
@@ -1,11 +1,13 @@
1
1
  import { BaseApi } from '../baseApi';
2
- import { BasicConsumer, Consumer, Message } from './types';
2
+ import { ContactDetails } from '../common/types';
3
+ import { Consumer, Message } from './types';
3
4
  export declare class Consumers extends BaseApi {
4
- createConsumer(request: BasicConsumer): Promise<Consumer>;
5
+ createConsumer(request: Consumer): Promise<Consumer>;
5
6
  updateConsumer(request: Consumer): Promise<Consumer>;
6
7
  deleteConsumer(): Promise<void>;
7
8
  getConsumer(): Promise<Consumer>;
8
9
  submitFeedback(description: string): Promise<void>;
9
10
  getMessage(messageReference: string): Promise<Message>;
10
11
  deleteMessage(messageReference: string): Promise<void>;
12
+ contactSupport(request: ContactDetails): Promise<void>;
11
13
  }
@@ -121,9 +121,9 @@ export declare class BeneficiaryCard {
121
121
  /** Model to hold the unique details for a mobile money beneficiary. */
122
122
  export declare class BeneficiaryMobileWallet {
123
123
  /**
124
- * Mobile Station International Subscriber Directory Number (MSISDN) is a number used to identify a mobile phone number internationally.
125
- * This number includes a country code and a National Destination Code which identifies the subscriber's operator.
126
- */
124
+ * Mobile Station International Subscriber Directory Number (MSISDN) is a number used to identify a mobile phone number internationally.
125
+ * This number includes a country code and a National Destination Code which identifies the subscriber's operator.
126
+ */
127
127
  msisdn: string;
128
128
  /** The mobile wallet operator that owns the mobile money account. */
129
129
  mobileWalletOperator: MobileWalletOperator;
@@ -226,11 +226,12 @@ export declare enum ConsumerAttribute {
226
226
  GMoneyWalletNumber = 4,
227
227
  LinkedGcbBankAccountReferences = 5,
228
228
  MarketingConsent = 6,
229
- CommunicationOutsideRegularHoursConsent = 7
229
+ CommunicationOutsideRegularHoursConsent = 7,
230
+ PrimarySourceOfFunds = 8
230
231
  }
231
232
  /** Model to hold various attributes about a consumer. */
232
233
  export declare class ConsumerAttributeValue {
233
- name: string;
234
+ name?: string;
234
235
  attribute: ConsumerAttribute;
235
236
  value: string;
236
237
  }
@@ -287,9 +288,9 @@ export declare class ConsumerFile {
287
288
  }
288
289
  export declare class ConsumerMobileWallet {
289
290
  /**
290
- * Mobile Station International Subscriber Directory Number (MSISDN) is a number used to identify a mobile phone number internationally.
291
- * This number includes a country code and a National Destination Code which identifies the subscriber's operator.
292
- */
291
+ * Mobile Station International Subscriber Directory Number (MSISDN) is a number used to identify a mobile phone number internationally.
292
+ * This number includes a country code and a National Destination Code which identifies the subscriber's operator.
293
+ */
293
294
  msisdn: string;
294
295
  /** The mobile wallet operator that owns the mobile money account. */
295
296
  mobileWalletOperator: MobileWalletOperator;
package/dist/index.d.ts CHANGED
@@ -9,6 +9,16 @@ import { Log } from './log';
9
9
  import { System } from './system';
10
10
  import { Content } from './content/index';
11
11
  import { Reports } from './reports/index';
12
+ export * from './authentication/types';
13
+ export * from './common/types';
14
+ export * from './consumers/types';
15
+ export * from './devices/types';
16
+ export * from './log/types';
17
+ export * from './lookups/types';
18
+ export * from './merchants/types';
19
+ export * from './payments/types';
20
+ export * from './reports/types';
21
+ export * from './tokens/types';
12
22
  export * from './eventTypes';
13
23
  export * from './apiError';
14
24
  export * from './apiConfig';