@vantagepay/vantagepay 0.15.0 → 0.15.1

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
@@ -31,9 +31,9 @@ The following options are available when creating an instance.
31
31
  ```js
32
32
  {
33
33
  // The partner URL you are integrating with, this will point to the local development server by default.
34
- baseUrl: 'https://sandbox-api.vantagepay.dev/'
34
+ baseUrl: 'https://sandbox-api.vantagepay.dev/',
35
35
 
36
- // Optional extra headers (string key/value pairs) that you may want to send to th e server with each call.
36
+ // Optional extra headers (string key/value pairs) that you may want to send to the server with each call.
37
37
  headers: {
38
38
  'X-EXAMPLE-HEADER': 'Test'
39
39
  },
@@ -45,7 +45,7 @@ The following options are available when creating an instance.
45
45
  retries: 3,
46
46
 
47
47
  // For additional request/response and signal logging which can be useful when debugging.
48
- consoleLogging: false
48
+ consoleLogging: false,
49
49
 
50
50
  // The batch size limit when logs should immediately be sent to the server, the default is 100, use 0 to disable.
51
51
  logBatchSize: 100,
@@ -149,14 +149,14 @@ try {
149
149
  if (authError.mustChangePassword) {
150
150
  console.log('Navigate to a change password page, the token is internally set to allow calls to auth.changePassword()')
151
151
 
152
- // A successfull change will automatically log you in.
152
+ // A successful change will automatically log you in.
153
153
  await VantagePayClient.auth.changePassword('NewComplexP@55word!')
154
154
  }
155
155
 
156
156
  if (authError.mustValidatePhoneNumber) {
157
157
  console.log('Navigate to the OTP page password page, the token is internally set to allow calls to auth.resendOtp() and auth.validateOtp()')
158
158
 
159
- // A successfull OTP verification will automatically log you in.
159
+ // A successful OTP verification will automatically log you in.
160
160
  await VantagePayClient.auth.validateOtp('1234')
161
161
  }
162
162
 
@@ -154,6 +154,8 @@ export declare class Consumer {
154
154
  fullNameOfNextOfKin?: string;
155
155
  /** Gets or sets the contact number for a consumer's next of kin. */
156
156
  contactNumberForNextOfKin?: string;
157
+ /** Gets or sets an alternate contact number for the consumer. */
158
+ alternateContactNumber?: string;
157
159
  /** Gets or sets the invitation code for the consumer. */
158
160
  invitationCode?: string;
159
161
  /** Gets or sets a flag to indicate whether registration details have been captured by the consumer themselves. */
@@ -222,7 +224,9 @@ export declare enum ConsumerAttribute {
222
224
  MasterCardPAN = 2,
223
225
  RegistrationInvitationCode = 3,
224
226
  GMoneyWalletNumber = 4,
225
- LinkedGcbBankAccountReferences = 5
227
+ LinkedGcbBankAccountReferences = 5,
228
+ MarketingConsent = 6,
229
+ CommunicationOutsideRegularHoursConsent = 7
226
230
  }
227
231
  /** Model to hold various attributes about a consumer. */
228
232
  export declare class ConsumerAttributeValue {
@@ -368,6 +368,19 @@ export declare class PosPermissions {
368
368
  canCloseAndAccessBatchReports: boolean;
369
369
  canEditDeviceSettings: boolean;
370
370
  canExceedMaximumSaleLimits: boolean;
371
+ canProcessCashWithdrawals: boolean;
372
+ canProcessCashDeposit: boolean;
373
+ canUseBalanceEnquiry: boolean;
374
+ canUseDebiCheck: boolean;
375
+ canUseManualCardEntry: boolean;
376
+ canProcessCancellations: boolean;
377
+ canProcessDepositsAndReversals: boolean;
378
+ canUsePreAuthorisation: boolean;
379
+ canUseIncrementalAuthorisation: boolean;
380
+ canOverrideAuthorisation: boolean;
381
+ canCancelAuthorisation: boolean;
382
+ canCompleteAuthorisation: boolean;
383
+ canAccessReports: boolean;
371
384
  }
372
385
  export declare enum SettlementTime {
373
386
  None = "None",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vantagepay/vantagepay",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "VantagePay API wrapper and SDK for integrating into VantagePay payment, consumer and merchant services.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.m.js",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@microsoft/signalr": "^9.0.6",
21
- "axios": "^1.13.0",
21
+ "axios": "^1.13.1",
22
22
  "axios-auth-refresh": "^3.3.6",
23
23
  "axios-retry": "^4.5.0",
24
24
  "pubsub-js": "^1.9.5",
@@ -1,48 +0,0 @@
1
- import { BaseApi } from '../baseApi';
2
- import { OtpVerificationResponse, GMoneyConsumerCreateProfileRequest, GMoneyConsumerUpdateProfileRequest, GMoneyConsumerProfileResponse, GMoneyConsumerWalletResponse, TransactionReportResponse, LinkBankAccountRequest, TransactionReceiptResponse, GMoneyConsumerBankAccountResponse } from './types';
3
- import { TokenResponse } from '../authentication/types';
4
- import { FaceMovementDetectionLevel } from '../lookups/types';
5
- import { ConsumerBankAccount } from '../consumers/types';
6
- export declare class GMoney extends BaseApi {
7
- private readonly branchesCache;
8
- private readonly atmsCache;
9
- private readonly agentsCache;
10
- private readonly merchantNameCache;
11
- private readonly customerNameCache;
12
- private readonly bankAccountNameCache;
13
- private clientContentCache;
14
- private contactDetailsCache;
15
- verifyMobileNumber(msisdn: string): Promise<OtpVerificationResponse>;
16
- validateOtp(otpValue: string): Promise<OtpVerificationResponse>;
17
- resendOtp(): Promise<void>;
18
- createConsumerProfile(request: GMoneyConsumerCreateProfileRequest): Promise<TokenResponse>;
19
- deleteConsumerProfile(): Promise<void>;
20
- updateConsumerProfile(request: GMoneyConsumerUpdateProfileRequest): Promise<GMoneyConsumerProfileResponse>;
21
- getConsumerProfile(): Promise<GMoneyConsumerProfileResponse>;
22
- getWalletInformation(): Promise<GMoneyConsumerWalletResponse>;
23
- changeWalletPin(tempPin: string, newPin: string): Promise<void>;
24
- activateCustomer(oldPin: string, newPin: string): Promise<void>;
25
- resetWalletPin(): Promise<void>;
26
- saveConsumerSelfie(base64Image: string): Promise<string>;
27
- linkGcbBankAccount(request: LinkBankAccountRequest): Promise<void>;
28
- checkConsumerLiveness(base64Images: string[]): Promise<FaceMovementDetectionLevel>;
29
- saveProfilePicture(base64Image: string): Promise<string>;
30
- getBranches(limit?: number, latitude?: number, longitude?: number): Promise<any>;
31
- getAtms(limit?: number, latitude?: number, longitude?: number): Promise<any>;
32
- getAgents(limit?: number, latitude?: number, longitude?: number): Promise<any>;
33
- getMerchantNameFromOrganizationCode(organizationCode: string): Promise<string>;
34
- getCustomerNameFromWalletNumber(msisdn: string): Promise<string>;
35
- getCustomerNameFromBankAccountNumber(accountNumber: string): Promise<string>;
36
- getClientContent(): Promise<any>;
37
- getContactDetails(): Promise<any>;
38
- getRecentTransactions(limit?: number, successOnly?: boolean): Promise<TransactionReportResponse>;
39
- getTransactionHistory(dateFrom?: string, dateTo?: string): Promise<TransactionReportResponse>;
40
- getTransactionReceipt(paymentReference: string): Promise<TransactionReceiptResponse>;
41
- forgotPassword(msisdn: string): Promise<void>;
42
- getServiceStatus(): Promise<boolean>;
43
- getAllLinkedBankAccounts(): Promise<ConsumerBankAccount[]>;
44
- getLinkedBankAccountInformation(bankAccountReference: string): Promise<GMoneyConsumerBankAccountResponse>;
45
- getLinkedBankAccountRecentTransactions(bankAccountReference: string, limit?: number): Promise<TransactionReportResponse>;
46
- getLinkedBankAccountTransactionHistory(bankAccountReference: string): Promise<TransactionReportResponse>;
47
- getLinkedBankAccountTransactionReceipt(paymentReference: string): Promise<TransactionReceiptResponse>;
48
- }
@@ -1,136 +0,0 @@
1
- import { Gender, Currency } from '../lookups/types';
2
- import { KycStatusSummary } from '../consumers/types';
3
- import { PaymentStatusResponse } from '../payments/types';
4
- export interface ForgotPasswordRequest {
5
- msisdn: string;
6
- }
7
- export interface GMoneyActivateCustomerRequest {
8
- oldPin: string;
9
- newPin: string;
10
- }
11
- export interface GMoneyChangePinRequest {
12
- currentTemporaryPin: string;
13
- newPin: string;
14
- }
15
- export interface GMoneyConsumerBankAccountResponse {
16
- isGcbBankAccountLinked: boolean;
17
- accountNumber: string | null;
18
- accountStatus: string | null;
19
- currency: Currency | null;
20
- accountBalanceInCents: number | null;
21
- lastTransactionCurrency: Currency | null;
22
- lastTransactionAmountInCents: number | null;
23
- lastTransactionDate: string | null;
24
- lastTransactionDescription: string | null;
25
- }
26
- export interface GMoneyConsumerCreateProfileRequest {
27
- firstName: string;
28
- lastName: string;
29
- ghanaCardIdNumber: string;
30
- password: string;
31
- emailAddress: string | null;
32
- base64Image: string | null;
33
- }
34
- export interface GMoneyConsumerLivenessRequest {
35
- base64Images: string[];
36
- }
37
- export interface GMoneyConsumerProfilePictureRequest {
38
- base64Image: string | null;
39
- }
40
- export interface GMoneyConsumerProfileResponse {
41
- alias: string | null;
42
- firstName: string;
43
- lastName: string;
44
- dateOfBirth: string;
45
- gender: Gender;
46
- emailAddress: string;
47
- mobileNumber: string;
48
- profileImage: string | null;
49
- rewardPointsInfo: GMoneyRewardPointsInfo | null;
50
- ghanaCardId: string | null;
51
- }
52
- export interface GMoneyConsumerSelfieRequest {
53
- base64Image: string | null;
54
- }
55
- export interface GMoneyConsumerUpdateProfileRequest {
56
- alias: string | null;
57
- dateOfBirth: string | null;
58
- emailAddress: string;
59
- }
60
- export interface GMoneyConsumerWalletResponse {
61
- isAccountLinked: boolean;
62
- isGcbBankAccountLinked: boolean;
63
- isWalletPinLocked: boolean;
64
- isAccountKycVerified: boolean;
65
- hasAccount: boolean;
66
- gMoneyMobileWalletAccountNumber: string | null;
67
- accountStatus: GMoneyIdentityStatus;
68
- currency: Currency | null;
69
- accountBalanceInCents: number | null;
70
- lastTransactionCurrency: Currency | null;
71
- lastTransactionAmountInCents: number | null;
72
- lastTransactionDate: string | null;
73
- lastTransactionDescription: string | null;
74
- kycStatusSummary: KycStatusSummary;
75
- selfieImageRequired: boolean;
76
- }
77
- export declare enum GMoneyIdentityStatus {
78
- NoAccount = -2,
79
- Unknown = -1,
80
- New = 0,
81
- PendingActive = 2,
82
- Active = 3,
83
- Suspended = 4,
84
- Frozen = 5,
85
- Closed = 6,
86
- Capped = 7,
87
- Dormant = 8
88
- }
89
- export interface GMoneyRewardPointsInfo {
90
- pointsBalance: number;
91
- rewardTier: GMoneyRewardTier;
92
- }
93
- export declare enum GMoneyRewardTier {
94
- Basic = 0,
95
- Bronze = 1,
96
- Silver = 2,
97
- Gold = 3
98
- }
99
- export interface LinkBankAccountRequest {
100
- bankAccountName: string;
101
- bankAccountNumber: string;
102
- }
103
- export interface OtpRequest {
104
- msisdn: string;
105
- }
106
- export interface OtpVerificationResponse {
107
- registrationRequired: boolean | null;
108
- otpVerificationRequired: boolean | null;
109
- selfieImageRequired: boolean | null;
110
- previousProfileDeactivated: boolean | null;
111
- accessToken: string | null;
112
- }
113
- export interface RequestBase {
114
- createdDateTime: string;
115
- originatorConversationId: string;
116
- callbackUrl: string | null;
117
- gMoneyWalletPin: string | null;
118
- transactionBatchReference: string;
119
- commentToCustomer: string;
120
- isElevyExempt: boolean;
121
- }
122
- export interface TransactionReceiptResponse extends PaymentStatusResponse {
123
- name: string | null;
124
- receiptId: string | null;
125
- iconUrl: string | null;
126
- }
127
- export interface TransactionReportResponse {
128
- paymentReference: string;
129
- name: string | null;
130
- transactionCompletedDateUtc: string;
131
- currency: string;
132
- amountInCents: number;
133
- isSuccess: boolean;
134
- status: string;
135
- iconUrl: string;
136
- }
@@ -1,21 +0,0 @@
1
- import { AxiosInstance } from 'axios';
2
- import { BaseApi } from '../baseApi';
3
- import { Payments } from '../payments';
4
- import { PaymentStatusResponse } from '../payments/types';
5
- import { PayTvAccountRequest, TopupMobileAirtimeRequest, TopupMobileVoiceDataRequest, TopupMobileDataRequest, BundleData, HubtelMobileOperator } from './types';
6
- export declare class Hubtel extends BaseApi {
7
- private readonly payments;
8
- private readonly mobileDataBundlesCache;
9
- private readonly mobileVoiceBundlesCache;
10
- private mobileOperatorsCache;
11
- constructor(axiosInstance: AxiosInstance, payments: Payments, consoleLogging?: boolean);
12
- payDstv(request: PayTvAccountRequest): Promise<PaymentStatusResponse>;
13
- payGotv(request: PayTvAccountRequest): Promise<PaymentStatusResponse>;
14
- payStarTimesTv(request: PayTvAccountRequest): Promise<PaymentStatusResponse>;
15
- topupMobileData(request: TopupMobileDataRequest): Promise<PaymentStatusResponse>;
16
- topupMobileVoiceData(request: TopupMobileVoiceDataRequest): Promise<PaymentStatusResponse>;
17
- topupMobileAirtime(request: TopupMobileAirtimeRequest): Promise<PaymentStatusResponse>;
18
- getAvailableMobileDataBundles(mobileOperator: HubtelMobileOperator): Promise<BundleData[]>;
19
- getAvailableMobileVoiceBundles(mobileOperator: HubtelMobileOperator): Promise<BundleData[]>;
20
- getMobileOperators(): Promise<any>;
21
- }
@@ -1,35 +0,0 @@
1
- import { BasePaymentRequest, PaymentSources } from '../payments/types';
2
- export interface BundleData {
3
- bundleAmountInCents: number;
4
- displayText: string;
5
- bundleName: string;
6
- }
7
- export declare enum HubtelMobileOperator {
8
- MTN = 1,
9
- VDF = 2,
10
- ATG = 3,
11
- GLO = 4,
12
- SFL = 5,
13
- B4G = 6
14
- }
15
- export interface PayTvAccountRequest extends BasePaymentRequest {
16
- paymentSources: PaymentSources | null;
17
- accountNumber: string;
18
- }
19
- export interface TopupMobileAirtimeRequest extends BasePaymentRequest {
20
- paymentSources: PaymentSources | null;
21
- recipientMobileNumber: string | null;
22
- recipientMobileOperator: HubtelMobileOperator;
23
- }
24
- export interface TopupMobileDataRequest extends BasePaymentRequest {
25
- paymentSources: PaymentSources | null;
26
- recipientMobileNumber: string | null;
27
- recipientMobileOperator: HubtelMobileOperator;
28
- bundleName: string | null;
29
- }
30
- export interface TopupMobileVoiceDataRequest extends BasePaymentRequest {
31
- paymentSources: PaymentSources | null;
32
- recipientMobileNumber: string | null;
33
- recipientMobileOperator: HubtelMobileOperator;
34
- bundleName: string | null;
35
- }
@@ -1,11 +0,0 @@
1
- import { AxiosInstance } from 'axios';
2
- import { BaseApi } from '../baseApi';
3
- import { Payments } from '../payments';
4
- import { PaymentStatusResponse } from '../payments/types';
5
- import { PayWaterAccountRequest, PayElectricityAccountRequest } from './types';
6
- export declare class TransFlow extends BaseApi {
7
- private readonly payments;
8
- constructor(axiosInstance: AxiosInstance, payments: Payments, consoleLogging?: boolean);
9
- payElectricityAccount(request: PayElectricityAccountRequest): Promise<PaymentStatusResponse>;
10
- payWaterAccount(request: PayWaterAccountRequest): Promise<PaymentStatusResponse>;
11
- }
@@ -1,11 +0,0 @@
1
- import { BasePaymentRequest, PaymentSources } from '../payments/types';
2
- export interface PayElectricityAccountRequest extends BasePaymentRequest {
3
- paymentSources: PaymentSources | null;
4
- accountNumber: string;
5
- }
6
- export interface PayWaterAccountRequest extends BasePaymentRequest {
7
- paymentSources: PaymentSources | null;
8
- accountReference: string;
9
- accountHolderEmailAddress: string | null;
10
- accountHolderMobileNumber: string | null;
11
- }