@viu/emporix-sdk 2.21.0 → 2.23.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/CHANGELOG.md +146 -0
- package/dist/availability.cjs +118 -0
- package/dist/availability.cjs.map +1 -1
- package/dist/availability.d.cts +178 -2
- package/dist/availability.d.ts +178 -2
- package/dist/availability.js +1 -1
- package/dist/cart.cjs +215 -9
- package/dist/cart.cjs.map +1 -1
- package/dist/cart.d.cts +281 -3
- package/dist/cart.d.ts +281 -3
- package/dist/cart.js +1 -1
- package/dist/category.cjs +220 -2
- package/dist/category.cjs.map +1 -1
- package/dist/category.d.cts +408 -1
- package/dist/category.d.ts +408 -1
- package/dist/category.js +1 -1
- package/dist/{chunk-HD5RBCM6.js → chunk-27NLS646.js} +10 -2
- package/dist/chunk-27NLS646.js.map +1 -0
- package/dist/{chunk-PYLWZZC4.js → chunk-6PJFOX3A.js} +126 -2
- package/dist/chunk-6PJFOX3A.js.map +1 -0
- package/dist/chunk-HWVFF6B2.js +378 -0
- package/dist/chunk-HWVFF6B2.js.map +1 -0
- package/dist/chunk-LQFRJSVT.js +224 -0
- package/dist/chunk-LQFRJSVT.js.map +1 -0
- package/dist/chunk-P7G4LOOV.js +264 -0
- package/dist/chunk-P7G4LOOV.js.map +1 -0
- package/dist/{chunk-HBEQEIT6.js → chunk-PRN3T6TY.js} +63 -3
- package/dist/chunk-PRN3T6TY.js.map +1 -0
- package/dist/{chunk-44F52KRE.js → chunk-QQMLN76U.js} +27 -2
- package/dist/chunk-QQMLN76U.js.map +1 -0
- package/dist/chunk-UNW6SFSB.js +363 -0
- package/dist/chunk-UNW6SFSB.js.map +1 -0
- package/dist/chunk-V3275BA7.js +181 -0
- package/dist/chunk-V3275BA7.js.map +1 -0
- package/dist/chunk-W2KBVWJ2.js +323 -0
- package/dist/chunk-W2KBVWJ2.js.map +1 -0
- package/dist/chunk-YVZ6GOLE.js +399 -0
- package/dist/chunk-YVZ6GOLE.js.map +1 -0
- package/dist/chunk-ZOFGDNSX.js +305 -0
- package/dist/chunk-ZOFGDNSX.js.map +1 -0
- package/dist/companies.cjs +25 -0
- package/dist/companies.cjs.map +1 -1
- package/dist/companies.d.cts +14 -0
- package/dist/companies.d.ts +14 -0
- package/dist/companies.js +1 -1
- package/dist/contacts.cjs +8 -0
- package/dist/contacts.cjs.map +1 -1
- package/dist/contacts.d.cts +2 -0
- package/dist/contacts.d.ts +2 -0
- package/dist/contacts.js +1 -1
- package/dist/customer-groups-BxSNFHq1.d.cts +706 -0
- package/dist/customer-groups-GlzWhDsi.d.ts +706 -0
- package/dist/customer-groups.cjs +200 -17
- package/dist/customer-groups.cjs.map +1 -1
- package/dist/customer-groups.d.cts +2 -110
- package/dist/customer-groups.d.ts +2 -110
- package/dist/customer-groups.js +1 -1
- package/dist/customer.cjs +61 -1
- package/dist/customer.cjs.map +1 -1
- package/dist/customer.d.cts +48 -1
- package/dist/customer.d.ts +48 -1
- package/dist/customer.js +1 -1
- package/dist/index.cjs +2566 -554
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +455 -12
- package/dist/index.d.ts +455 -12
- package/dist/index.js +687 -342
- package/dist/index.js.map +1 -1
- package/dist/orders.cjs +160 -2
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.d.cts +221 -1
- package/dist/orders.d.ts +221 -1
- package/dist/orders.js +1 -1
- package/dist/payment.cjs +124 -0
- package/dist/payment.cjs.map +1 -1
- package/dist/payment.d.cts +335 -1
- package/dist/payment.d.ts +335 -1
- package/dist/payment.js +1 -1
- package/dist/price.cjs +197 -0
- package/dist/price.cjs.map +1 -1
- package/dist/price.d.cts +577 -1
- package/dist/price.d.ts +577 -1
- package/dist/price.js +1 -1
- package/dist/product.cjs +190 -0
- package/dist/product.cjs.map +1 -1
- package/dist/product.d.cts +503 -1
- package/dist/product.d.ts +503 -1
- package/dist/product.js +1 -1
- package/dist/segment.cjs +179 -0
- package/dist/segment.cjs.map +1 -1
- package/dist/segment.d.cts +181 -1
- package/dist/segment.d.ts +181 -1
- package/dist/segment.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-36T4YPQJ.js +0 -106
- package/dist/chunk-36T4YPQJ.js.map +0 -1
- package/dist/chunk-3BTPX7IJ.js +0 -41
- package/dist/chunk-3BTPX7IJ.js.map +0 -1
- package/dist/chunk-44F52KRE.js.map +0 -1
- package/dist/chunk-A3LYJUD4.js +0 -108
- package/dist/chunk-A3LYJUD4.js.map +0 -1
- package/dist/chunk-FZMP5NQZ.js +0 -173
- package/dist/chunk-FZMP5NQZ.js.map +0 -1
- package/dist/chunk-HBEQEIT6.js.map +0 -1
- package/dist/chunk-HD5RBCM6.js.map +0 -1
- package/dist/chunk-HUEMYP2L.js +0 -193
- package/dist/chunk-HUEMYP2L.js.map +0 -1
- package/dist/chunk-IVCCGJN5.js +0 -63
- package/dist/chunk-IVCCGJN5.js.map +0 -1
- package/dist/chunk-NE7MIZPR.js +0 -144
- package/dist/chunk-NE7MIZPR.js.map +0 -1
- package/dist/chunk-PYLWZZC4.js.map +0 -1
- package/dist/chunk-ZNLHLFQM.js +0 -160
- package/dist/chunk-ZNLHLFQM.js.map +0 -1
package/dist/payment.d.cts
CHANGED
|
@@ -1,5 +1,94 @@
|
|
|
1
1
|
import { C as ClientContext, b as AuthContext } from './context-CfXJcYKP.cjs';
|
|
2
2
|
|
|
3
|
+
type PaymentModeRequest = {
|
|
4
|
+
/**
|
|
5
|
+
* Indicates a code of a given method.
|
|
6
|
+
*/
|
|
7
|
+
code: string;
|
|
8
|
+
/**
|
|
9
|
+
* Indicates whether a give mode is active.
|
|
10
|
+
*/
|
|
11
|
+
active?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Indicates which provider should be used.
|
|
14
|
+
*/
|
|
15
|
+
provider: Provider;
|
|
16
|
+
/**
|
|
17
|
+
* Map of configuration values for a particular gateway. Supported and required values for Spreedly:
|
|
18
|
+
* * `Spreedly/GatewayToken` - Indicates Spreedly gateway. Valid for `SPREEDLY`, `SPREEDLY_SAFERPAY`.
|
|
19
|
+
* * `Spreedly/EnvironmentKey` - Indicates Spreedly environment key. Valid for `SPREEDLY`, `SPREEDLY_SAFERPAY`.
|
|
20
|
+
* * `Spreedly/AccessSecret` - Indicates Spreedly access secret. Valid for `SPREEDLY`, `SPREEDLY_SAFERPAY`.
|
|
21
|
+
* * `Spreedly/PaymentMethodType` - Indicates payment method type, for example: paypal. Valid for `SPREEDLY`.
|
|
22
|
+
* * `Spreedly/RedirectURL` - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL. Valid for `SPREEDLY`.
|
|
23
|
+
* * `Spreedly/SignatureSecret` - Indicates a signature secret. The value is needed for an offsite flow, when a confirmation callback is used. Valid for `SPREEDLY`.
|
|
24
|
+
* * `Spreedly/SCAProviderToken` - Indicates the Spreedly SCA (Strong Customer Authentication) provider token (3DS credit cart). Valid for `SPREEDLY`.
|
|
25
|
+
* * `Spreedly/ReceiverId` - Indicates the Spreedly Receiver identifier. Valid for `SPREEDLY_SAFERPAY`.
|
|
26
|
+
* * `Saferpay/BasicAuth` - Base64 encoded username and password of Saferpay account. Valid for `SPREEDLY_SAFERPAY`.
|
|
27
|
+
* * `Saferpay/CustomerId` - Saferpay customer ID. Valid for `SPREEDLY_SAFERPAY`.
|
|
28
|
+
* * `Saferpay/TerminalId` - Saferpay terminal ID. Valid for `SPREEDLY_SAFERPAY`.
|
|
29
|
+
* * `Saferpay/TestEnvironment` - Indicates if the configuration is done for test environment or a production one. If `true` then `https://test.saferpay.com` is used as a destination. Otherwise `https://www.saferpay.com` is used. Valid for `SPREEDLY_SAFERPAY`.
|
|
30
|
+
* * `Saferpay/RedirectUrl` - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL. Valid for `SPREEDLY_SAFERPAY`.
|
|
31
|
+
* * `Unzer/PaymentMethodType` - Indicates a payment method type. Currently supported value is `PAYLATER_INVOICE`. Valid for `UNZER`.
|
|
32
|
+
* * `Unzer/PublicKey` - Indicates a Unzer public key. Valid for `UNZER`.
|
|
33
|
+
* * `Unzer/PrivateKey` - Indicates a Unzer private key. Valid for `UNZER`.
|
|
34
|
+
* * `Unzer/CustomerType` - Indicates a customer type. Currently supported value is `B2C`. Valid for `UNZER`.
|
|
35
|
+
* requestBodies: { }
|
|
36
|
+
*/
|
|
37
|
+
configuration?: {
|
|
38
|
+
[key: string]: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type PaymentMethodUpdateRequest = {
|
|
42
|
+
/**
|
|
43
|
+
* Indicates whether a give mode is active.
|
|
44
|
+
*/
|
|
45
|
+
active?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Map of configuration values for a particular gateway. Supported and required values for Spreedly:
|
|
48
|
+
* * `Spreedly/GatewayToken` - Indicates Spreedly gateway.
|
|
49
|
+
* * `Spreedly/EnvironmentKey` - Indicates Spreedly environment key.
|
|
50
|
+
* * `Spreedly/AccessSecret` - Indicates Spreedly access secret.
|
|
51
|
+
* * `Spreedly/PaymentMethodType` - Indicates payment method type, for example: paypal.
|
|
52
|
+
* * `Spreedly/RedirectURL` - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL.
|
|
53
|
+
* * `Spreedly/SignatureSecret` - Indicates a signature secret. The value is needed for an offsite flow, when a confirmation callback is used.
|
|
54
|
+
* * `Spreedly/SCAProviderToken` - Indicates the Spreedly SCA (Strong Customer Authentication) provider token (3DS credit cart).
|
|
55
|
+
* requestBodies: { }
|
|
56
|
+
*/
|
|
57
|
+
configuration?: {
|
|
58
|
+
[key: string]: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
type Provider = 'INVOICE' | 'CASH_ON_DELIVERY' | 'SPREEDLY' | 'SPREEDLY_SAFERPAY' | 'UNZER';
|
|
62
|
+
type PaymentModeResponse = {
|
|
63
|
+
/**
|
|
64
|
+
* Indicates an autogenerated identifier of a given payment method.
|
|
65
|
+
*/
|
|
66
|
+
id?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Indicates a code of a given method.
|
|
69
|
+
*/
|
|
70
|
+
code?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Indicates whether a give mode is active.
|
|
73
|
+
*/
|
|
74
|
+
active?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Indicates which provider should be used.
|
|
77
|
+
*/
|
|
78
|
+
provider?: Provider;
|
|
79
|
+
/**
|
|
80
|
+
* Map of configuration values for a particular gateway. Supported and required values for Spreedly:
|
|
81
|
+
* * `Spreedly/GatewayToken` - Indicates Spreedly gateway.
|
|
82
|
+
* * `Spreedly/EnvironmentKey` - Indicates Spreedly environment key.
|
|
83
|
+
* * `Spreedly/AccessSecret` - Indicates Spreedly access secret.
|
|
84
|
+
* * `Spreedly/PaymentMethodType` - Indicates payment method type, for example: paypal.
|
|
85
|
+
* * `Spreedly/RedirectURL` - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL.
|
|
86
|
+
* * `Spreedly/SignatureSecret` - Indicates a signature secret. The value is needed for an offsite flow, when a confirmation callback is used.
|
|
87
|
+
*/
|
|
88
|
+
configuration?: {
|
|
89
|
+
[key: string]: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
3
92
|
type PaymentModeFrontendResponse = {
|
|
4
93
|
/**
|
|
5
94
|
* Indicates an autogenerated identifier of a given payment method.
|
|
@@ -82,11 +171,176 @@ type AuthorizePaymentRequest = AuthorizeFrontendPaymentRequest & {
|
|
|
82
171
|
*/
|
|
83
172
|
currency?: string;
|
|
84
173
|
};
|
|
174
|
+
type InitializePaymentResponse = {
|
|
175
|
+
/**
|
|
176
|
+
* Indicates if the authorization process finished with success.
|
|
177
|
+
*/
|
|
178
|
+
successful?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Unique payment transaction identifier.
|
|
181
|
+
*/
|
|
182
|
+
paymentTransactionId?: string;
|
|
183
|
+
/**
|
|
184
|
+
* Authorization token
|
|
185
|
+
*/
|
|
186
|
+
authorizationToken?: string;
|
|
187
|
+
/**
|
|
188
|
+
* Indicates a URL address where a user should be redirected in order to finish the authorization process.
|
|
189
|
+
*/
|
|
190
|
+
externalPaymentRedirectURL?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Indicates a HTTP Method which should be used in order to finish the authorization process.
|
|
193
|
+
*/
|
|
194
|
+
externalPaymentHttpMethod?: string;
|
|
195
|
+
/**
|
|
196
|
+
* Map of additional parameters that may be needed in order to complete the authorization flow.
|
|
197
|
+
*/
|
|
198
|
+
externalPaymentParameters?: {
|
|
199
|
+
[key: string]: string;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
type AuthorizePaymentResponse = InitializePaymentResponse & {
|
|
203
|
+
/**
|
|
204
|
+
* Indicates if a redirect to an external site is required in order to finish the authorization flow.
|
|
205
|
+
*/
|
|
206
|
+
requiresExternalPayment?: boolean;
|
|
207
|
+
};
|
|
208
|
+
type CaptureRequest = {
|
|
209
|
+
/**
|
|
210
|
+
* Amount that should be captured. The amount should not be greater than amount that was authorized.
|
|
211
|
+
*/
|
|
212
|
+
amount?: number;
|
|
213
|
+
/**
|
|
214
|
+
* Currency for the amount that should be captured.
|
|
215
|
+
*/
|
|
216
|
+
currency?: string;
|
|
217
|
+
};
|
|
218
|
+
type CommonPaymentResponse = {
|
|
219
|
+
/**
|
|
220
|
+
* Indicates if the operation finished with success or not.
|
|
221
|
+
*/
|
|
222
|
+
successful?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* In case of failed operation, the field provides error details.
|
|
225
|
+
*/
|
|
226
|
+
message?: string;
|
|
227
|
+
};
|
|
228
|
+
type RefundRequest = {
|
|
229
|
+
/**
|
|
230
|
+
* Amount that should be refunded. The amount should not be greater than amount that was captured.
|
|
231
|
+
*/
|
|
232
|
+
amount?: number;
|
|
233
|
+
/**
|
|
234
|
+
* Currency for the amount that should be refunded.
|
|
235
|
+
*/
|
|
236
|
+
currency?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Capture identifier. The value is mandatory only if there were more captures for a payment and the refund should be related to a specific capture. In another case the value can be skipped and the capture related to the payment will be chosen automatically.
|
|
239
|
+
*/
|
|
240
|
+
captureId?: string;
|
|
241
|
+
};
|
|
242
|
+
type PaymentTransactionResponse = {
|
|
243
|
+
/**
|
|
244
|
+
* A unique identifier of a payment transaction.
|
|
245
|
+
*/
|
|
246
|
+
id?: string;
|
|
247
|
+
provider?: Provider;
|
|
248
|
+
/**
|
|
249
|
+
* Information related to a payment mode.
|
|
250
|
+
*/
|
|
251
|
+
paymentInformation?: {
|
|
252
|
+
/**
|
|
253
|
+
* A unique identifier of a payment mode configured for the tenant.
|
|
254
|
+
*/
|
|
255
|
+
paymentMode?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Token of the credit card.
|
|
258
|
+
*/
|
|
259
|
+
creditCardToken?: string;
|
|
260
|
+
/**
|
|
261
|
+
* Name of the card holder.
|
|
262
|
+
*/
|
|
263
|
+
cardHolderName?: string;
|
|
264
|
+
/**
|
|
265
|
+
* URL for pay-by-link payment flow.
|
|
266
|
+
*/
|
|
267
|
+
payByLinkURL?: string;
|
|
268
|
+
/**
|
|
269
|
+
* International Bank Account Number.
|
|
270
|
+
*/
|
|
271
|
+
iban?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Bank Identifier Code (SWIFT).
|
|
274
|
+
*/
|
|
275
|
+
bic?: string;
|
|
276
|
+
/**
|
|
277
|
+
* SEPA mandate reference.
|
|
278
|
+
*/
|
|
279
|
+
sepaMandateReference?: string;
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* List of transaction entries representing payment events.
|
|
283
|
+
*/
|
|
284
|
+
entries?: Array<{
|
|
285
|
+
/**
|
|
286
|
+
* Unique identifier of a payment transaction entry.
|
|
287
|
+
*/
|
|
288
|
+
id?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Timestamp when the event happened.
|
|
291
|
+
*/
|
|
292
|
+
createdDate?: string;
|
|
293
|
+
/**
|
|
294
|
+
* Event type.
|
|
295
|
+
*/
|
|
296
|
+
type?: 'INITIALIZATION' | 'AUTHORIZATION' | 'CAPTURE' | 'REFUND' | 'CANCEL' | 'AUTHORIZATION_START' | 'AUTHORIZATION_CALLBACK';
|
|
297
|
+
/**
|
|
298
|
+
* Indicates if the event completed successfully.
|
|
299
|
+
*/
|
|
300
|
+
successful?: boolean;
|
|
301
|
+
amount?: {
|
|
302
|
+
/**
|
|
303
|
+
* Amount related to the event.
|
|
304
|
+
*/
|
|
305
|
+
amount?: number;
|
|
306
|
+
/**
|
|
307
|
+
* ISO currency code.
|
|
308
|
+
*/
|
|
309
|
+
currency?: string;
|
|
310
|
+
};
|
|
311
|
+
/**
|
|
312
|
+
* Summary of the event.
|
|
313
|
+
*/
|
|
314
|
+
summary?: string;
|
|
315
|
+
/**
|
|
316
|
+
* Serialized request body sent to payment provider.
|
|
317
|
+
*/
|
|
318
|
+
remoteRequest?: string;
|
|
319
|
+
/**
|
|
320
|
+
* Serialized response body from payment provider.
|
|
321
|
+
*/
|
|
322
|
+
remoteResponse?: string;
|
|
323
|
+
/**
|
|
324
|
+
* Remote token returned by payment provider.
|
|
325
|
+
*/
|
|
326
|
+
remoteToken?: string;
|
|
327
|
+
/**
|
|
328
|
+
* Additional info about the transaction.
|
|
329
|
+
*/
|
|
330
|
+
additionalInfo?: {
|
|
331
|
+
[key: string]: unknown;
|
|
332
|
+
};
|
|
333
|
+
}>;
|
|
334
|
+
};
|
|
85
335
|
|
|
86
336
|
/** A frontend payment mode (generated). */
|
|
87
337
|
type PaymentMode = PaymentModeFrontendResponse;
|
|
88
338
|
/** Post-checkout authorize request (generated; caller sends the exact wire shape). */
|
|
89
339
|
type AuthorizePaymentInput = AuthorizePaymentRequest;
|
|
340
|
+
/** Frontend payment-initialize request (generated). */
|
|
341
|
+
type InitializePaymentInput = InitializePaymentRequest;
|
|
342
|
+
/** Frontend payment-initialize response (generated). */
|
|
343
|
+
type InitializePaymentResult = InitializePaymentResponse;
|
|
90
344
|
/** Post-checkout authorize result. */
|
|
91
345
|
interface AuthorizePaymentResult {
|
|
92
346
|
successful: boolean;
|
|
@@ -97,6 +351,31 @@ interface AuthorizePaymentResult {
|
|
|
97
351
|
externalPaymentHttpMethod?: string;
|
|
98
352
|
[k: string]: unknown;
|
|
99
353
|
}
|
|
354
|
+
/** A configured payment mode (admin view, `/paymentmodes/config`). */
|
|
355
|
+
type PaymentModeConfig = PaymentModeResponse;
|
|
356
|
+
/** Body for creating a payment-mode configuration. */
|
|
357
|
+
type PaymentModeCreateInput = PaymentModeRequest;
|
|
358
|
+
/** Body for updating a payment-mode configuration. */
|
|
359
|
+
type PaymentModeUpdateInput = PaymentMethodUpdateRequest;
|
|
360
|
+
/** A payment transaction (generated). */
|
|
361
|
+
type PaymentTransaction = PaymentTransactionResponse;
|
|
362
|
+
/** Result of a backend payment authorization. */
|
|
363
|
+
type PaymentAuthorizeResult = AuthorizePaymentResponse;
|
|
364
|
+
/** Body for capturing an authorized payment. */
|
|
365
|
+
type PaymentCaptureInput = CaptureRequest;
|
|
366
|
+
/** Body for refunding a captured payment. */
|
|
367
|
+
type PaymentRefundInput = RefundRequest;
|
|
368
|
+
/**
|
|
369
|
+
* Result of a refund/cancel operation. Business failures are reported in the
|
|
370
|
+
* body (`successful: false` + `message`), not via HTTP status.
|
|
371
|
+
*/
|
|
372
|
+
type PaymentActionResult = CommonPaymentResponse;
|
|
373
|
+
/** Result of a capture — like {@link PaymentActionResult} plus the provider's capture id. */
|
|
374
|
+
type PaymentCaptureResult = {
|
|
375
|
+
successful?: boolean;
|
|
376
|
+
message?: string;
|
|
377
|
+
captureId?: string;
|
|
378
|
+
};
|
|
100
379
|
/** Payment-Gateway: list frontend payment modes, authorize deferred payments. */
|
|
101
380
|
declare class PaymentGatewayService {
|
|
102
381
|
private readonly ctx;
|
|
@@ -110,6 +389,61 @@ declare class PaymentGatewayService {
|
|
|
110
389
|
listPaymentModes(authCtx?: AuthContext): Promise<PaymentMode[]>;
|
|
111
390
|
/** Authorizes a post-checkout (deferred) payment for an existing order. */
|
|
112
391
|
authorize(input: AuthorizePaymentInput, authCtx?: AuthContext): Promise<AuthorizePaymentResult>;
|
|
392
|
+
/** Retrieves a single frontend payment mode by id. Defaults to anonymous (no scope required). */
|
|
393
|
+
getMode(id: string, authCtx?: AuthContext): Promise<PaymentMode>;
|
|
394
|
+
/** Initializes a payment from the frontend. Defaults to anonymous (no scope required). */
|
|
395
|
+
initialize(input: InitializePaymentInput, authCtx?: AuthContext): Promise<InitializePaymentResult>;
|
|
396
|
+
/**
|
|
397
|
+
* Payment-mode **configuration** (`/paymentmodes/config`) — the admin view.
|
|
398
|
+
* For the storefront view use {@link listPaymentModes} / {@link getMode}.
|
|
399
|
+
* Defaults to service auth.
|
|
400
|
+
*/
|
|
401
|
+
readonly modes: {
|
|
402
|
+
/** Lists all configured payment modes. The endpoint takes no query parameters. */
|
|
403
|
+
list: (authCtx?: AuthContext) => Promise<PaymentModeConfig[]>;
|
|
404
|
+
/** Retrieves one payment-mode configuration by id. */
|
|
405
|
+
get: (id: string, authCtx?: AuthContext) => Promise<PaymentModeConfig>;
|
|
406
|
+
/** Creates a payment-mode configuration. Responds 200 with the created mode. */
|
|
407
|
+
create: (input: PaymentModeCreateInput, authCtx?: AuthContext) => Promise<PaymentModeConfig>;
|
|
408
|
+
/** Updates a payment-mode configuration (PUT). Responds 200 with the updated mode. */
|
|
409
|
+
update: (id: string, input: PaymentModeUpdateInput, authCtx?: AuthContext) => Promise<PaymentModeConfig>;
|
|
410
|
+
/** Deletes a payment-mode configuration. */
|
|
411
|
+
delete: (id: string, authCtx?: AuthContext) => Promise<void>;
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* Backend transaction lifecycle and reads. `authorize` creates the transaction
|
|
415
|
+
* that `capture`/`refund`/`cancel` then act on. Business failures are reported
|
|
416
|
+
* in the response body (`successful: false`), not as HTTP errors — always check
|
|
417
|
+
* `successful`. Defaults to service auth.
|
|
418
|
+
*/
|
|
419
|
+
readonly transactions: {
|
|
420
|
+
/** One page of payment transactions. */
|
|
421
|
+
list: (params?: {
|
|
422
|
+
pageNumber?: number;
|
|
423
|
+
pageSize?: number;
|
|
424
|
+
sort?: string;
|
|
425
|
+
}, authCtx?: AuthContext) => Promise<PaymentTransaction[]>;
|
|
426
|
+
/** Retrieves one payment transaction by id. */
|
|
427
|
+
get: (transactionId: string, authCtx?: AuthContext) => Promise<PaymentTransaction>;
|
|
428
|
+
/**
|
|
429
|
+
* Authorizes a payment as a backend caller (`POST /payment/authorize`). The
|
|
430
|
+
* storefront equivalent is {@link PaymentGatewayService.authorize}, which
|
|
431
|
+
* targets `/payment/frontend/authorize` with a customer token.
|
|
432
|
+
*/
|
|
433
|
+
authorize: (input: AuthorizePaymentInput, authCtx?: AuthContext) => Promise<PaymentAuthorizeResult>;
|
|
434
|
+
/**
|
|
435
|
+
* Captures an authorized payment. Omit `input` to capture the full
|
|
436
|
+
* authorized amount. Returns the provider's `captureId` on success.
|
|
437
|
+
*/
|
|
438
|
+
capture: (transactionId: string, input?: PaymentCaptureInput, authCtx?: AuthContext) => Promise<PaymentCaptureResult>;
|
|
439
|
+
/**
|
|
440
|
+
* Refunds a captured payment. Omit `input` to refund the full captured
|
|
441
|
+
* amount; pass `captureId` when several captures exist for the payment.
|
|
442
|
+
*/
|
|
443
|
+
refund: (transactionId: string, input?: PaymentRefundInput, authCtx?: AuthContext) => Promise<PaymentActionResult>;
|
|
444
|
+
/** Cancels an authorized payment. Takes no body. */
|
|
445
|
+
cancel: (transactionId: string, authCtx?: AuthContext) => Promise<PaymentActionResult>;
|
|
446
|
+
};
|
|
113
447
|
}
|
|
114
448
|
|
|
115
|
-
export { type AuthorizePaymentInput, type AuthorizePaymentResult, PaymentGatewayService, type PaymentMode };
|
|
449
|
+
export { type AuthorizePaymentInput, type AuthorizePaymentResult, type InitializePaymentInput, type InitializePaymentResult, type PaymentActionResult, type PaymentAuthorizeResult, type PaymentCaptureInput, type PaymentCaptureResult, PaymentGatewayService, type PaymentMode, type PaymentModeConfig, type PaymentModeCreateInput, type PaymentModeUpdateInput, type PaymentRefundInput, type PaymentTransaction };
|