@vaam-apps/vpay-sdk 0.12.1 → 0.14.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/dist/index.d.ts +1 -1
- package/dist/types.d.ts +35 -8
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ export { verifyWebhook, type VerifyWebhookOptions } from "./webhooks.js";
|
|
|
11
11
|
/** This package's own version, as sent in the `vpay-sdk-node/<version>` User-Agent. */
|
|
12
12
|
export { SDK_VERSION } from "./version.js";
|
|
13
13
|
export { VpayError, VpayApiError, VpayAuthError, VpayUnexpectedResponseError, VpayTransportError, VpayConfigError, VpayInvalidParamsError, WebhookSignatureError, } from "./errors.js";
|
|
14
|
-
export type { AccountHolder, RetrieveAccountHolderParams, CheckoutSession, CheckoutSessionStatus, CheckoutSessionUiMode, CheckoutPaymentStatus, CreateCheckoutSessionParams, ListCheckoutSessionsParams, Customer, DeletedCustomer, Address, AddressParams, CreateCustomerParams, UpdateCustomerParams, ListCustomersParams, Invoice, InvoiceLine, InvoiceStatus, InvoiceStatusTransitions, DeletedInvoice, DeletedInvoiceItem, CreateInvoiceParams, UpdateInvoiceParams, ListInvoicesParams, PayInvoiceParams, HostedPayInvoiceParams, OutOfBandPayInvoiceParams, OutOfBandParams, OutOfBandMethod, OutOfBandPayment, CreateInvoiceItemParams, UpdateInvoiceItemParams, PaymentIntent, PaymentIntentStatus, PaymentMethodType, NextAction, LastPaymentError, FailureCode, Refund, RefundStatus, Event, KnownEventType, Balance, BalanceAmount, List, ListParams, ListPaymentIntentsParams, ListEventsParams, CreatePaymentIntentParams, ConfirmPaymentIntentParams, MtnMomoPaymentMethodData, OrangeMoneyPaymentMethodData, CreateRefundParams, RefundDestination, UpdateRefundParams, ListRefundsParams, RequestOptions, } from "./types.js";
|
|
14
|
+
export type { AccountHolder, RetrieveAccountHolderParams, CheckoutSession, CheckoutSessionStatus, CheckoutSessionUiMode, CheckoutPaymentStatus, CreateCheckoutSessionParams, ListCheckoutSessionsParams, Customer, DeletedCustomer, Address, AddressParams, CreateCustomerParams, UpdateCustomerParams, ListCustomersParams, Invoice, InvoiceLine, InvoiceStatus, InvoiceStatusTransitions, DeletedInvoice, DeletedInvoiceItem, CreateInvoiceParams, UpdateInvoiceParams, ListInvoicesParams, PayInvoiceParams, HostedPayInvoiceParams, OutOfBandPayInvoiceParams, OutOfBandParams, OutOfBandMethod, OutOfBandPayment, CreateInvoiceItemParams, UpdateInvoiceItemParams, PaymentIntent, PaymentIntentStatus, PaymentMethodDetails, PaymentMethodType, NextAction, LastPaymentError, FailureCode, Refund, RefundStatus, Event, KnownEventType, Balance, BalanceAmount, List, ListParams, ListPaymentIntentsParams, ListEventsParams, CreatePaymentIntentParams, ConfirmPaymentIntentParams, MtnMomoPaymentMethodData, OrangeMoneyPaymentMethodData, CreateRefundParams, RefundDestination, UpdateRefundParams, ListRefundsParams, RequestOptions, } from "./types.js";
|
|
15
15
|
export { isCheckoutSessionEvent, isInvoiceEvent, isPaymentIntentEvent, isRefundEvent, } from "./types.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -54,6 +54,23 @@ export interface LastPaymentError {
|
|
|
54
54
|
code: FailureCode;
|
|
55
55
|
message: string;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* What a {@link PaymentIntent}'s one charge was made with (vpay since
|
|
59
|
+
* 2026-10-24): the payment-method type the payer used and the rail vpay
|
|
60
|
+
* charged it on. The outcome of routing; why that rail won is not on the API.
|
|
61
|
+
*/
|
|
62
|
+
export interface PaymentMethodDetails {
|
|
63
|
+
/**
|
|
64
|
+
* The charge's payment-method type (`"mtn_wallet"`, `"orange_wallet"`), or
|
|
65
|
+
* `null` where the charge records none: one confirmed by the code of a rail
|
|
66
|
+
* serving several types (`notchpay`), or made before vpay recorded types.
|
|
67
|
+
* A `string` rather than a closed union, so a type this SDK predates still
|
|
68
|
+
* type-checks.
|
|
69
|
+
*/
|
|
70
|
+
type: string | null;
|
|
71
|
+
/** The code of the rail the charge was made on (`"mtn_momo"`, `"notchpay"`, …). */
|
|
72
|
+
rail: string;
|
|
73
|
+
}
|
|
57
74
|
export interface PaymentIntent {
|
|
58
75
|
id: string;
|
|
59
76
|
object: "payment_intent";
|
|
@@ -63,6 +80,14 @@ export interface PaymentIntent {
|
|
|
63
80
|
currency: string;
|
|
64
81
|
status: PaymentIntentStatus;
|
|
65
82
|
payment_method_types: string[];
|
|
83
|
+
/**
|
|
84
|
+
* What the intent's one charge was made with, or `null` while it has none.
|
|
85
|
+
*
|
|
86
|
+
* `?` because a vpay predating 2026-10-24 omits the key entirely, for
|
|
87
|
+
* {@link PaymentIntent.customer}'s reason: `undefined` and `null` both mean
|
|
88
|
+
* "no charge to describe".
|
|
89
|
+
*/
|
|
90
|
+
payment_method_details?: PaymentMethodDetails | null;
|
|
66
91
|
next_action: NextAction | null;
|
|
67
92
|
last_payment_error: LastPaymentError | null;
|
|
68
93
|
metadata: Record<string, string>;
|
|
@@ -1280,8 +1305,9 @@ export type ListCheckoutSessionsParams = {
|
|
|
1280
1305
|
* On the wire this is `destination[<rail code>][…]` — a rail-agnostic
|
|
1281
1306
|
* container with a rail-specific interior, much as
|
|
1282
1307
|
* `payment_method_data[<payment_method_type>][…]` is on the confirm path. The
|
|
1283
|
-
* outer key is
|
|
1284
|
-
* payment-method type
|
|
1308
|
+
* outer key is the code of the **rail** the charge was made on or, since the
|
|
1309
|
+
* server's 2026-10-24 change, the payment-method type the charge records
|
|
1310
|
+
* (`destination[mtn_wallet]` for a charge routed by `mtn_wallet`). The
|
|
1285
1311
|
* server strips the outer key and hands the interior to that rail's own
|
|
1286
1312
|
* adapter, which is the only thing that knows what a payee looks like there.
|
|
1287
1313
|
* An SDK that flattened this, or that wrote one rail's code into the body
|
|
@@ -1337,16 +1363,17 @@ export type RefundDestination = {
|
|
|
1337
1363
|
/**
|
|
1338
1364
|
* The rail the charge was made on — its code becomes the outer key.
|
|
1339
1365
|
*
|
|
1340
|
-
* A **rail code** (`"mtn_momo"`, `"orange_money"`, `"notchpay"`),
|
|
1341
|
-
* payment-method type
|
|
1342
|
-
*
|
|
1343
|
-
*
|
|
1344
|
-
*
|
|
1366
|
+
* A **rail code** (`"mtn_momo"`, `"orange_money"`, `"notchpay"`), or the
|
|
1367
|
+
* payment-method type the charge records (`"mtn_wallet"`, `"orange_wallet"`):
|
|
1368
|
+
* a server since 2026-10-24 accepts the type for a charge routed by it, which
|
|
1369
|
+
* is how to refund one without knowing the rail it went to (no `/v1` object
|
|
1370
|
+
* names that rail yet). Another type, or a type on an older server, is
|
|
1371
|
+
* refused with a `400` naming `destination`.
|
|
1345
1372
|
*/
|
|
1346
1373
|
payment_method_type: PaymentMethodType;
|
|
1347
1374
|
/**
|
|
1348
1375
|
* The payee's number, **in international form, starting with `+`**. Sent as
|
|
1349
|
-
* `destination[<rail code>][msisdn]`.
|
|
1376
|
+
* `destination[<rail code or method type>][msisdn]`.
|
|
1350
1377
|
*/
|
|
1351
1378
|
msisdn: string;
|
|
1352
1379
|
};
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* releases. A hand-written constant has no such landmine — it just needs to
|
|
10
10
|
* be bumped alongside `package.json`'s own `version` field.
|
|
11
11
|
*/
|
|
12
|
-
export const SDK_VERSION = "0.
|
|
12
|
+
export const SDK_VERSION = "0.14.0"; // x-release-please-version
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaam-apps/vpay-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "The Node.js merchant SDK for vpay's /v1 API: OAuth2 private_key_jwt, payment intents, checkout sessions, refunds, events and webhook verification.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|