@vantagepay/vantagepay 0.15.0 → 0.15.2
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 +8 -9
- package/dist/baseApi.d.ts +1 -0
- package/dist/consumers/index.d.ts +2 -2
- package/dist/consumers/types.d.ts +12 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.m.js +1 -1
- package/dist/index.m.js.map +1 -1
- package/dist/index.modern.mjs +1 -1
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/merchants/types.d.ts +25 -12
- package/dist/payments/types.d.ts +234 -234
- package/package.json +4 -2
- package/dist/gmoney/index.d.ts +0 -48
- package/dist/gmoney/types.d.ts +0 -136
- package/dist/hubtel/index.d.ts +0 -21
- package/dist/hubtel/types.d.ts +0 -35
- package/dist/transflow/index.d.ts +0 -11
- package/dist/transflow/types.d.ts +0 -11
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
|
|
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,
|
|
@@ -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
|
-
|
|
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
|
}
|
|
@@ -149,14 +148,14 @@ try {
|
|
|
149
148
|
if (authError.mustChangePassword) {
|
|
150
149
|
console.log('Navigate to a change password page, the token is internally set to allow calls to auth.changePassword()')
|
|
151
150
|
|
|
152
|
-
// A
|
|
151
|
+
// A successful change will automatically log you in.
|
|
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
|
-
// A
|
|
158
|
+
// A successful OTP verification will automatically log you in.
|
|
160
159
|
await VantagePayClient.auth.validateOtp('1234')
|
|
161
160
|
}
|
|
162
161
|
|
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
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseApi } from '../baseApi';
|
|
2
|
-
import {
|
|
2
|
+
import { Consumer, Message } from './types';
|
|
3
3
|
export declare class Consumers extends BaseApi {
|
|
4
|
-
createConsumer(request:
|
|
4
|
+
createConsumer(request: Consumer): Promise<Consumer>;
|
|
5
5
|
updateConsumer(request: Consumer): Promise<Consumer>;
|
|
6
6
|
deleteConsumer(): Promise<void>;
|
|
7
7
|
getConsumer(): Promise<Consumer>;
|
|
@@ -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
|
-
|
|
125
|
-
|
|
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;
|
|
@@ -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,10 @@ 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,
|
|
230
|
+
PrimarySourceOfFunds = 8
|
|
226
231
|
}
|
|
227
232
|
/** Model to hold various attributes about a consumer. */
|
|
228
233
|
export declare class ConsumerAttributeValue {
|
|
@@ -283,9 +288,9 @@ export declare class ConsumerFile {
|
|
|
283
288
|
}
|
|
284
289
|
export declare class ConsumerMobileWallet {
|
|
285
290
|
/**
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
+
*/
|
|
289
294
|
msisdn: string;
|
|
290
295
|
/** The mobile wallet operator that owns the mobile money account. */
|
|
291
296
|
mobileWalletOperator: MobileWalletOperator;
|