tupay 0.8.0 → 0.10.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/cjs/client.d.ts +1 -1
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +12 -1
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/errors.d.ts +36 -0
- package/dist/cjs/errors.d.ts.map +1 -1
- package/dist/cjs/errors.js +49 -19
- package/dist/cjs/errors.js.map +1 -1
- package/dist/cjs/index.d.ts +34 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +42 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/liste.d.ts +11 -1
- package/dist/cjs/liste.d.ts.map +1 -1
- package/dist/cjs/liste.js +3 -0
- package/dist/cjs/liste.js.map +1 -1
- package/dist/cjs/resources/checkout-sessions.d.ts +85 -0
- package/dist/cjs/resources/checkout-sessions.d.ts.map +1 -0
- package/dist/cjs/resources/checkout-sessions.js +69 -0
- package/dist/cjs/resources/checkout-sessions.js.map +1 -0
- package/dist/cjs/resources/customers.d.ts +80 -0
- package/dist/cjs/resources/customers.d.ts.map +1 -0
- package/dist/cjs/resources/customers.js +77 -0
- package/dist/cjs/resources/customers.js.map +1 -0
- package/dist/cjs/resources/payment-intents.d.ts +27 -0
- package/dist/cjs/resources/payment-intents.d.ts.map +1 -1
- package/dist/cjs/resources/payment-intents.js.map +1 -1
- package/dist/cjs/resources/payment-links.d.ts +26 -1
- package/dist/cjs/resources/payment-links.d.ts.map +1 -1
- package/dist/cjs/resources/payment-links.js.map +1 -1
- package/dist/cjs/resources/payment-methods.d.ts +76 -0
- package/dist/cjs/resources/payment-methods.d.ts.map +1 -0
- package/dist/cjs/resources/payment-methods.js +77 -0
- package/dist/cjs/resources/payment-methods.js.map +1 -0
- package/dist/cjs/resources/prices.d.ts +73 -0
- package/dist/cjs/resources/prices.d.ts.map +1 -0
- package/dist/cjs/resources/prices.js +78 -0
- package/dist/cjs/resources/prices.js.map +1 -0
- package/dist/cjs/resources/products.d.ts +56 -0
- package/dist/cjs/resources/products.d.ts.map +1 -0
- package/dist/cjs/resources/products.js +70 -0
- package/dist/cjs/resources/products.js.map +1 -0
- package/dist/cjs/resources/receipts.d.ts +40 -0
- package/dist/cjs/resources/receipts.d.ts.map +1 -0
- package/dist/cjs/resources/receipts.js +49 -0
- package/dist/cjs/resources/receipts.js.map +1 -0
- package/dist/cjs/resources/setup-intents.d.ts +46 -0
- package/dist/cjs/resources/setup-intents.d.ts.map +1 -0
- package/dist/cjs/resources/setup-intents.js +62 -0
- package/dist/cjs/resources/setup-intents.js.map +1 -0
- package/dist/cjs/resources/transactions.d.ts +7 -0
- package/dist/cjs/resources/transactions.d.ts.map +1 -1
- package/dist/cjs/resources/transactions.js +1 -0
- package/dist/cjs/resources/transactions.js.map +1 -1
- package/dist/cjs/types.d.ts +317 -0
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/client.d.ts +1 -1
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +12 -1
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/errors.d.ts +36 -0
- package/dist/esm/errors.d.ts.map +1 -1
- package/dist/esm/errors.js +47 -18
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/index.d.ts +34 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +34 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/liste.d.ts +11 -1
- package/dist/esm/liste.d.ts.map +1 -1
- package/dist/esm/liste.js +3 -0
- package/dist/esm/liste.js.map +1 -1
- package/dist/esm/resources/checkout-sessions.d.ts +85 -0
- package/dist/esm/resources/checkout-sessions.d.ts.map +1 -0
- package/dist/esm/resources/checkout-sessions.js +65 -0
- package/dist/esm/resources/checkout-sessions.js.map +1 -0
- package/dist/esm/resources/customers.d.ts +80 -0
- package/dist/esm/resources/customers.d.ts.map +1 -0
- package/dist/esm/resources/customers.js +73 -0
- package/dist/esm/resources/customers.js.map +1 -0
- package/dist/esm/resources/payment-intents.d.ts +27 -0
- package/dist/esm/resources/payment-intents.d.ts.map +1 -1
- package/dist/esm/resources/payment-intents.js.map +1 -1
- package/dist/esm/resources/payment-links.d.ts +26 -1
- package/dist/esm/resources/payment-links.d.ts.map +1 -1
- package/dist/esm/resources/payment-links.js.map +1 -1
- package/dist/esm/resources/payment-methods.d.ts +76 -0
- package/dist/esm/resources/payment-methods.d.ts.map +1 -0
- package/dist/esm/resources/payment-methods.js +73 -0
- package/dist/esm/resources/payment-methods.js.map +1 -0
- package/dist/esm/resources/prices.d.ts +73 -0
- package/dist/esm/resources/prices.d.ts.map +1 -0
- package/dist/esm/resources/prices.js +74 -0
- package/dist/esm/resources/prices.js.map +1 -0
- package/dist/esm/resources/products.d.ts +56 -0
- package/dist/esm/resources/products.d.ts.map +1 -0
- package/dist/esm/resources/products.js +66 -0
- package/dist/esm/resources/products.js.map +1 -0
- package/dist/esm/resources/receipts.d.ts +40 -0
- package/dist/esm/resources/receipts.d.ts.map +1 -0
- package/dist/esm/resources/receipts.js +45 -0
- package/dist/esm/resources/receipts.js.map +1 -0
- package/dist/esm/resources/setup-intents.d.ts +46 -0
- package/dist/esm/resources/setup-intents.d.ts.map +1 -0
- package/dist/esm/resources/setup-intents.js +58 -0
- package/dist/esm/resources/setup-intents.js.map +1 -0
- package/dist/esm/resources/transactions.d.ts +7 -0
- package/dist/esm/resources/transactions.d.ts.map +1 -1
- package/dist/esm/resources/transactions.js +1 -0
- package/dist/esm/resources/transactions.js.map +1 -1
- package/dist/esm/types.d.ts +317 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
import { type TupayOptions } from './client.js';
|
|
17
17
|
import { PaymentIntents } from './resources/payment-intents.js';
|
|
18
18
|
import { PaymentLinks } from './resources/payment-links.js';
|
|
19
|
+
import { Customers } from './resources/customers.js';
|
|
20
|
+
import { PaymentMethods } from './resources/payment-methods.js';
|
|
21
|
+
import { SetupIntents } from './resources/setup-intents.js';
|
|
22
|
+
import { Products } from './resources/products.js';
|
|
23
|
+
import { CheckoutSessions } from './resources/checkout-sessions.js';
|
|
24
|
+
import { Receipts } from './resources/receipts.js';
|
|
25
|
+
import { Prices } from './resources/prices.js';
|
|
19
26
|
import { Transactions } from './resources/transactions.js';
|
|
20
27
|
import { Refunds } from './resources/refunds.js';
|
|
21
28
|
import { WebhookEndpoints } from './resources/webhook-endpoints.js';
|
|
@@ -29,6 +36,18 @@ export declare class Tupay {
|
|
|
29
36
|
readonly paymentIntents: PaymentIntents;
|
|
30
37
|
readonly paymentLinks: PaymentLinks;
|
|
31
38
|
readonly transactions: Transactions;
|
|
39
|
+
/** Le carnet d'adresses : reconnaître une personne d'un paiement à l'autre. */
|
|
40
|
+
readonly customers: Customers;
|
|
41
|
+
/** Les cartes enregistrées. Tupay ne reçoit jamais de numéro de carte. */
|
|
42
|
+
readonly paymentMethods: PaymentMethods;
|
|
43
|
+
/** Enregistrer une carte sans débiter, pour prélever plus tard. */
|
|
44
|
+
readonly setupIntents: SetupIntents;
|
|
45
|
+
/** Le catalogue : ce que vous vendez. */
|
|
46
|
+
readonly products: Products;
|
|
47
|
+
/** Les prix de votre catalogue. Immuables dès leur création. */
|
|
48
|
+
readonly checkoutSessions: CheckoutSessions;
|
|
49
|
+
readonly receipts: Receipts;
|
|
50
|
+
readonly prices: Prices;
|
|
32
51
|
readonly refunds: Refunds;
|
|
33
52
|
readonly webhookEndpoints: WebhookEndpoints;
|
|
34
53
|
readonly merchants: Merchants;
|
|
@@ -72,11 +91,25 @@ export { TupayClient } from './client.js';
|
|
|
72
91
|
export type { TupayOptions, RequestOptions } from './client.js';
|
|
73
92
|
export { constructEvent, DEFAULT_TOLERANCE_SECONDS } from './webhooks.js';
|
|
74
93
|
export type { ConstructEventOptions } from './webhooks.js';
|
|
75
|
-
export { TupayError, TupayAuthenticationError, TupayPermissionError, TupayNotFoundError, TupayValidationError, TupayConflictError, TupayIdempotencyError, TupayRateLimitError, TupayApiError, TupayBaasError, TupayConnectionError, TupaySignatureVerificationError, } from './errors.js';
|
|
94
|
+
export { TupayError, TupayAuthenticationError, TupayPermissionError, TupayNotFoundError, TupayValidationError, TupayConflictError, TupayIdempotencyError, TupayRateLimitError, TupayApiError, TupayBaasError, TupayPaymentDeclinedError, TupayConnectionError, TupaySignatureVerificationError, } from './errors.js';
|
|
76
95
|
export type * from './types.js';
|
|
77
96
|
export type { CreatePaymentIntentParams } from './resources/payment-intents.js';
|
|
78
97
|
export type { CreatePaymentLinkParams } from './resources/payment-links.js';
|
|
79
98
|
export type { ListTransactionsParams } from './resources/transactions.js';
|
|
99
|
+
export type { CreateCustomerParams, UpdateCustomerParams, ListCustomersParams, } from './resources/customers.js';
|
|
100
|
+
export { Customers } from './resources/customers.js';
|
|
101
|
+
export type { CreatePaymentMethodParams, UpdatePaymentMethodParams, ListPaymentMethodsParams, } from './resources/payment-methods.js';
|
|
102
|
+
export { PaymentMethods } from './resources/payment-methods.js';
|
|
103
|
+
export type { CreateSetupIntentParams, ListSetupIntentsParams, } from './resources/setup-intents.js';
|
|
104
|
+
export { SetupIntents } from './resources/setup-intents.js';
|
|
105
|
+
export type { CreateProductParams, UpdateProductParams, ListProductsParams, } from './resources/products.js';
|
|
106
|
+
export { Products } from './resources/products.js';
|
|
107
|
+
export type { CreatePriceParams, UpdatePriceParams, ListPricesParams, } from './resources/prices.js';
|
|
108
|
+
export { Prices } from './resources/prices.js';
|
|
109
|
+
export type { CheckoutLineItem, CreateCheckoutSessionParams, ListCheckoutSessionsParams, } from './resources/checkout-sessions.js';
|
|
110
|
+
export { CheckoutSessions } from './resources/checkout-sessions.js';
|
|
111
|
+
export type { ListReceiptsParams } from './resources/receipts.js';
|
|
112
|
+
export { Receipts } from './resources/receipts.js';
|
|
80
113
|
export type { CreateRefundParams, ListRefundsParams } from './resources/refunds.js';
|
|
81
114
|
export type { CreateWebhookEndpointParams, UpdateWebhookEndpointParams, ListDeliveriesParams, } from './resources/webhook-endpoints.js';
|
|
82
115
|
export type { ListEventsParams } from './resources/events.js';
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,qBAAa,KAAK;;IAChB,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAA;IACnC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAA;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAA;IAC3C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EA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AAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACnF,YAAY,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,oBAAoB,GACrB,MAAM,kCAAkC,CAAA;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA"}
|
package/dist/esm/index.js
CHANGED
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
import { TupayClient } from './client.js';
|
|
17
17
|
import { PaymentIntents } from './resources/payment-intents.js';
|
|
18
18
|
import { PaymentLinks } from './resources/payment-links.js';
|
|
19
|
+
import { Customers } from './resources/customers.js';
|
|
20
|
+
import { PaymentMethods } from './resources/payment-methods.js';
|
|
21
|
+
import { SetupIntents } from './resources/setup-intents.js';
|
|
22
|
+
import { Products } from './resources/products.js';
|
|
23
|
+
import { CheckoutSessions } from './resources/checkout-sessions.js';
|
|
24
|
+
import { Receipts } from './resources/receipts.js';
|
|
25
|
+
import { Prices } from './resources/prices.js';
|
|
19
26
|
import { Transactions } from './resources/transactions.js';
|
|
20
27
|
import { Refunds } from './resources/refunds.js';
|
|
21
28
|
import { WebhookEndpoints } from './resources/webhook-endpoints.js';
|
|
@@ -27,6 +34,18 @@ export class Tupay {
|
|
|
27
34
|
paymentIntents;
|
|
28
35
|
paymentLinks;
|
|
29
36
|
transactions;
|
|
37
|
+
/** Le carnet d'adresses : reconnaître une personne d'un paiement à l'autre. */
|
|
38
|
+
customers;
|
|
39
|
+
/** Les cartes enregistrées. Tupay ne reçoit jamais de numéro de carte. */
|
|
40
|
+
paymentMethods;
|
|
41
|
+
/** Enregistrer une carte sans débiter, pour prélever plus tard. */
|
|
42
|
+
setupIntents;
|
|
43
|
+
/** Le catalogue : ce que vous vendez. */
|
|
44
|
+
products;
|
|
45
|
+
/** Les prix de votre catalogue. Immuables dès leur création. */
|
|
46
|
+
checkoutSessions;
|
|
47
|
+
receipts;
|
|
48
|
+
prices;
|
|
30
49
|
refunds;
|
|
31
50
|
webhookEndpoints;
|
|
32
51
|
merchants;
|
|
@@ -43,6 +62,13 @@ export class Tupay {
|
|
|
43
62
|
this.paymentIntents = new PaymentIntents(this.#client);
|
|
44
63
|
this.paymentLinks = new PaymentLinks(this.#client);
|
|
45
64
|
this.transactions = new Transactions(this.#client);
|
|
65
|
+
this.customers = new Customers(this.#client);
|
|
66
|
+
this.paymentMethods = new PaymentMethods(this.#client);
|
|
67
|
+
this.setupIntents = new SetupIntents(this.#client);
|
|
68
|
+
this.products = new Products(this.#client);
|
|
69
|
+
this.checkoutSessions = new CheckoutSessions(this.#client);
|
|
70
|
+
this.receipts = new Receipts(this.#client);
|
|
71
|
+
this.prices = new Prices(this.#client);
|
|
46
72
|
this.refunds = new Refunds(this.#client);
|
|
47
73
|
this.webhookEndpoints = new WebhookEndpoints(this.#client);
|
|
48
74
|
this.merchants = new Merchants(this.#client);
|
|
@@ -84,7 +110,14 @@ export class Tupay {
|
|
|
84
110
|
export default Tupay;
|
|
85
111
|
export { TupayClient } from './client.js';
|
|
86
112
|
export { constructEvent, DEFAULT_TOLERANCE_SECONDS } from './webhooks.js';
|
|
87
|
-
export { TupayError, TupayAuthenticationError, TupayPermissionError, TupayNotFoundError, TupayValidationError, TupayConflictError, TupayIdempotencyError, TupayRateLimitError, TupayApiError, TupayBaasError, TupayConnectionError, TupaySignatureVerificationError, } from './errors.js';
|
|
113
|
+
export { TupayError, TupayAuthenticationError, TupayPermissionError, TupayNotFoundError, TupayValidationError, TupayConflictError, TupayIdempotencyError, TupayRateLimitError, TupayApiError, TupayBaasError, TupayPaymentDeclinedError, TupayConnectionError, TupaySignatureVerificationError, } from './errors.js';
|
|
114
|
+
export { Customers } from './resources/customers.js';
|
|
115
|
+
export { PaymentMethods } from './resources/payment-methods.js';
|
|
116
|
+
export { SetupIntents } from './resources/setup-intents.js';
|
|
117
|
+
export { Products } from './resources/products.js';
|
|
118
|
+
export { Prices } from './resources/prices.js';
|
|
119
|
+
export { CheckoutSessions } from './resources/checkout-sessions.js';
|
|
120
|
+
export { Receipts } from './resources/receipts.js';
|
|
88
121
|
export { Events } from './resources/events.js';
|
|
89
122
|
export { TestHelpers } from './resources/test-helpers.js';
|
|
90
123
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAqB,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,cAAc,EAA8B,MAAM,eAAe,CAAA;AAG1E,MAAM,OAAO,KAAK;IACP,cAAc,CAAgB;IAC9B,YAAY,CAAc;IAC1B,YAAY,CAAc;
|
|
1
|
+
{"version":3,"file":"index.js","sourceR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MAAM,EAAE,MAAM,uBAAuB,CAAA;AAM9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAQlD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA"}
|
package/dist/esm/liste.d.ts
CHANGED
|
@@ -26,6 +26,16 @@ export interface ListeBrute<T> {
|
|
|
26
26
|
export declare function normaliserListe<T>(brut: ListeBrute<T>): ListResult<T>;
|
|
27
27
|
/** Ce qui est commun aux six collections. */
|
|
28
28
|
export interface ListParams {
|
|
29
|
+
/**
|
|
30
|
+
* Développe des références : le champ porte l'objet complet au lieu de
|
|
31
|
+
* son seul identifiant, qui reste servi.
|
|
32
|
+
*
|
|
33
|
+
* Profondeur maximale 2. Un chemin inconnu ou trop profond est refusé
|
|
34
|
+
* en 400 : un expand sans borne est une attaque par amplification.
|
|
35
|
+
*
|
|
36
|
+
* @example ['transaction', 'transaction.payment_link']
|
|
37
|
+
*/
|
|
38
|
+
expand?: string[];
|
|
29
39
|
/** Entre 1 et 100. Défaut 25. Une valeur hors bornes est refusée en 400. */
|
|
30
40
|
limit?: number;
|
|
31
41
|
/**
|
|
@@ -50,5 +60,5 @@ export interface ListParams {
|
|
|
50
60
|
offset?: number;
|
|
51
61
|
}
|
|
52
62
|
/** Traduit les paramètres communs en chaîne de requête. */
|
|
53
|
-
export declare function parametresListe(params: ListParams): Record<string, string | number | boolean | undefined>;
|
|
63
|
+
export declare function parametresListe(params: ListParams): Record<string, string | number | boolean | readonly string[] | undefined>;
|
|
54
64
|
//# sourceMappingURL=liste.d.ts.map
|
package/dist/esm/liste.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liste.d.ts","sourceRoot":"","sources":["../../src/liste.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiB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AQG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,2DAA2D;AAC3D,wBAAgB,eAAe,CAC7B,MAAM,EAAE,UAAU,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC,CAU3E"}
|
package/dist/esm/liste.js
CHANGED
|
@@ -27,6 +27,9 @@ export function parametresListe(params) {
|
|
|
27
27
|
starting_after: params.startingAfter,
|
|
28
28
|
ending_before: params.endingBefore,
|
|
29
29
|
offset: params.offset,
|
|
30
|
+
// Émis sous `expand[]`, la forme canonique. Le client sérialise les
|
|
31
|
+
// tableaux ainsi ; c'est lui qui ajoute les crochets.
|
|
32
|
+
expand: params.expand,
|
|
30
33
|
};
|
|
31
34
|
}
|
|
32
35
|
//# sourceMappingURL=liste.js.map
|
package/dist/esm/liste.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liste.js","sourceRoot":"","sources":["../../src/liste.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAWH,MAAM,UAAU,eAAe,CAAI,IAAmB;IACpD,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,IAAI,KAAK,CAAA;IACrD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;AACrE,CAAC;
|
|
1
|
+
{"version":3,"file":"liste.js","sourceRoot":"","sources":["../../src/liste.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAWH,MAAM,UAAU,eAAe,CAAI,IAAmB;IACpD,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,IAAI,KAAK,CAAA;IACrD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;AACrE,CAAC;AAsCD,2DAA2D;AAC3D,MAAM,UAAU,eAAe,CAC7B,MAAkB;IAElB,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,cAAc,EAAE,MAAM,CAAC,aAAa;QACpC,aAAa,EAAE,MAAM,CAAC,YAAY;QAClC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,oEAAoE;QACpE,sDAAsD;QACtD,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { TupayClient } from '../client.js';
|
|
2
|
+
import type { CheckoutCustomerMatch, CheckoutSession, CheckoutSessionStatus, ListResult } from '../types.js';
|
|
3
|
+
import { type ListParams } from '../liste.js';
|
|
4
|
+
/**
|
|
5
|
+
* Une ligne du récapitulatif affiché au client.
|
|
6
|
+
*
|
|
7
|
+
* `price` **ou** `amountXpf`, exactement l'un des deux. Avec `price`, le
|
|
8
|
+
* libellé vient du tarif — passer `description` en plus est refusé.
|
|
9
|
+
*/
|
|
10
|
+
export type CheckoutLineItem = {
|
|
11
|
+
/** Tarif du catalogue — `<uuid>` ou `price_<uuid>`. */
|
|
12
|
+
price: string;
|
|
13
|
+
quantity?: number;
|
|
14
|
+
description?: never;
|
|
15
|
+
amountXpf?: never;
|
|
16
|
+
} | {
|
|
17
|
+
description: string;
|
|
18
|
+
/** Entier XPF. Le franc pacifique n'a pas de centimes. */
|
|
19
|
+
amountXpf: number;
|
|
20
|
+
quantity?: number;
|
|
21
|
+
price?: never;
|
|
22
|
+
};
|
|
23
|
+
export interface CreateCheckoutSessionParams {
|
|
24
|
+
lineItems: CheckoutLineItem[];
|
|
25
|
+
/** Où renvoyer le client une fois payé. HTTPS exigé en mode live. */
|
|
26
|
+
successUrl: string;
|
|
27
|
+
cancelUrl?: string;
|
|
28
|
+
/** Entre 30 et 1440. Défaut : 1440 (24 h). */
|
|
29
|
+
expiresInMinutes?: number;
|
|
30
|
+
/** Fiche client — `<uuid>` ou `cus_<uuid>`. */
|
|
31
|
+
customer?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Constitue votre fichier client tout seul : au règlement, la fiche
|
|
34
|
+
* est retrouvée ou créée, et le résultat est lisible dans
|
|
35
|
+
* `customerMatch`. Ignoré si `customer` est fourni.
|
|
36
|
+
*/
|
|
37
|
+
customerEmail?: string;
|
|
38
|
+
metadata?: Record<string, string>;
|
|
39
|
+
/** Omise, le SDK en génère une (UUID v4) : la requête devient rejouable. */
|
|
40
|
+
idempotencyKey?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ListCheckoutSessionsParams extends ListParams {
|
|
43
|
+
status?: CheckoutSessionStatus;
|
|
44
|
+
/**
|
|
45
|
+
* `'ambiguous'` est la liste à ouvrir pour réconcilier : plusieurs
|
|
46
|
+
* fiches portaient l'email, une neuve a été créée.
|
|
47
|
+
*/
|
|
48
|
+
customerMatch?: CheckoutCustomerMatch;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Les pages de paiement hébergées par Tupay.
|
|
52
|
+
*
|
|
53
|
+
* Vous n'affichez ni formulaire ni montant : la session porte les deux,
|
|
54
|
+
* et vous n'avez qu'à rediriger.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* const session = await tupay.checkoutSessions.create({
|
|
58
|
+
* lineItems: [{ price: tarif.id, quantity: 2 }],
|
|
59
|
+
* successUrl: 'https://boutique.pf/merci',
|
|
60
|
+
* cancelUrl: 'https://boutique.pf/panier',
|
|
61
|
+
* })
|
|
62
|
+
* redirect(session.url)
|
|
63
|
+
*/
|
|
64
|
+
export declare class CheckoutSessions {
|
|
65
|
+
private readonly client;
|
|
66
|
+
constructor(client: TupayClient);
|
|
67
|
+
/**
|
|
68
|
+
* Ouvre une session. **Le total est figé maintenant** : modifier ou
|
|
69
|
+
* désactiver un tarif ensuite ne change pas ce que la page affiche.
|
|
70
|
+
*
|
|
71
|
+
* Un tarif désactivé lève une `TupayConflictError` — il ne sert plus à
|
|
72
|
+
* composer de nouvelles offres.
|
|
73
|
+
*/
|
|
74
|
+
create(params: CreateCheckoutSessionParams): Promise<CheckoutSession>;
|
|
75
|
+
/**
|
|
76
|
+
* L'état à jour d'une session.
|
|
77
|
+
*
|
|
78
|
+
* C'est cette lecture qui **matérialise l'expiration** : une session
|
|
79
|
+
* dont l'échéance est passée est rendue `expired`, et l'est désormais
|
|
80
|
+
* pour tout le monde. `list()` ne le fait pas — une liste n'écrit pas.
|
|
81
|
+
*/
|
|
82
|
+
retrieve(id: string): Promise<CheckoutSession>;
|
|
83
|
+
list(params?: ListCheckoutSessionsParams): Promise<ListResult<CheckoutSession>>;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=checkout-sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-sessions.d.ts","sourceRoot":"","sources":["../../../src/resources/checkout-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,UAAU,EACX,MAAM,aAAa,CAAA;AACpB,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,aAAa,CAAA;AAEpB;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GACxB;IACE,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,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} from '../liste.js';
|
|
3
|
+
/**
|
|
4
|
+
* Les pages de paiement hébergées par Tupay.
|
|
5
|
+
*
|
|
6
|
+
* Vous n'affichez ni formulaire ni montant : la session porte les deux,
|
|
7
|
+
* et vous n'avez qu'à rediriger.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const session = await tupay.checkoutSessions.create({
|
|
11
|
+
* lineItems: [{ price: tarif.id, quantity: 2 }],
|
|
12
|
+
* successUrl: 'https://boutique.pf/merci',
|
|
13
|
+
* cancelUrl: 'https://boutique.pf/panier',
|
|
14
|
+
* })
|
|
15
|
+
* redirect(session.url)
|
|
16
|
+
*/
|
|
17
|
+
export class CheckoutSessions {
|
|
18
|
+
client;
|
|
19
|
+
constructor(client) {
|
|
20
|
+
this.client = client;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Ouvre une session. **Le total est figé maintenant** : modifier ou
|
|
24
|
+
* désactiver un tarif ensuite ne change pas ce que la page affiche.
|
|
25
|
+
*
|
|
26
|
+
* Un tarif désactivé lève une `TupayConflictError` — il ne sert plus à
|
|
27
|
+
* composer de nouvelles offres.
|
|
28
|
+
*/
|
|
29
|
+
async create(params) {
|
|
30
|
+
const { idempotencyKey, ...body } = params;
|
|
31
|
+
const { data } = await this.client.request({
|
|
32
|
+
method: 'POST',
|
|
33
|
+
path: '/checkout-sessions',
|
|
34
|
+
body,
|
|
35
|
+
idempotencyKey: idempotencyKey ?? TupayClient.idempotencyKey(),
|
|
36
|
+
});
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* L'état à jour d'une session.
|
|
41
|
+
*
|
|
42
|
+
* C'est cette lecture qui **matérialise l'expiration** : une session
|
|
43
|
+
* dont l'échéance est passée est rendue `expired`, et l'est désormais
|
|
44
|
+
* pour tout le monde. `list()` ne le fait pas — une liste n'écrit pas.
|
|
45
|
+
*/
|
|
46
|
+
async retrieve(id) {
|
|
47
|
+
const { data } = await this.client.request({
|
|
48
|
+
method: 'GET',
|
|
49
|
+
path: `/checkout-sessions/${encodeURIComponent(id)}`,
|
|
50
|
+
});
|
|
51
|
+
return data;
|
|
52
|
+
}
|
|
53
|
+
async list(params = {}) {
|
|
54
|
+
return normaliserListe(await this.client.request({
|
|
55
|
+
method: 'GET',
|
|
56
|
+
path: '/checkout-sessions',
|
|
57
|
+
query: {
|
|
58
|
+
...parametresListe(params),
|
|
59
|
+
status: params.status,
|
|
60
|
+
customerMatch: params.customerMatch,
|
|
61
|
+
},
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=checkout-sessions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-sessions.js","sourceRoot":"","sources":["../../../src/resources/checkout-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAO1C,OAAO,EACL,eAAe,EACf,eAAe,GAGhB,MAAM,aAAa,CAAA;AAqDpB;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,gBAAgB;IACE;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,MAAmC;QAC9C,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAA;QAC1C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA4B;YACpE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,oBAAoB;YAC1B,IAAI;YACJ,cAAc,EAAE,cAAc,IAAI,WAAW,CAAC,cAAc,EAAE;SAC/D,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAU;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA4B;YACpE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,EAAE;SACrD,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,IAAI,CACR,SAAqC,EAAE;QAEvC,OAAO,eAAe,CACpB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA8B;YACrD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE;gBACL,GAAG,eAAe,CAAC,MAAM,CAAC;gBAC1B,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,aAAa,EAAE,MAAM,CAAC,aAAa;aACpC;SACF,CAAC,CACH,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { TupayClient } from '../client.js';
|
|
2
|
+
import type { Customer, ListResult } from '../types.js';
|
|
3
|
+
import { type ListParams } from '../liste.js';
|
|
4
|
+
export interface CreateCustomerParams {
|
|
5
|
+
/**
|
|
6
|
+
* Clé d'idempotence. Omise, le SDK en génère une (UUID v4) : la
|
|
7
|
+
* requête devient rejouable, et une reprise après timeout ne crée pas
|
|
8
|
+
* une seconde fiche pour la même personne.
|
|
9
|
+
*/
|
|
10
|
+
idempotencyKey?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Conservé tel que vous l'écrivez : ni normalisé, ni validé au-delà de
|
|
15
|
+
* sa longueur. Un marchand de Papeete enregistre aussi des numéros
|
|
16
|
+
* métropolitains ou néo-zélandais, qu'une validation stricte
|
|
17
|
+
* refuserait.
|
|
18
|
+
*/
|
|
19
|
+
phone?: string;
|
|
20
|
+
metadata?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* `null` EFFACE le champ, l'omettre le laisse inchangé.
|
|
24
|
+
*
|
|
25
|
+
* `undefined` et `null` disent donc deux choses différentes, et le SDK
|
|
26
|
+
* ne les confond pas : `JSON.stringify` retire les `undefined` du corps,
|
|
27
|
+
* et garde les `null`. Une chaîne vide, elle, est refusée par l'API.
|
|
28
|
+
*/
|
|
29
|
+
export interface UpdateCustomerParams {
|
|
30
|
+
email?: string | null;
|
|
31
|
+
name?: string | null;
|
|
32
|
+
phone?: string | null;
|
|
33
|
+
metadata?: Record<string, string | null> | null;
|
|
34
|
+
}
|
|
35
|
+
export interface ListCustomersParams extends ListParams {
|
|
36
|
+
/**
|
|
37
|
+
* Ne rend que les clients portant cette adresse, comparée sans tenir
|
|
38
|
+
* compte de la casse.
|
|
39
|
+
*
|
|
40
|
+
* Tupay n'impose aucune unicité sur l'email — un couple partage une
|
|
41
|
+
* boîte, une entreprise a un `contact@`. Ce filtre rend donc une
|
|
42
|
+
* collection, pas un objet.
|
|
43
|
+
*/
|
|
44
|
+
email?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Le carnet d'adresses du marchand.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* const client = await tupay.customers.create({
|
|
51
|
+
* email: 'teiva@exemple.pf',
|
|
52
|
+
* name: 'Teiva Tehei',
|
|
53
|
+
* })
|
|
54
|
+
*/
|
|
55
|
+
export declare class Customers {
|
|
56
|
+
private readonly client;
|
|
57
|
+
constructor(client: TupayClient);
|
|
58
|
+
create(params?: CreateCustomerParams): Promise<Customer>;
|
|
59
|
+
/**
|
|
60
|
+
* Rend aussi les clients supprimés, qui portent alors `deleted: true`.
|
|
61
|
+
* Vos paiements passés les désignent : une fiche introuvable rendrait
|
|
62
|
+
* votre historique illisible.
|
|
63
|
+
*/
|
|
64
|
+
retrieve(id: string): Promise<Customer>;
|
|
65
|
+
/** Les clients supprimés ne figurent pas dans la liste. */
|
|
66
|
+
list(params?: ListCustomersParams): Promise<ListResult<Customer>>;
|
|
67
|
+
update(id: string, params: UpdateCustomerParams): Promise<Customer>;
|
|
68
|
+
/**
|
|
69
|
+
* Marque la fiche supprimée **sans rien effacer**. Elle quitte la
|
|
70
|
+
* liste et refuse toute modification, mais reste lisible.
|
|
71
|
+
*
|
|
72
|
+
* `del` et non `delete` : `delete` est un mot réservé de JavaScript.
|
|
73
|
+
* Même contrainte que `webhookEndpoints.del`.
|
|
74
|
+
*
|
|
75
|
+
* Rejouable : un second appel rend le même objet, avec la même date de
|
|
76
|
+
* suppression.
|
|
77
|
+
*/
|
|
78
|
+
del(id: string): Promise<Customer>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=customers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../../src/resources/customers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;CAChD;AAED,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;GAQG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,MAAM,CAAC,MAAM,GAAE,oBAAyB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAWlE;;;;OAIG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAQ7C,2DAA2D;IACrD,IAAI,CAAC,MAAM,GAAE,mBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAUrE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC;IASzE;;;;;;;;;OASG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAOzC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { TupayClient } from '../client.js';
|
|
2
|
+
import { normaliserListe, parametresListe, } from '../liste.js';
|
|
3
|
+
/**
|
|
4
|
+
* Le carnet d'adresses du marchand.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const client = await tupay.customers.create({
|
|
8
|
+
* email: 'teiva@exemple.pf',
|
|
9
|
+
* name: 'Teiva Tehei',
|
|
10
|
+
* })
|
|
11
|
+
*/
|
|
12
|
+
export class Customers {
|
|
13
|
+
client;
|
|
14
|
+
constructor(client) {
|
|
15
|
+
this.client = client;
|
|
16
|
+
}
|
|
17
|
+
async create(params = {}) {
|
|
18
|
+
const { idempotencyKey, ...body } = params;
|
|
19
|
+
const { data } = await this.client.request({
|
|
20
|
+
method: 'POST',
|
|
21
|
+
path: '/customers',
|
|
22
|
+
body,
|
|
23
|
+
idempotencyKey: idempotencyKey ?? TupayClient.idempotencyKey(),
|
|
24
|
+
});
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Rend aussi les clients supprimés, qui portent alors `deleted: true`.
|
|
29
|
+
* Vos paiements passés les désignent : une fiche introuvable rendrait
|
|
30
|
+
* votre historique illisible.
|
|
31
|
+
*/
|
|
32
|
+
async retrieve(id) {
|
|
33
|
+
const { data } = await this.client.request({
|
|
34
|
+
method: 'GET',
|
|
35
|
+
path: `/customers/${encodeURIComponent(id)}`,
|
|
36
|
+
});
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
/** Les clients supprimés ne figurent pas dans la liste. */
|
|
40
|
+
async list(params = {}) {
|
|
41
|
+
return normaliserListe(await this.client.request({
|
|
42
|
+
method: 'GET',
|
|
43
|
+
path: '/customers',
|
|
44
|
+
query: { ...parametresListe(params), email: params.email },
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
async update(id, params) {
|
|
48
|
+
const { data } = await this.client.request({
|
|
49
|
+
method: 'PATCH',
|
|
50
|
+
path: `/customers/${encodeURIComponent(id)}`,
|
|
51
|
+
body: params,
|
|
52
|
+
});
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Marque la fiche supprimée **sans rien effacer**. Elle quitte la
|
|
57
|
+
* liste et refuse toute modification, mais reste lisible.
|
|
58
|
+
*
|
|
59
|
+
* `del` et non `delete` : `delete` est un mot réservé de JavaScript.
|
|
60
|
+
* Même contrainte que `webhookEndpoints.del`.
|
|
61
|
+
*
|
|
62
|
+
* Rejouable : un second appel rend le même objet, avec la même date de
|
|
63
|
+
* suppression.
|
|
64
|
+
*/
|
|
65
|
+
async del(id) {
|
|
66
|
+
const { data } = await this.client.request({
|
|
67
|
+
method: 'DELETE',
|
|
68
|
+
path: `/customers/${encodeURIComponent(id)}`,
|
|
69
|
+
});
|
|
70
|
+
return data;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=customers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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K,CAAC,MAAM,CAAC,EAAU,EAAE,MAA4B;QACnD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAqB;YAC7D,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,cAAc,kBAAkB,CAAC,EAAE,CAAC,EAAE;YAC5C,IAAI,EAAE,MAAM;SACb,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAqB;YAC7D,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,cAAc,kBAAkB,CAAC,EAAE,CAAC,EAAE;SAC7C,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -12,6 +12,33 @@ export interface CreatePaymentIntentParams {
|
|
|
12
12
|
*/
|
|
13
13
|
merchantId?: string;
|
|
14
14
|
paymentLinkId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Client à rattacher — `<uuid>` ou `cus_<uuid>`.
|
|
17
|
+
*
|
|
18
|
+
* Un identifiant inconnu, ou d'un autre marchand, lève une
|
|
19
|
+
* `TupayNotFoundError` **avant tout appel au prestataire** : aucune
|
|
20
|
+
* intention n'est ouverte chez lui, rien n'est à annuler.
|
|
21
|
+
*/
|
|
22
|
+
customer?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Carte enregistrée à débiter — `<uuid>` ou `pm_<uuid>`.
|
|
25
|
+
*
|
|
26
|
+
* **Exige `customer`** : sans lui, rien ne permet de vérifier que la
|
|
27
|
+
* carte appartient bien à ce client.
|
|
28
|
+
*
|
|
29
|
+
* Le débit est tenté dans CE MÊME appel : la promesse rend un
|
|
30
|
+
* `PaymentIntent` de statut `succeeded`, ou lève une
|
|
31
|
+
* `TupayPaymentDeclinedError` si la banque refuse.
|
|
32
|
+
*/
|
|
33
|
+
paymentMethod?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Le porteur n'est pas devant son écran (abonnement, relance).
|
|
36
|
+
*
|
|
37
|
+
* ⚠️ Hors session, une authentification forte ne peut pas aboutir :
|
|
38
|
+
* la banque rend alors `failureCode: 'authentication_required'`.
|
|
39
|
+
* **Ce n'est pas un refus** — ramenez le porteur devant son écran.
|
|
40
|
+
*/
|
|
41
|
+
offSession?: boolean;
|
|
15
42
|
metadata?: Record<string, string>;
|
|
16
43
|
/**
|
|
17
44
|
* Clé d'idempotence. Omise, le SDK en génère une (UUID v4) : la requête
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-intents.d.ts","sourceRoot":"","sources":["../../../src/resources/payment-intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,MAAM,WAAW,yBAAyB;IACxC,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,MAAM,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC;CAUxE"}
|
|
1
|
+
{"version":3,"file":"payment-intents.d.ts","sourceRoot":"","sources":["../../../src/resources/payment-intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,MAAM,WAAW,yBAAyB;IACxC,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,MAAM,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC;CAUxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-intents.js","sourceRoot":"","sources":["../../../src/resources/payment-intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"payment-intents.js","sourceRoot":"","sources":["../../../src/resources/payment-intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAoD1C,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,MAAM,CAAC,MAAiC;QAC5C,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAA;QAC1C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA0B;YAClE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB;YACxB,IAAI;YACJ,cAAc,EAAE,cAAc,IAAI,WAAW,CAAC,cAAc,EAAE;SAC/D,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
import { TupayClient } from '../client.js';
|
|
2
2
|
import type { ListResult, PaymentLink } from '../types.js';
|
|
3
3
|
import { type ListParams } from '../liste.js';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Un lien porte **soit** un tarif, **soit** un montant libre.
|
|
6
|
+
*
|
|
7
|
+
* Les deux formes sont distinctes au niveau du TYPE : passer les deux, ou
|
|
8
|
+
* aucun, ne compile pas. L'API le refuse aussi — mais un SDK qui laisse
|
|
9
|
+
* écrire la requête fautive fait découvrir l'erreur à l'exécution.
|
|
10
|
+
*/
|
|
11
|
+
export type CreatePaymentLinkParams = CreatePaymentLinkAvecTarif | CreatePaymentLinkMontantLibre;
|
|
12
|
+
interface CreatePaymentLinkCommun {
|
|
5
13
|
/**
|
|
6
14
|
* Clé d'idempotence. Omise, le SDK en génère une (UUID v4) : la
|
|
7
15
|
* requête devient rejouable, et une reprise ne crée pas un second lien.
|
|
8
16
|
*/
|
|
9
17
|
idempotencyKey?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CreatePaymentLinkAvecTarif extends CreatePaymentLinkCommun {
|
|
20
|
+
/**
|
|
21
|
+
* Tarif dont le lien hérite montant et libellé.
|
|
22
|
+
*
|
|
23
|
+
* Le libellé vient du `nickname` du tarif, ou à défaut du nom de
|
|
24
|
+
* l'article. Un tarif désactivé lève une `TupayConflictError` : il ne
|
|
25
|
+
* sert plus à créer de nouveaux liens, mais ceux qui le référencent
|
|
26
|
+
* déjà continuent de fonctionner.
|
|
27
|
+
*/
|
|
28
|
+
price: string;
|
|
29
|
+
amountXpf?: never;
|
|
30
|
+
description?: never;
|
|
31
|
+
}
|
|
32
|
+
export interface CreatePaymentLinkMontantLibre extends CreatePaymentLinkCommun {
|
|
33
|
+
price?: never;
|
|
10
34
|
/** Entier XPF, entre 100 et 10 000 000. Le XPF n'a pas de centimes. */
|
|
11
35
|
amountXpf: number;
|
|
12
36
|
description: string;
|
|
@@ -45,4 +69,5 @@ export declare class PaymentLinks {
|
|
|
45
69
|
deactivate(id: string): Promise<PaymentLink>;
|
|
46
70
|
activate(id: string): Promise<PaymentLink>;
|
|
47
71
|
}
|
|
72
|
+
export {};
|
|
48
73
|
//# sourceMappingURL=payment-links.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-links.d.ts","sourceRoot":"","sources":["../../../src/resources/payment-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,aAAa,CAAA;AAEpB,MAAM,
|
|
1
|
+
{"version":3,"file":"payment-links.d.ts","sourceRoot":"","sources":["../../../src/resources/payment-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,aAAa,CAAA;AAEpB;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAC/B,0BAA0B,GAC1B,6BAA6B,CAAA;AAEjC,UAAU,uBAAuB;IAC/B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,0BAA2B,SAAQ,uBAAuB;IACzE;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,WAAW,CAAC,EAAE,KAAK,CAAA;CACpB;AAED,MAAM,WAAW,6BAA8B,SAAQ,uBAAuB;IAC5E,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC;AAED,qBAAa,YAAY;;IACX,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC;IAW7D,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAQ1C,IAAI,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAUrE,yEAAyE;IACnE,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAI5C,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAYjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-links.js","sourceRoot":"","sources":["../../../src/resources/payment-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,EACL,eAAe,EACf,eAAe,GAGhB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"payment-links.js","sourceRoot":"","sources":["../../../src/resources/payment-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,EACL,eAAe,EACf,eAAe,GAGhB,MAAM,aAAa,CAAA;AAqDpB,MAAM,OAAO,YAAY;IACM;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD;;;;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