@vantagepay/vantagepay 0.15.8 → 0.17.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/README.md CHANGED
@@ -382,15 +382,17 @@ The library uses [pubsub-js](https://www.npmjs.com/package/pubsub-js) to publish
382
382
 
383
383
  These events can be useful if your application needs to react to certain things happening behind the scenes. It is especially useful when used to automatically receive payment status updates during payment processing.
384
384
  ```js
385
- import { VantagePay, OnApiRetry, OnAutomaticRefresh, OnSessionExpired } from '@vantagepay/vantagepay'
385
+ import { VantagePay, OnApiRetry, OnAutomaticRefresh, OnSessionStarted, OnSessionExpired } from '@vantagepay/vantagepay'
386
386
  ...
387
387
  const onApiRetrySub = VantagePayClient.events.subscribe(OnApiRetry, (_, retryInfo) => console.log('API performed an automatic retry', retryInfo))
388
388
  const onAutoRefreshSub = VantagePayClient.events.subscribe(OnAutomaticRefresh, (_, tokenResponse) => console.log('Automatic refresh was triggered', tokenResponse))
389
+ const onSessionStartedSub = VantagePayClient.events.subscribe(OnSessionStarted, () => console.log('Session started'))
389
390
  const onSessionExpiredSub = VantagePayClient.events.subscribe(OnSessionExpired, () => console.log('Session expired'))
390
391
  ...
391
392
  // Unsubscribe if you no longer want to receive events.
392
393
  VantagePayClient.events.unsubscribe(onApiRetrySub)
393
394
  VantagePayClient.events.unsubscribe(onAutoRefreshSub)
395
+ VantagePayClient.events.unsubscribe(onSessionStartedSub)
394
396
  VantagePayClient.events.unsubscribe(onSessionExpiredSub)
395
397
  ```
396
398
 
@@ -11,7 +11,7 @@ export declare class Authentication extends BaseApi {
11
11
  checkFace(base64Image: string): Promise<FaceCheckResult>;
12
12
  changePassword(oldPassword: string, newPassword: string): Promise<TokenResponse>;
13
13
  forgotPassword(username: string): Promise<void>;
14
- validateOtp(otpValue: string): Promise<void>;
14
+ validateOtp(otpValue: string): Promise<TokenResponse>;
15
15
  resendOtp(): Promise<void>;
16
16
  resendEmailAddressVerification(): Promise<void>;
17
17
  getCurrentConsumerReference(token?: string): string;
@@ -38,7 +38,8 @@ export declare enum AddressType {
38
38
  /** Model to hold account balance details. */
39
39
  export declare class Balance {
40
40
  currency: Currency;
41
- amountInCents?: number;
41
+ availableAmountInCents?: number;
42
+ currentAmountInCents?: number;
42
43
  }
43
44
  export declare enum BankAccountType {
44
45
  SAVINGS = "SAVINGS",
@@ -6,6 +6,8 @@ export declare class Consumers extends BaseApi {
6
6
  updateConsumer(request: Consumer): Promise<Consumer>;
7
7
  deleteConsumer(): Promise<void>;
8
8
  getConsumer(): Promise<Consumer>;
9
+ getConsumerAgreement(): Promise<string>;
10
+ acceptConsumerAgreement(): Promise<void>;
9
11
  stopCard(cardReference: string, reason?: string): Promise<void>;
10
12
  getBankAccountBalance(bankAccountReference: string): Promise<Balance>;
11
13
  downloadFile(fileReference: string, queryParameters?: Record<string, string>): Promise<ConsumerFile | null>;
@@ -68,40 +68,9 @@ export declare class Beneficiary {
68
68
  /** A list of cards associated with a beneficiary. */
69
69
  cards: BeneficiaryCard[];
70
70
  /** A list of generic accounts (mobile numbers, meter numbers, etc) associated with a beneficiary. */
71
- accounts: BeneficiaryAccount[];
71
+ genericAccounts: BeneficiaryGenericAccount[];
72
72
  isActive: boolean;
73
73
  }
74
- /** Model to hold the unique details for a generic beneficiary account (mobile number, meter number, etc). */
75
- export declare class BeneficiaryAccount {
76
- /** The account number (can be a mobile number, meter number, etc). */
77
- accountNumber: string;
78
- /** The type of beneficiary account. */
79
- beneficiaryAccountType: BeneficiaryAccountType;
80
- beneficiaryAccountTypeName: string;
81
- createdDate: Date;
82
- /** A globally unique reference (UUID) generated by the system internally to identify a specific beneficiary account. */
83
- reference?: string;
84
- /** A 3 character ISO currency code. */
85
- currency: Currency;
86
- /** The details which add sufficient context behind the money transfer to the beneficiary. */
87
- recipientReference?: string;
88
- /** The details which add sufficient context behind the money transfer to the consumer. */
89
- senderReference?: string;
90
- /** A flag indicating whether the consumer requires a notification to be sent to the beneficiary after a successful money transfer. */
91
- sendProofOfPayment: boolean;
92
- /** The email address for the beneficiary. */
93
- proofOfPaymentEmailAddress?: string;
94
- /** The mobile number for the beneficiary. */
95
- proofOfPaymentMobileNumber?: string;
96
- isActive: boolean;
97
- }
98
- export declare enum BeneficiaryAccountType {
99
- None = "None",
100
- MobileNumber = "MobileNumber",
101
- WaterMeter = "WaterMeter",
102
- ElectricityMeter = "ElectricityMeter",
103
- PayShap = "PayShap"
104
- }
105
74
  /** Model to hold the unique details for a bank account beneficiary. */
106
75
  export declare class BeneficiaryBankAccount {
107
76
  /** The bank account token that was generated by the system. */
@@ -161,6 +130,30 @@ export declare class BeneficiaryCard {
161
130
  proofOfPaymentMobileNumber?: string;
162
131
  isActive: boolean;
163
132
  }
133
+ /** Model to hold the unique details for a beneficiary generic account (mobile number, meter number, etc). */
134
+ export declare class BeneficiaryGenericAccount {
135
+ /** The account number (can be a mobile number, meter number, etc). */
136
+ accountNumber: string;
137
+ /** The type of generic account. */
138
+ genericAccountType: GenericAccountType;
139
+ genericAccountTypeName: string;
140
+ createdDate: Date;
141
+ /** A globally unique reference (UUID) generated by the system internally to identify a specific beneficiary account. */
142
+ reference?: string;
143
+ /** A 3 character ISO currency code. */
144
+ currency: Currency;
145
+ /** The details which add sufficient context behind the money transfer to the beneficiary. */
146
+ recipientReference?: string;
147
+ /** The details which add sufficient context behind the money transfer to the consumer. */
148
+ senderReference?: string;
149
+ /** A flag indicating whether the consumer requires a notification to be sent to the beneficiary after a successful money transfer. */
150
+ sendProofOfPayment: boolean;
151
+ /** The email address for the beneficiary. */
152
+ proofOfPaymentEmailAddress?: string;
153
+ /** The mobile number for the beneficiary. */
154
+ proofOfPaymentMobileNumber?: string;
155
+ isActive: boolean;
156
+ }
164
157
  /** Model to hold the unique details for a mobile money beneficiary. */
165
158
  export declare class BeneficiaryMobileWallet {
166
159
  /**
@@ -269,10 +262,12 @@ export declare class ConsumerAccounts {
269
262
  bankAccounts: ConsumerBankAccount[];
270
263
  /** A list of mobile money / wallet accounts associated with a consumer. */
271
264
  mobileWallets: ConsumerMobileWallet[];
272
- /** A list of locan accounts associated with a consumer. */
265
+ /** A list of loan accounts associated with a consumer. */
273
266
  loanAccounts: ConsumerLoanAccount[];
274
- /** A list of locan accounts associated with a consumer. */
267
+ /** A list of insurance policies associated with a consumer. */
275
268
  insurancePolicies: ConsumerInsurancePolicy[];
269
+ /** A list of generic accounts (mobile numbers, meter numbers, etc) associated with a consumer. */
270
+ genericAccounts: ConsumerGenericAccount[];
276
271
  /** A list of cards associated with a consumer. */
277
272
  cards: ConsumerCard[];
278
273
  }
@@ -314,6 +309,7 @@ export declare class ConsumerBankAccount {
314
309
  accountName: string;
315
310
  isActive: boolean;
316
311
  iconUrl?: string;
312
+ linkedFileReferences: string[];
317
313
  }
318
314
  export declare class ConsumerCard {
319
315
  /** Additional customer information to facilitate the card payment. */
@@ -342,6 +338,7 @@ export declare class ConsumerCard {
342
338
  accountName: string;
343
339
  isActive: boolean;
344
340
  iconUrl?: string;
341
+ linkedFileReferences: string[];
345
342
  }
346
343
  export declare class ConsumerFile {
347
344
  fileType: ConsumerFileType;
@@ -353,6 +350,25 @@ export declare class ConsumerFile {
353
350
  base64Data?: string;
354
351
  createdDate: Date;
355
352
  lastUpdatedDate?: Date;
353
+ isActive: boolean;
354
+ }
355
+ /** Model to hold the unique details for a generic account (mobile number, meter number, etc). */
356
+ export declare class ConsumerGenericAccount {
357
+ /** The account number (can be a mobile number, meter number, etc). */
358
+ accountNumber: string;
359
+ /** The type of generic account. */
360
+ genericAccountType: GenericAccountType;
361
+ genericAccountTypeName: string;
362
+ createdDate: Date;
363
+ /** A globally unique transaction reference (UUID) generated by the system internally to identify a specific consumer account. */
364
+ reference?: string;
365
+ /** A 3 character ISO currency code. */
366
+ currency: Currency;
367
+ /** The details which add sufficient context behind the account to the consumer. */
368
+ accountName: string;
369
+ isActive: boolean;
370
+ iconUrl?: string;
371
+ linkedFileReferences: string[];
356
372
  }
357
373
  export declare class ConsumerInsurancePolicy {
358
374
  policyNumber: string;
@@ -369,6 +385,7 @@ export declare class ConsumerInsurancePolicy {
369
385
  accountName: string;
370
386
  isActive: boolean;
371
387
  iconUrl?: string;
388
+ linkedFileReferences: string[];
372
389
  }
373
390
  export declare class ConsumerLoanAccount {
374
391
  contractNumber: string;
@@ -397,6 +414,7 @@ export declare class ConsumerLoanAccount {
397
414
  accountName: string;
398
415
  isActive: boolean;
399
416
  iconUrl?: string;
417
+ linkedFileReferences: string[];
400
418
  }
401
419
  export declare class ConsumerMobileWallet {
402
420
  /**
@@ -415,10 +433,20 @@ export declare class ConsumerMobileWallet {
415
433
  accountName: string;
416
434
  isActive: boolean;
417
435
  iconUrl?: string;
436
+ linkedFileReferences: string[];
418
437
  }
419
438
  export declare class Feedback {
420
439
  description?: string;
421
440
  }
441
+ export declare enum GenericAccountType {
442
+ None = "None",
443
+ MobileNumber = "MobileNumber",
444
+ WaterMeter = "WaterMeter",
445
+ ElectricityMeter = "ElectricityMeter",
446
+ PayShap = "PayShap",
447
+ DStv = "DStv",
448
+ EasyPay = "EasyPay"
449
+ }
422
450
  /** The KYC file result. */
423
451
  export declare class KycFileResult {
424
452
  /** Gets or sets the unique identifier for the KYC service provider used to retrieve the consumer KYC data. */
@@ -1,3 +1,4 @@
1
+ export declare const OnSessionStarted: unique symbol;
1
2
  export declare const OnSessionExpired: unique symbol;
2
3
  export declare const OnAutomaticRefresh: unique symbol;
3
4
  export declare const OnApiRetry: unique symbol;
package/dist/index.d.ts CHANGED
@@ -24,6 +24,17 @@ export * from './apiError';
24
24
  export * from './apiConfig';
25
25
  export { default as ApiTokens } from './apiTokens';
26
26
  export declare class VantagePay {
27
+ static OnSessionStarted: symbol;
28
+ static OnSessionExpired: symbol;
29
+ static OnAutomaticRefresh: symbol;
30
+ static OnApiRetry: symbol;
31
+ static OnPaymentStatusUpdate: symbol;
32
+ static OnPaymentComplete: symbol;
33
+ static OnRequires3DSecure: symbol;
34
+ static OnRequiresPin: symbol;
35
+ static OnRequiresConfirmation: symbol;
36
+ static OnRequiresAddress: symbol;
37
+ static OnComplete3DSecure: symbol;
27
38
  private readonly baseUrl;
28
39
  private readonly consoleLogging;
29
40
  private readonly logBatchSize;