@vantagepay/vantagepay 0.15.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.
Files changed (43) hide show
  1. package/README.md +515 -0
  2. package/dist/apiConfig.d.ts +10 -0
  3. package/dist/apiError.d.ts +5 -0
  4. package/dist/apiTokens.d.ts +7 -0
  5. package/dist/authentication/index.d.ts +22 -0
  6. package/dist/authentication/types.d.ts +67 -0
  7. package/dist/baseApi.d.ts +9 -0
  8. package/dist/common/types.d.ts +99 -0
  9. package/dist/consumers/index.d.ts +11 -0
  10. package/dist/consumers/types.d.ts +358 -0
  11. package/dist/content/index.d.ts +7 -0
  12. package/dist/devices/types.d.ts +20 -0
  13. package/dist/eventTypes.d.ts +10 -0
  14. package/dist/gmoney/index.d.ts +48 -0
  15. package/dist/gmoney/types.d.ts +136 -0
  16. package/dist/hubtel/index.d.ts +21 -0
  17. package/dist/hubtel/types.d.ts +35 -0
  18. package/dist/index.d.ts +36 -0
  19. package/dist/index.js +2 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/index.m.js +2 -0
  22. package/dist/index.m.js.map +1 -0
  23. package/dist/index.modern.mjs +2 -0
  24. package/dist/index.modern.mjs.map +1 -0
  25. package/dist/index.umd.js +2 -0
  26. package/dist/index.umd.js.map +1 -0
  27. package/dist/log/index.d.ts +19 -0
  28. package/dist/log/messageTemplate.d.ts +10 -0
  29. package/dist/log/types.d.ts +20 -0
  30. package/dist/lookups/index.d.ts +28 -0
  31. package/dist/lookups/types.d.ts +1840 -0
  32. package/dist/merchants/index.d.ts +36 -0
  33. package/dist/merchants/types.d.ts +479 -0
  34. package/dist/payments/index.d.ts +38 -0
  35. package/dist/payments/types.d.ts +2015 -0
  36. package/dist/qr/index.d.ts +6 -0
  37. package/dist/reports/index.d.ts +8 -0
  38. package/dist/reports/types.d.ts +67 -0
  39. package/dist/system/index.d.ts +4 -0
  40. package/dist/tokens/types.d.ts +38 -0
  41. package/dist/transflow/index.d.ts +11 -0
  42. package/dist/transflow/types.d.ts +11 -0
  43. package/package.json +47 -0
@@ -0,0 +1,6 @@
1
+ import { BaseApi } from '../baseApi';
2
+ export declare class QrCodes extends BaseApi {
3
+ private readonly qrCache;
4
+ decode(qrCode: string): Promise<any>;
5
+ generate(text: string, width?: number): Promise<string>;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { BaseApi } from '../baseApi';
2
+ import { Currency } from '../lookups/types';
3
+ import { SalesDetailsByDayResponse, SalesDetailsResponse, SalesMonthSummaryResponse } from './types';
4
+ export declare class Reports extends BaseApi {
5
+ getRecentSales(limit?: number, successfulOnly?: boolean): Promise<SalesDetailsResponse[]>;
6
+ getDailySales(currency: Currency, dateFrom?: string, dateTo?: string): Promise<SalesDetailsByDayResponse[]>;
7
+ getSalesSummary(currency: Currency): Promise<SalesMonthSummaryResponse>;
8
+ }
@@ -0,0 +1,67 @@
1
+ import { Currency } from '../lookups/types';
2
+ import { TransactionIconType } from '../payments/types';
3
+ export declare class SalesCategorySummaryResponse {
4
+ category: string;
5
+ transactionCount: number;
6
+ currency: Currency;
7
+ totalSalesInCents: number;
8
+ }
9
+ export declare class SalesDetailsByDayResponse {
10
+ date: Date;
11
+ transactionCount: number;
12
+ currency: Currency;
13
+ totalSalesInCents: number;
14
+ totalCashbackInCents: number;
15
+ totalCommissionFeesInCents: number;
16
+ totalServiceFeesInCents: number;
17
+ totalELevyFeesInCents: number;
18
+ totalUserFeesInCents: number;
19
+ totalTipsInCents: number;
20
+ paymentDetails?: SalesDetailsResponse[];
21
+ }
22
+ export declare class SalesDetailsResponse {
23
+ paymentReference: string;
24
+ shortPaymentReference: string;
25
+ channel: string;
26
+ transactionType: string;
27
+ category: string;
28
+ sourceCategory: string;
29
+ destinationCategory: string;
30
+ sourceFacility: string;
31
+ destinationFacility: string;
32
+ sourceTransactionTypeDescription: string;
33
+ destinationTransactionTypeDescription: string;
34
+ sourceAccount?: string;
35
+ destinationAccount?: string;
36
+ name?: string;
37
+ transactionCompletedDate: Date;
38
+ currency: Currency;
39
+ amountInCents: number;
40
+ cashbackAmountInCents: number;
41
+ commissionFeeAmountInCents: number;
42
+ serviceFeeAmountInCents: number;
43
+ eLevyFeeAmountInCents: number;
44
+ userFeeAmountInCents: number;
45
+ tipAmountInCents: number;
46
+ isSuccess: boolean;
47
+ status: string;
48
+ summaryStatus: string;
49
+ sourceStatus: string;
50
+ destinationStatus: string;
51
+ transactionIconType: TransactionIconType;
52
+ wasQrCodeInitiated: boolean;
53
+ }
54
+ export declare class SalesMonthSummaryResponse {
55
+ year: number;
56
+ month: number;
57
+ currency: Currency;
58
+ description: string;
59
+ totalSalesInCents: number;
60
+ periodTotals: SalesPeriodSummaryResponse[];
61
+ }
62
+ export declare class SalesPeriodSummaryResponse {
63
+ description: string;
64
+ currency: Currency;
65
+ totalSalesInCents: number;
66
+ categoryTotals?: SalesCategorySummaryResponse[];
67
+ }
@@ -0,0 +1,4 @@
1
+ import { BaseApi } from '../baseApi';
2
+ export declare class System extends BaseApi {
3
+ ping(): Promise<void>;
4
+ }
@@ -0,0 +1,38 @@
1
+ import { Bank } from '../lookups/types';
2
+ import { Month } from '../lookups/types';
3
+ import { Currency } from '../lookups/types';
4
+ export declare class BankAccountRequest {
5
+ accountNumber: string;
6
+ bank: Bank;
7
+ }
8
+ export declare class BankAccountResponse {
9
+ token: string;
10
+ }
11
+ export declare class CardRequest {
12
+ cardNumber: string;
13
+ nameOnCard: string;
14
+ expiryMonth: Month;
15
+ expiryYear: number;
16
+ }
17
+ /** A model to hold the details of a card response that is returned to a caller when they tokenize a card or verify a tokenized card. */
18
+ export declare class CardResponse {
19
+ /** The card token that was generated by the system. */
20
+ token: string;
21
+ /** A boolean value indicating whether the small test payment that is required to verify this card, if <see cref="P:ZGA.Core.Models.Tokens.CardResponse.RequiresVerification" />=True, has been completed yet. */
22
+ requiresPayment: boolean;
23
+ /** A boolean value indicating whether this card needs to be verified before it can be activated for use on this system. */
24
+ requiresVerification: boolean;
25
+ /** How many times verification of this card can still be attempted before the card is locked and it will no longer be possible to activate it. */
26
+ verificationAttemptsRemaining: number;
27
+ /** The currency in which the verification payment was made. */
28
+ paymentCurrency: Currency;
29
+ /** The amount, in cents, of the verification payment that was made. */
30
+ paymentAmountInCents: number;
31
+ }
32
+ /** A model to hold the details of a card verification submission. */
33
+ export declare class VerifyCardRequest {
34
+ /** A card token. */
35
+ token: string;
36
+ /** The verification code that appeared on the credit card statement after the verification test payment was made. */
37
+ verificationCode: string;
38
+ }
@@ -0,0 +1,11 @@
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
+ }
@@ -0,0 +1,11 @@
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
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@vantagepay/vantagepay",
3
+ "version": "0.15.0",
4
+ "description": "VantagePay API wrapper and SDK for integrating into VantagePay payment, consumer and merchant services.",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.m.js",
7
+ "unpkg": "./dist/index.umd.js",
8
+ "source": "./src/index.ts",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": ""
12
+ },
13
+ "scripts": {
14
+ "build": "microbundle --tsconfig tsconfig.json",
15
+ "dev": "microbundle watch --tsconfig tsconfig.json",
16
+ "test": "jest --coverage",
17
+ "ncu": "npx npm-check-updates --interactive"
18
+ },
19
+ "dependencies": {
20
+ "@microsoft/signalr": "^9.0.6",
21
+ "axios": "^1.13.0",
22
+ "axios-auth-refresh": "^3.3.6",
23
+ "axios-retry": "^4.5.0",
24
+ "pubsub-js": "^1.9.5",
25
+ "qrcode": "^1.5.4"
26
+ },
27
+ "devDependencies": {
28
+ "@types/es6-promise": "^3.3.2",
29
+ "@types/jest": "^30.0.0",
30
+ "@types/pubsub-js": "^1.8.6",
31
+ "@types/qrcode": "^1.5.6",
32
+ "jest": "^30.2.0",
33
+ "microbundle": "0.15.1",
34
+ "ts-jest": "^29.4.5"
35
+ },
36
+ "keywords": [
37
+ "vantagepay",
38
+ "sdk",
39
+ "api",
40
+ "client"
41
+ ],
42
+ "author": "VantagePay <npm@vantagepay.com>",
43
+ "license": "MIT",
44
+ "files": [
45
+ "dist"
46
+ ]
47
+ }