@tabres/react 1.0.53 → 1.0.54

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.
@@ -21,6 +21,8 @@ export interface BranchSettings {
21
21
  serviceChargePercentage: number;
22
22
  addToOrderEnabled: boolean;
23
23
  guestOrderEnabled: boolean;
24
+ primaryPaymentMethods?: string[] | null;
25
+ secondaryPaymentMethods?: string[] | null;
24
26
  }
25
27
  export declare enum BranchSetting {
26
28
  MAX_DELIVERY_DISTANCE = "maxDeliveryDistance",
@@ -32,7 +34,9 @@ export declare enum BranchSetting {
32
34
  SERVICE_CHARGE_ENABLED = "serviceChargeEnabled",
33
35
  SERVICE_CHARGE_PERCENTAGE = "serviceChargePercentage",
34
36
  ADD_TO_ORDER_ENABLED = "addToOrderEnabled",
35
- GUEST_ORDER_ENABLED = "guestOrderEnabled"
37
+ GUEST_ORDER_ENABLED = "guestOrderEnabled",
38
+ PRIMARY_PAYMENT_METHODS = "primaryPaymentMethods",
39
+ SECONDARY_PAYMENT_METHODS = "secondaryPaymentMethods"
36
40
  }
37
41
  export interface Branch {
38
42
  id: number;
@@ -1,4 +1,8 @@
1
1
  import { GuestOrderPayload, Order, OrderPayload, SelectedAddons } from "./models";
2
+ export declare const usePaymentMethods: () => {
3
+ primary: import("./models").CustomerPaymentMethod[];
4
+ secondary: import("./models").CustomerPaymentMethod[];
5
+ };
2
6
  export declare const useOrderTotalRawPriceWithTax: () => number;
3
7
  export declare const useOrderTotalPriceWithTax: () => string;
4
8
  export declare const usePrepareOrder: (existingOrderData?: Partial<Order>) => OrderPayload;
@@ -1,5 +1,5 @@
1
1
  import { IconType } from "@sorocraft/ui";
2
- import { CalculatePreviewResponse, GuestContact, GuestContactRequest, Order, OrderAddon, OrderItem, OrderStatus, OrderType, SelectedAddons } from "./models";
2
+ import { CalculatePreviewResponse, GuestContact, GuestContactRequest, Order, OrderAddon, CustomerPaymentMethod, OrderItem, OrderStatus, OrderType, SelectedAddons } from "./models";
3
3
  import * as addonModels from "../addon/models";
4
4
  import * as branchModels from "../branch/models";
5
5
  import { OrderErrors } from "./constants";
@@ -8,6 +8,20 @@ export declare const getSelectedAddonsFromOrderItems: (item: OrderItem) => Selec
8
8
  export declare const getStatusIcon: (status: OrderStatus) => IconType;
9
9
  export declare const buildSelectedAddonsPayload: (productAddons?: addonModels.MenuAddon[], selectedAddons?: SelectedAddons) => OrderAddon[];
10
10
  export declare const getDefaultOrderType: (settings: branchModels.BranchSettings, isOpen: boolean, isDelivering: boolean) => OrderType | null;
11
+ /**
12
+ * Payment methods offered at checkout, split into the shortcuts shown up front
13
+ * and the rest folded behind the "more" disclosure.
14
+ *
15
+ * Either row can be overridden per branch. A missing or empty row means the
16
+ * venue never configured it, so it falls back to the library default instead of
17
+ * offering nothing. An unconfigured secondary row is "everything else the
18
+ * customer can settle with", which both keeps a promoted method from appearing
19
+ * twice and reproduces the stock cash/card split when neither row is set.
20
+ */
21
+ export declare const getPaymentMethods: (settings?: branchModels.BranchSettings) => {
22
+ primary: CustomerPaymentMethod[];
23
+ secondary: CustomerPaymentMethod[];
24
+ };
11
25
  export declare const isValidPreviewResponse: (data: unknown) => data is CalculatePreviewResponse;
12
26
  export declare const buildGuestContactRequest: (contact?: GuestContact) => GuestContactRequest | undefined;
13
27
  export declare const calculateTipAmount: (base: number, percentage: number) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tabres/react",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "React Library by tabres.com",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",