@compassdigital/sdk.typescript 4.658.0 → 4.660.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/src/index.ts CHANGED
@@ -3,8 +3,14 @@
3
3
  import {
4
4
  PostPaymentTransactionBody,
5
5
  PostPaymentTransactionResponse,
6
+ PostPaymentTransactionAuthBody,
7
+ PostPaymentTransactionAuthResponse,
6
8
  PostPaymentTransactionRefundBody,
7
9
  PostPaymentTransactionRefundResponse,
10
+ PostPaymentTransactionCaptureBody,
11
+ PostPaymentTransactionCaptureResponse,
12
+ PostPaymentTransactionVoidBody,
13
+ PostPaymentTransactionVoidResponse,
8
14
  GetPaymentClienttokenQuery,
9
15
  GetPaymentClienttokenResponse,
10
16
  PostPaymentPaymenttokenBody,
@@ -1597,6 +1603,28 @@ export class ServiceClient extends BaseServiceClient {
1597
1603
  );
1598
1604
  }
1599
1605
 
1606
+ /**
1607
+ * POST /payment/{id}/transaction/auth - This endpoint is used to only authorize a transaction. It will not charge the transaction.
1608
+ *
1609
+ * @param id - Payment ID
1610
+ * @param body
1611
+ * @param options - additional request options
1612
+ */
1613
+ post_payment_transaction_auth(
1614
+ id: string,
1615
+ body: PostPaymentTransactionAuthBody,
1616
+ options?: RequestOptions,
1617
+ ): ResponsePromise<PostPaymentTransactionAuthResponse> {
1618
+ return this.request(
1619
+ 'payment',
1620
+ '/payment/{id}/transaction/auth',
1621
+ 'POST',
1622
+ `/payment/${id}/transaction/auth`,
1623
+ body,
1624
+ options,
1625
+ );
1626
+ }
1627
+
1600
1628
  /**
1601
1629
  * POST /payment/{id}/transaction/{transaction_id}/refund
1602
1630
  *
@@ -1621,6 +1649,50 @@ export class ServiceClient extends BaseServiceClient {
1621
1649
  );
1622
1650
  }
1623
1651
 
1652
+ /**
1653
+ * POST /payment/{id}/transaction/capture - This endpoint is used to capture a transaction that has been authorized already. So there won't be second authorization.
1654
+ *
1655
+ * @param id - Payment ID
1656
+ * @param body
1657
+ * @param options - additional request options
1658
+ */
1659
+ post_payment_transaction_capture(
1660
+ id: string,
1661
+ body: PostPaymentTransactionCaptureBody,
1662
+ options?: RequestOptions,
1663
+ ): ResponsePromise<PostPaymentTransactionCaptureResponse> {
1664
+ return this.request(
1665
+ 'payment',
1666
+ '/payment/{id}/transaction/capture',
1667
+ 'POST',
1668
+ `/payment/${id}/transaction/capture`,
1669
+ body,
1670
+ options,
1671
+ );
1672
+ }
1673
+
1674
+ /**
1675
+ * POST /payment/{id}/transaction/void - This endpoint is used to void a transaction that has been authorized already.So user's auth will be voided faster instead of waiting for the auth to expire.
1676
+ *
1677
+ * @param id - Payment ID
1678
+ * @param body
1679
+ * @param options - additional request options
1680
+ */
1681
+ post_payment_transaction_void(
1682
+ id: string,
1683
+ body: PostPaymentTransactionVoidBody,
1684
+ options?: RequestOptions,
1685
+ ): ResponsePromise<PostPaymentTransactionVoidResponse> {
1686
+ return this.request(
1687
+ 'payment',
1688
+ '/payment/{id}/transaction/void',
1689
+ 'POST',
1690
+ `/payment/${id}/transaction/void`,
1691
+ body,
1692
+ options,
1693
+ );
1694
+ }
1695
+
1624
1696
  /**
1625
1697
  * GET /payment/{id}/clienttoken
1626
1698
  *
@@ -2285,6 +2285,8 @@ export interface GetMenuItemNutrientConsumerV2 {
2285
2285
  key: string;
2286
2286
  // Indent level for FDA label layout (0 = primary, 1 = sub-nutrient, 2 = sub-sub-nutrient)
2287
2287
  indent: number;
2288
+ // Numeric amount
2289
+ amount?: number;
2288
2290
  // Unit of measurement
2289
2291
  unit?: string;
2290
2292
  // Formatted display value (e.g. "8 g")
@@ -267,6 +267,46 @@ export interface PostPaymentTransactionRequest extends BaseRequest, PostPaymentT
267
267
  body: PostPaymentTransactionBody;
268
268
  }
269
269
 
270
+ // POST /payment/{id}/transaction/auth - This endpoint is used to only authorize a transaction. It will not charge the transaction.
271
+
272
+ export interface PostPaymentTransactionAuthPath {
273
+ // Payment ID
274
+ id: string;
275
+ }
276
+
277
+ export interface PostPaymentTransactionAuthBody {
278
+ // The payment method token to use for the payment
279
+ payment_method_token?: string;
280
+ // The amount to charge to the payment method
281
+ amount: string;
282
+ options?: Options;
283
+ // The braintree merchant account id to use
284
+ merchant_account_id?: string;
285
+ digital_wallet_token?: string;
286
+ account_number?: string;
287
+ cv_number?: string;
288
+ expiration_month?: number;
289
+ expiration_year?: number;
290
+ cart_items?: {
291
+ id?: string;
292
+ label?: {
293
+ en?: string;
294
+ };
295
+ price?: {
296
+ amount?: number;
297
+ };
298
+ quantity?: number;
299
+ }[];
300
+ }
301
+
302
+ export type PostPaymentTransactionAuthResponse = Transaction;
303
+
304
+ export interface PostPaymentTransactionAuthRequest
305
+ extends BaseRequest,
306
+ PostPaymentTransactionAuthPath {
307
+ body: PostPaymentTransactionAuthBody;
308
+ }
309
+
270
310
  // POST /payment/{id}/transaction/{transaction_id}/refund
271
311
 
272
312
  export interface PostPaymentTransactionRefundPath {
@@ -291,6 +331,66 @@ export interface PostPaymentTransactionRefundRequest
291
331
  body: PostPaymentTransactionRefundBody;
292
332
  }
293
333
 
334
+ // POST /payment/{id}/transaction/capture - This endpoint is used to capture a transaction that has been authorized already. So there won't be second authorization.
335
+
336
+ export interface PostPaymentTransactionCapturePath {
337
+ // Payment ID
338
+ id: string;
339
+ }
340
+
341
+ export interface PostPaymentTransactionCaptureBody {
342
+ // FreedomPay request ID from the original authorization
343
+ requestID: string;
344
+ // The amount to capture
345
+ amount: string;
346
+ // The payment method token from the original authorization
347
+ payment_method_token?: string;
348
+ options?: Options;
349
+ digital_wallet_token?: string;
350
+ cart_items?: {
351
+ id?: string;
352
+ label?: {
353
+ en?: string;
354
+ };
355
+ price?: {
356
+ amount?: number;
357
+ };
358
+ quantity?: number;
359
+ }[];
360
+ }
361
+
362
+ export type PostPaymentTransactionCaptureResponse = Transaction;
363
+
364
+ export interface PostPaymentTransactionCaptureRequest
365
+ extends BaseRequest,
366
+ PostPaymentTransactionCapturePath {
367
+ body: PostPaymentTransactionCaptureBody;
368
+ }
369
+
370
+ // POST /payment/{id}/transaction/void - This endpoint is used to void a transaction that has been authorized already.So user's auth will be voided faster instead of waiting for the auth to expire.
371
+
372
+ export interface PostPaymentTransactionVoidPath {
373
+ // Payment ID
374
+ id: string;
375
+ }
376
+
377
+ export interface PostPaymentTransactionVoidBody {
378
+ // FreedomPay request ID from the original authorization
379
+ requestID: string;
380
+ // Brand/site ID for FreedomPay credentials
381
+ brand?: string;
382
+ // Location ID for FreedomPay credentials
383
+ location?: string;
384
+ }
385
+
386
+ export type PostPaymentTransactionVoidResponse = Transaction;
387
+
388
+ export interface PostPaymentTransactionVoidRequest
389
+ extends BaseRequest,
390
+ PostPaymentTransactionVoidPath {
391
+ body: PostPaymentTransactionVoidBody;
392
+ }
393
+
294
394
  // GET /payment/{id}/clienttoken
295
395
 
296
396
  export interface GetPaymentClienttokenPath {