@fire-spark/core 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +665 -33
  2. package/dist/index.js +1733 -14
  3. package/package.json +4 -2
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { AndConditions, CheckoutMode, CheckoutResolved, Condition, CustomerIdentifyInput, CustomerRegisterInput, CustomerUpdateInput, FulfillmentListInput, GroupDisplayType, KioskDeviceConfig, KioskDeviceOverrides, KioskHealthBatchInput, KioskHealthBatchResult, KioskHeartbeatInput, KioskHeartbeatResult, KioskRealtimeToken, MatchResult, MatchableRule, Menu, Menu as Menu$1, MenuLookup, MenuLookup as MenuLookup$1, ModifierControlType, ModifierGroup, OrConditions, Order as Order$1, Order as Order$2, OrderInsertInput, OrderLine, OrderListInput, OrderRedeem, OrderRedemptionStep, OrderReorderInput, OrderTotals, OrderUpdateInput, OrderValidateInput, OrderValidateOutput, PaymentIntentInput, PaymentMethod, PaymentProvider, PricingModifier, Product, Product as Product$1, Recommendation, RecurringDateCronResult, RecurringDateCronValues, RulesEngineOrderLine, RulesEngineParams, RulesEngineRuntime, Schedule, StoreGetInput, StoreListInput, StoreNearbyInput, StorefrontAvailability, StorefrontMenuScope, StorefrontMenuStreamOptions, StorefrontPaymentsListInput, Variant, VariantGroup } from "@fire-spark/types";
1
+ import { PaymentAdapter, PaymentCollectAt, PaymentContext, PaymentResult, PaymentStorage, PaymentUI } from "@fire-spark/payments";
2
+ import { AndConditions, CheckoutMode, CheckoutResolved, Condition, CustomerIdentifyInput, CustomerRegisterInput, CustomerUpdateInput, FulfillmentListInput, GroupDisplayType, KioskDeviceConfig, KioskDeviceOverrides, KioskHealthBatchInput, KioskHealthBatchResult, KioskHeartbeatInput, KioskHeartbeatResult, KioskRealtimeToken, MatchResult, MatchableRule, Menu, Menu as Menu$1, MenuLookup, MenuLookup as MenuLookup$1, MerchantPayment, ModifierControlType, ModifierGroup, OrConditions, Order as Order$1, Order as Order$2, OrderInsertInput, OrderLine, OrderListInput, OrderRecordPaymentInput, OrderRedeem, OrderRedemptionStep, OrderReorderInput, OrderTotals, OrderUpdateInput, OrderValidateInput, OrderValidateOutput, PaymentIntentInput, PaymentMethod, PaymentProvider, PosCatalog, PosHealthBatchInput, PosHealthBatchResult, PosHeartbeatInput, PosHeartbeatResult, PosKioskOrder, PosKioskSettleInput, PosKioskSettleResult, PosOrderInput, PosOrderResult, PricingModifier, Product, Product as Product$1, Recommendation, RecurringDateCronResult, RecurringDateCronValues, RulesEngineOrderLine, RulesEngineParams, RulesEngineRuntime, Schedule, SdkLogContext, SdkLogErrorInfo, SdkLogLevel, SdkLogOptions, StoreGetInput, StoreListInput, StoreNearbyInput, StorefrontAvailability, StorefrontMenuScope, StorefrontMenuStreamOptions, StorefrontPaymentsListInput, Variant, VariantGroup } from "@fire-spark/types";
2
3
  import { Big } from "big.js";
3
4
  //#region src/productCustomization/types.d.ts
4
5
  type SelectionStatus = "IDLE" | "INCOMPLETE" | "VALID" | "INVALID";
@@ -360,8 +361,9 @@ declare const listOrders: (input?: OrderListInput, options?: ServiceHttpOptions)
360
361
  };
361
362
  payment_intents: {
362
363
  id?: string | undefined;
363
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
364
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
364
+ payment_id?: string | undefined;
365
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
366
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
365
367
  collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
366
368
  status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
367
369
  totals: {
@@ -532,8 +534,9 @@ declare const createOrder: (body: OrderInsertInput, options?: ServiceHttpOptions
532
534
  };
533
535
  payment_intents: {
534
536
  id?: string | undefined;
535
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
536
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
537
+ payment_id?: string | undefined;
538
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
539
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
537
540
  collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
538
541
  status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
539
542
  totals: {
@@ -704,8 +707,9 @@ declare const getOrder: (id: string, options?: ServiceHttpOptions) => Promise<{
704
707
  };
705
708
  payment_intents: {
706
709
  id?: string | undefined;
707
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
708
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
710
+ payment_id?: string | undefined;
711
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
712
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
709
713
  collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
710
714
  status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
711
715
  totals: {
@@ -740,6 +744,7 @@ declare const getOrder: (id: string, options?: ServiceHttpOptions) => Promise<{
740
744
  }>;
741
745
  type PlaceOrderInput = {
742
746
  payment?: {
747
+ id?: string;
743
748
  type?: PaymentMethod;
744
749
  provider?: PaymentProvider;
745
750
  intents?: PaymentIntentInput[];
@@ -750,6 +755,180 @@ declare const placeOrder: (id: string, body?: PlaceOrderInput, options?: Service
750
755
  order_fulfillment_id: string;
751
756
  status: "ACCEPTED" | "EXISTS" | "IN_PROGRESS";
752
757
  }>;
758
+ /** Records (or updates by `metadata.attempt_reference`) one payment intent. */
759
+ declare const recordOrderPayment: (id: string, body: OrderRecordPaymentInput, options?: ServiceHttpOptions) => Promise<{
760
+ uid: string;
761
+ id: string;
762
+ brand_id?: string | null | undefined;
763
+ store_id: string;
764
+ channel_id: string;
765
+ customer_id: string;
766
+ fulfillment_id: string;
767
+ is_anonymous: boolean;
768
+ lines: {
769
+ type: "FEE" | "PRODUCT";
770
+ uid: string;
771
+ id: string;
772
+ parent_uid: string | null;
773
+ parent_id: string | null;
774
+ name: string;
775
+ image_url?: string | undefined;
776
+ menu_id?: string | undefined;
777
+ internal_attribution_source?: string | undefined;
778
+ internal_attribution_id?: string | undefined;
779
+ metadata: Record<string, unknown>;
780
+ bundled_items: {
781
+ id: string;
782
+ refund_price: number;
783
+ included_quantity: number;
784
+ }[];
785
+ redeem: {
786
+ reward_id: string;
787
+ quantity: number;
788
+ discount_rate?: number | undefined;
789
+ discount_amount?: number | undefined;
790
+ expires_at?: string | undefined;
791
+ }[];
792
+ quantity: number;
793
+ tax_rate: number | null;
794
+ discount_rate: number;
795
+ unit_subtotal: number;
796
+ unit_discount: number;
797
+ unit_tax_total: number;
798
+ unit_total: number;
799
+ subtotal: number;
800
+ discount_total: number;
801
+ tax_total: number;
802
+ total: number;
803
+ unit_group_subtotal: number;
804
+ unit_group_discount: number;
805
+ unit_group_tax_total: number;
806
+ unit_group_total: number;
807
+ group_subtotal: number;
808
+ group_discount: number;
809
+ group_tax_total: number;
810
+ group_total: number;
811
+ }[];
812
+ redeem: {
813
+ reward_id: string;
814
+ quantity: number;
815
+ discount_rate?: number | undefined;
816
+ discount_amount?: number | undefined;
817
+ expires_at?: string | undefined;
818
+ }[];
819
+ redemption_steps: {
820
+ reward_id: string;
821
+ reward_quantity: number;
822
+ target: "LINE" | "ORDER";
823
+ target_id?: string | undefined;
824
+ action: "CREATE" | "DELETE" | "READ" | "UPDATE";
825
+ discount_amount: number;
826
+ before: {
827
+ value: number;
828
+ quantity: number;
829
+ discount_amount: number;
830
+ discount_rate: number;
831
+ };
832
+ after: {
833
+ value: number;
834
+ quantity: number;
835
+ discount_amount: number;
836
+ discount_rate: number;
837
+ };
838
+ target_before?: {
839
+ value: number;
840
+ quantity: number;
841
+ discount_amount: number;
842
+ discount_rate: number;
843
+ } | undefined;
844
+ target_after?: {
845
+ value: number;
846
+ quantity: number;
847
+ discount_amount: number;
848
+ discount_rate: number;
849
+ } | undefined;
850
+ error?: string | undefined;
851
+ }[];
852
+ customer: {
853
+ customer_info: {
854
+ display_name: string;
855
+ first_name: string;
856
+ middle_name?: string | undefined;
857
+ last_name: string;
858
+ second_last_name?: string | undefined;
859
+ email: string;
860
+ phone: string;
861
+ gender?: "FEMALE" | "MALE" | undefined;
862
+ dob?: string | undefined;
863
+ document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
864
+ document_number?: string | undefined;
865
+ city?: string | undefined;
866
+ country?: string | undefined;
867
+ };
868
+ address_info?: {
869
+ address_line1: string;
870
+ address_line2?: string | undefined;
871
+ city?: string | undefined;
872
+ state?: string | undefined;
873
+ zip?: string | undefined;
874
+ country?: string | undefined;
875
+ reference?: string | undefined;
876
+ latitude?: number | undefined;
877
+ longitude?: number | undefined;
878
+ instructions?: string | undefined;
879
+ metadata: Record<string, unknown> | null;
880
+ } | null | undefined;
881
+ billing_info?: {
882
+ type: "BUSINESS" | "INDIVIDUAL";
883
+ legal_name: string;
884
+ address_line1: string;
885
+ address_line2?: string | undefined;
886
+ city?: string | undefined;
887
+ state?: string | undefined;
888
+ zip?: string | undefined;
889
+ country?: string | undefined;
890
+ tax_id: string;
891
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
892
+ metadata: Record<string, unknown> | null;
893
+ } | null | undefined;
894
+ };
895
+ payment_intents: {
896
+ id?: string | undefined;
897
+ payment_id?: string | undefined;
898
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
899
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
900
+ collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
901
+ status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
902
+ totals: {
903
+ currency: string;
904
+ subtotal: number;
905
+ discount_rate: number;
906
+ discount_total: number;
907
+ tax_rate: number;
908
+ tax_total: number;
909
+ total: number;
910
+ };
911
+ error_message?: string | undefined;
912
+ placed_at: string;
913
+ resolved_at?: string | undefined;
914
+ metadata: Record<string, unknown>;
915
+ }[];
916
+ totals: {
917
+ currency: string;
918
+ subtotal: number;
919
+ discount_rate: number;
920
+ discount_total: number;
921
+ tax_rate: number;
922
+ tax_total: number;
923
+ total: number;
924
+ };
925
+ metadata: Record<string, unknown>;
926
+ payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
927
+ fulfillment_status: string;
928
+ status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
929
+ issued_at?: string | null | undefined;
930
+ resolved_at?: string | null | undefined;
931
+ }>;
753
932
  declare const getOrderFulfillment: (id: string, options?: ServiceHttpOptions) => Promise<{
754
933
  uid: string;
755
934
  id: string;
@@ -925,7 +1104,7 @@ declare const getOrderFulfillment: (id: string, options?: ServiceHttpOptions) =>
925
1104
  } | {
926
1105
  interpretation?: "both" | "client" | "server" | undefined;
927
1106
  primitive: "custom";
928
- type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
1107
+ type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Payment" | "Payments" | "Store" | "Stores";
929
1108
  operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
930
1109
  value: string;
931
1110
  label_ids?: string[] | undefined;
@@ -1138,7 +1317,7 @@ declare const listOrderFulfillments: (ids: string[], options?: ServiceHttpOption
1138
1317
  } | {
1139
1318
  interpretation?: "both" | "client" | "server" | undefined;
1140
1319
  primitive: "custom";
1141
- type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
1320
+ type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Payment" | "Payments" | "Store" | "Stores";
1142
1321
  operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
1143
1322
  value: string;
1144
1323
  label_ids?: string[] | undefined;
@@ -1314,8 +1493,9 @@ declare const updateOrder: (id: string, body: OrderUpdateInput, options?: Servic
1314
1493
  };
1315
1494
  payment_intents: {
1316
1495
  id?: string | undefined;
1317
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1318
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1496
+ payment_id?: string | undefined;
1497
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
1498
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
1319
1499
  collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1320
1500
  status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1321
1501
  totals: {
@@ -1486,8 +1666,9 @@ declare const cancelOrder: (id: string, options?: ServiceHttpOptions) => Promise
1486
1666
  };
1487
1667
  payment_intents: {
1488
1668
  id?: string | undefined;
1489
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1490
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1669
+ payment_id?: string | undefined;
1670
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
1671
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
1491
1672
  collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1492
1673
  status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1493
1674
  totals: {
@@ -1658,8 +1839,9 @@ declare const refundOrder: (id: string, options?: ServiceHttpOptions) => Promise
1658
1839
  };
1659
1840
  payment_intents: {
1660
1841
  id?: string | undefined;
1661
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1662
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1842
+ payment_id?: string | undefined;
1843
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
1844
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
1663
1845
  collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1664
1846
  status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1665
1847
  totals: {
@@ -1830,8 +2012,9 @@ declare const reorderOrder: (id: string, body?: OrderReorderInput, options?: Ser
1830
2012
  };
1831
2013
  payment_intents: {
1832
2014
  id?: string | undefined;
1833
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1834
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2015
+ payment_id?: string | undefined;
2016
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
2017
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
1835
2018
  collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1836
2019
  status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1837
2020
  totals: {
@@ -1866,6 +2049,56 @@ declare const reorderOrder: (id: string, body?: OrderReorderInput, options?: Ser
1866
2049
  }>;
1867
2050
  declare const validateOrder: (body: OrderValidateInput, options?: ServiceHttpOptions) => Promise<OrderValidateOutput>;
1868
2051
  //#endregion
2052
+ //#region src/order/payments/orchestrator.d.ts
2053
+ type Clock = {
2054
+ now: () => number;
2055
+ sleep: (ms: number, signal?: AbortSignal) => Promise<void>;
2056
+ };
2057
+ type PaymentRunOptions = {
2058
+ clock?: Clock;
2059
+ /** Called with every intermediate result (e.g. to record PENDING + QR). */
2060
+ onProgress?: (result: PaymentResult) => void | Promise<void>;
2061
+ };
2062
+ /**
2063
+ * One payment attempt with the policy of section 7: timeout, retries on
2064
+ * retryable errors (same `attempt_reference`), batch close and retry,
2065
+ * polling for actions and resolution of ambiguous results.
2066
+ */
2067
+ declare const runPaymentAttempt: (adapter: PaymentAdapter, ctx: PaymentContext, options?: PaymentRunOptions) => Promise<PaymentResult>;
2068
+ type ReversalOutcome = {
2069
+ kind: "cancel" | "refund" | "manual";
2070
+ result: PaymentResult;
2071
+ };
2072
+ /** Undo a charge after a failed injection or an incomplete split payment. */
2073
+ declare const reversePayment: (adapter: PaymentAdapter, ctx: PaymentContext, result: PaymentResult, options?: {
2074
+ clock?: Clock;
2075
+ now?: Date;
2076
+ }) => Promise<ReversalOutcome>;
2077
+ //#endregion
2078
+ //#region src/order/payments/session.d.ts
2079
+ type Intent = Order$1["payment_intents"][number];
2080
+ type PaymentSessionOptions = {
2081
+ /** Merchant env is production (`env_is_prod`). */
2082
+ isProduction?: boolean;
2083
+ /** Where the customer pays: `KIOSK` on a kiosk, `DEVICE` on web/app. */
2084
+ collectAt?: PaymentCollectAt;
2085
+ /** Where cash is collected: `COUNTER` on a kiosk, `DOOR` on delivery. */
2086
+ cashCollectAt?: PaymentCollectAt;
2087
+ /** `settings_overrides.payment_settings` of this device, by payment id. */
2088
+ deviceSettings?: Record<string, Record<string, unknown>>;
2089
+ /** Kiosk device id, sent with terminal failure reports. */
2090
+ deviceId?: string | null;
2091
+ };
2092
+ type PayOptions = {
2093
+ /** Amount in the order currency; defaults to the remaining amount. */
2094
+ amount?: number;
2095
+ signal?: AbortSignal;
2096
+ onProgress?: PaymentRunOptions["onProgress"];
2097
+ };
2098
+ /** PAID plus PENDING with `confirm_after_inject`, in the order currency. */
2099
+ declare const coveredAmount: (intents: Intent[]) => number;
2100
+ declare const remainingAmount: (order: Order$1) => number;
2101
+ //#endregion
1869
2102
  //#region src/order/recommendations.d.ts
1870
2103
  type RecommendationType = Recommendation["type"];
1871
2104
  declare const DEFAULT_RECOMMENDATION_TYPES: RecommendationType[];
@@ -1925,6 +2158,7 @@ declare class Order {
1925
2158
  private readonly externalNotify?;
1926
2159
  private readonly http;
1927
2160
  private readonly flush;
2161
+ private readonly payments;
1928
2162
  private constructor();
1929
2163
  /**
1930
2164
  * Opens a cart session: reuses an existing OPEN order for the scope, or a
@@ -1980,6 +2214,7 @@ declare class Order {
1980
2214
  * latest applied first. Removing more units than applied clears them all.
1981
2215
  */
1982
2216
  removeRedeem(input: RemoveRedeemInput): void;
2217
+ private rememberLogScope;
1983
2218
  setScope(scope: Partial<OrderScope>): void;
1984
2219
  /** Shallow-merges into order metadata; `null` values are kept as-is. */
1985
2220
  setMetadata(patch: Record<string, unknown>): void;
@@ -1991,6 +2226,165 @@ declare class Order {
1991
2226
  refundOrder(): Promise<void>;
1992
2227
  validateOrder(): Promise<void>;
1993
2228
  placeOrder(input?: PlaceOrderInput): Promise<void>;
2229
+ /** Installed `@fire-spark/payments-*` adapters (provider + method). */
2230
+ setPaymentAdapters(adapters: PaymentAdapter[]): void;
2231
+ /** Template modal/sheet the adapters use to talk to the customer. */
2232
+ setPaymentUI(ui: PaymentUI): void;
2233
+ /** Persistent device storage (terminal keys, last batch close). */
2234
+ setPaymentStorage(storage: PaymentStorage): void;
2235
+ /** Environment, collect point and this device's `payment_settings`. */
2236
+ setPaymentOptions(options: PaymentSessionOptions): void;
2237
+ /** Merchant payments with an adapter installed and configured here. */
2238
+ getPaymentOptions(payments: MerchantPayment[]): {
2239
+ created_at: string;
2240
+ updated_at: string;
2241
+ deleted_at: string | null;
2242
+ id: string;
2243
+ payment_provider_id: string;
2244
+ payment_method_id: string;
2245
+ rules: {
2246
+ minimum_order_value: number;
2247
+ maximum_order_value: number;
2248
+ }[];
2249
+ conditions: ({
2250
+ interpretation?: "both" | "client" | "server" | undefined;
2251
+ product_id?: string | undefined;
2252
+ tag?: string | undefined;
2253
+ fulfillment_id: string;
2254
+ store_id: string;
2255
+ channel_id: string;
2256
+ brand_id: string;
2257
+ primitive: "string";
2258
+ type: "Failure message" | "Order includes product with tag" | "Request path";
2259
+ operator: "contains" | "ends with" | "equal to" | "not equal to" | "starts with";
2260
+ caseInsensitive?: boolean | undefined;
2261
+ value: string;
2262
+ invalidMessage?: string | undefined;
2263
+ } | {
2264
+ interpretation?: "both" | "client" | "server" | undefined;
2265
+ product_id?: string | undefined;
2266
+ tag?: string | undefined;
2267
+ fulfillment_id: string;
2268
+ store_id: string;
2269
+ channel_id: string;
2270
+ brand_id: string;
2271
+ primitive: "number";
2272
+ type: "API error rate" | "Accumulated events" | "Cart product count" | "Customer age" | "HTTP status" | "Order includes product" | "Order includes product with tag";
2273
+ operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
2274
+ value: number;
2275
+ include_modifiers?: boolean | undefined;
2276
+ window_minutes?: number | undefined;
2277
+ invalidMessage?: string | undefined;
2278
+ } | {
2279
+ interpretation?: "both" | "client" | "server" | undefined;
2280
+ product_id?: string | undefined;
2281
+ tag?: string | undefined;
2282
+ fulfillment_id: string;
2283
+ store_id: string;
2284
+ channel_id: string;
2285
+ brand_id: string;
2286
+ primitive: "currency";
2287
+ type: "Order includes product with tag" | "Order total";
2288
+ operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
2289
+ value: number;
2290
+ invalidMessage?: string | undefined;
2291
+ } | {
2292
+ interpretation?: "both" | "client" | "server" | undefined;
2293
+ product_id?: string | undefined;
2294
+ tag?: string | undefined;
2295
+ fulfillment_id: string;
2296
+ store_id: string;
2297
+ channel_id: string;
2298
+ brand_id: string;
2299
+ primitive: "boolean";
2300
+ type: "Customer is anonymous" | "Is anonymous order" | "Order includes product with tag";
2301
+ operator: "is" | "is not";
2302
+ value: boolean;
2303
+ invalidMessage?: string | undefined;
2304
+ } | {
2305
+ interpretation?: "both" | "client" | "server" | undefined;
2306
+ primitive: "enum";
2307
+ type: "Payment collect at" | "Payment method" | "Payment status";
2308
+ operator: "is" | "is any of" | "is none of" | "is not";
2309
+ value: string | string[];
2310
+ invalidMessage?: string | undefined;
2311
+ } | {
2312
+ interpretation?: "both" | "client" | "server" | undefined;
2313
+ primitive: "absolute date";
2314
+ type: "Today";
2315
+ operator: "is" | "is after" | "is before" | "is not";
2316
+ value: Date;
2317
+ invalidMessage?: string | undefined;
2318
+ } | {
2319
+ interpretation?: "both" | "client" | "server" | undefined;
2320
+ primitive: "relative date";
2321
+ type: "Birthday" | "Customer last session" | "Customer last visit" | "Registration";
2322
+ operator: "occurred" | "occurred in the last" | "occurred more than";
2323
+ value: string;
2324
+ invalidMessage?: string | undefined;
2325
+ } | {
2326
+ interpretation?: "both" | "client" | "server" | undefined;
2327
+ primitive: "recurring date";
2328
+ type: "Current date";
2329
+ operator: "falls within period";
2330
+ startDate: Date;
2331
+ endDate: Date;
2332
+ allDay: boolean;
2333
+ repeat: "CUSTOM" | "DAILY" | "FORTNIGHTLY" | "LAST_DAY_OF_MONTH" | "MONTHLY" | "NONE" | "WEEKDAYS" | "WEEKENDS" | "WEEKLY" | "WEEK_OF_MONTH";
2334
+ value: string;
2335
+ invalidMessage?: string | undefined;
2336
+ } | {
2337
+ interpretation?: "both" | "client" | "server" | undefined;
2338
+ primitive: "custom";
2339
+ type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Payment" | "Payments" | "Store" | "Stores";
2340
+ operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
2341
+ value: string;
2342
+ label_ids?: string[] | undefined;
2343
+ invalidMessage?: string | undefined;
2344
+ })[][];
2345
+ status: string;
2346
+ provider: {
2347
+ id: string;
2348
+ provider_id: string;
2349
+ name: string;
2350
+ logo_url?: string | null | undefined;
2351
+ };
2352
+ method: {
2353
+ id: string;
2354
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
2355
+ name: string;
2356
+ version: string;
2357
+ config?: {
2358
+ [x: string]: unknown;
2359
+ device_fields?: {
2360
+ key: string;
2361
+ label: string;
2362
+ type: "boolean" | "number" | "password" | "select" | "text";
2363
+ required: boolean;
2364
+ secret: boolean;
2365
+ options?: string[] | undefined;
2366
+ visible_if?: Record<string, unknown> | undefined;
2367
+ }[] | undefined;
2368
+ qr_ttl_ms?: number | undefined;
2369
+ terminal_models?: string[] | undefined;
2370
+ supports_installments?: boolean | undefined;
2371
+ } | undefined;
2372
+ };
2373
+ config: Record<string, unknown>;
2374
+ has_conditions: boolean;
2375
+ }[];
2376
+ /** Device fields still missing for `payment` on this device. */
2377
+ getMissingPaymentFields(payment: MerchantPayment): import("@fire-spark/payments").DeviceField[];
2378
+ /** Order total minus PAID (and confirm-after-inject) intents. */
2379
+ getRemainingAmount(): number;
2380
+ /** Places the order if needed and charges `payment` (all or part). */
2381
+ pay(payment: MerchantPayment, options?: PayOptions): Promise<import("@fire-spark/payments").PaymentResult>;
2382
+ /** Confirms intents that waited for the order injection. */
2383
+ confirmPaymentsAfterInject(): Promise<import("@fire-spark/payments").PaymentResult[]>;
2384
+ /** Cancels or refunds every charge of this order (or flags it manual). */
2385
+ reversePayments(): Promise<ReversalOutcome[]>;
2386
+ /** Terminal admin operation (init, test, closeBatch, status, extra). */
2387
+ runPaymentTerminal(payment: MerchantPayment, key: string): Promise<import("@fire-spark/payments").TerminalResult>;
1994
2388
  /** Applies lines/redeem, replaying redemption steps and totals. */
1995
2389
  private commitLines;
1996
2390
  private scheduleAfterMutate;
@@ -2058,7 +2452,7 @@ declare const milestoneSteps: (workflow: TrackWorkflow, currentNodeIds: string[]
2058
2452
  //#endregion
2059
2453
  //#region src/order/validate.d.ts
2060
2454
  type OrderLineIssueCode = "PRODUCT_NOT_FOUND" | "HIDDEN" | "OUT_OF_STOCK" | "OUTSIDE_HOURS" | "MODIFIER_NOT_FOUND" | "MODIFIER_RULES_INVALID" | "VARIANT_BASE_NOT_ORDERABLE" | "VARIANT_NOT_OFFERED" | "PRICE_MISMATCH" | "TAX_MISMATCH" | "DISCOUNT_MISMATCH" | "QUANTITY_MISMATCH" | "QUANTITY_BELOW_MINIMUM" | "QUANTITY_ABOVE_MAXIMUM" | "STRUCTURE_MISMATCH" | "FEE_MISMATCH" | "REDEEM_EXPIRED" | "REDEMPTION_STEPS_MISMATCH";
2061
- type OrderIssueCode = "NO_MENU" | "MENU_CLOSED" | "SCOPE_INACTIVE" | "TOTALS_MISMATCH" | "REDEEM_EXPIRED" | "REDEMPTION_STEPS_MISMATCH" | "REDEMPTION_MISMATCH" | "EMPTY_ORDER" | "ITEMS_BELOW_MINIMUM" | "ITEMS_ABOVE_MAXIMUM" | "TOTAL_BELOW_MINIMUM" | "TOTAL_ABOVE_MAXIMUM" | "REDEEMS_ABOVE_MAXIMUM" | "REDEEMS_TOTAL_ABOVE_MAXIMUM" | "SHIPPING_REQUIRED" | "BILLING_REQUIRED" | "SHIPPING_FIELD_REQUIRED" | "BILLING_FIELD_REQUIRED";
2455
+ type OrderIssueCode = "NO_MENU" | "MENU_CLOSED" | "SCOPE_INACTIVE" | "TOTALS_MISMATCH" | "REDEEM_EXPIRED" | "REDEMPTION_STEPS_MISMATCH" | "REDEMPTION_MISMATCH" | "EMPTY_ORDER" | "ITEMS_BELOW_MINIMUM" | "ITEMS_ABOVE_MAXIMUM" | "TOTAL_BELOW_MINIMUM" | "TOTAL_ABOVE_MAXIMUM" | "REDEEMS_ABOVE_MAXIMUM" | "REDEEMS_TOTAL_ABOVE_MAXIMUM" | "SHIPPING_REQUIRED" | "BILLING_REQUIRED" | "SHIPPING_FIELD_REQUIRED" | "BILLING_FIELD_REQUIRED" | "DAILY_ORDER_LIMIT_REACHED";
2062
2456
  type OrderLineIssue = {
2063
2457
  code: OrderLineIssueCode;
2064
2458
  field?: string;
@@ -2172,6 +2566,11 @@ declare const recomputeTotals: (lines: OrderLine[], currency?: string) => OrderT
2172
2566
  //#endregion
2173
2567
  //#region src/order/lines.d.ts
2174
2568
  declare const addLines: (lines: OrderLine[], incoming: OrderLine | OrderLine[]) => OrderLine[];
2569
+ declare const removeLine: (lines: OrderLine[], lineUid: string) => OrderLine[];
2570
+ /** Rescale one line's money to `quantity`; zero or less drops its subtree. */
2571
+ declare const setLineQuantity: (lines: OrderLine[], lineUid: string, quantity: number) => OrderLine[];
2572
+ /** Drop a root subtree, then add the replacement tree (may merge by fingerprint). */
2573
+ declare const replaceLine: (lines: OrderLine[], lineUid: string, next: OrderLine | OrderLine[]) => OrderLine[];
2175
2574
  //#endregion
2176
2575
  //#region src/services/availability.d.ts
2177
2576
  declare const getAvailability: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<StorefrontAvailability>;
@@ -2313,7 +2712,7 @@ declare const getCustomer: (id: string, options?: ServiceHttpOptions) => Promise
2313
2712
  last4: string;
2314
2713
  exp_month: number;
2315
2714
  exp_year: number;
2316
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2715
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
2317
2716
  provider_payment_method_id: string;
2318
2717
  preferred: boolean;
2319
2718
  metadata: Record<string, unknown> | null;
@@ -2321,7 +2720,7 @@ declare const getCustomer: (id: string, options?: ServiceHttpOptions) => Promise
2321
2720
  id: string;
2322
2721
  type: "WALLET";
2323
2722
  alias: string;
2324
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2723
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
2325
2724
  provider_payment_method_id: string;
2326
2725
  account_hint?: string | undefined;
2327
2726
  preferred: boolean;
@@ -2332,7 +2731,7 @@ declare const getCustomer: (id: string, options?: ServiceHttpOptions) => Promise
2332
2731
  alias: string;
2333
2732
  bank_name?: string | undefined;
2334
2733
  last4: string;
2335
- provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
2734
+ provider?: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape" | undefined;
2336
2735
  provider_payment_method_id?: string | undefined;
2337
2736
  preferred: boolean;
2338
2737
  metadata: Record<string, unknown> | null;
@@ -2417,7 +2816,7 @@ declare const createCustomer: (body: CustomerRegisterInput, options?: ServiceHtt
2417
2816
  last4: string;
2418
2817
  exp_month: number;
2419
2818
  exp_year: number;
2420
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2819
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
2421
2820
  provider_payment_method_id: string;
2422
2821
  preferred: boolean;
2423
2822
  metadata: Record<string, unknown> | null;
@@ -2425,7 +2824,7 @@ declare const createCustomer: (body: CustomerRegisterInput, options?: ServiceHtt
2425
2824
  id: string;
2426
2825
  type: "WALLET";
2427
2826
  alias: string;
2428
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2827
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
2429
2828
  provider_payment_method_id: string;
2430
2829
  account_hint?: string | undefined;
2431
2830
  preferred: boolean;
@@ -2436,7 +2835,7 @@ declare const createCustomer: (body: CustomerRegisterInput, options?: ServiceHtt
2436
2835
  alias: string;
2437
2836
  bank_name?: string | undefined;
2438
2837
  last4: string;
2439
- provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
2838
+ provider?: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape" | undefined;
2440
2839
  provider_payment_method_id?: string | undefined;
2441
2840
  preferred: boolean;
2442
2841
  metadata: Record<string, unknown> | null;
@@ -2521,7 +2920,7 @@ declare const identifyAnonymousCustomer: (id: string, body: CustomerIdentifyInpu
2521
2920
  last4: string;
2522
2921
  exp_month: number;
2523
2922
  exp_year: number;
2524
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2923
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
2525
2924
  provider_payment_method_id: string;
2526
2925
  preferred: boolean;
2527
2926
  metadata: Record<string, unknown> | null;
@@ -2529,7 +2928,7 @@ declare const identifyAnonymousCustomer: (id: string, body: CustomerIdentifyInpu
2529
2928
  id: string;
2530
2929
  type: "WALLET";
2531
2930
  alias: string;
2532
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2931
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
2533
2932
  provider_payment_method_id: string;
2534
2933
  account_hint?: string | undefined;
2535
2934
  preferred: boolean;
@@ -2540,7 +2939,7 @@ declare const identifyAnonymousCustomer: (id: string, body: CustomerIdentifyInpu
2540
2939
  alias: string;
2541
2940
  bank_name?: string | undefined;
2542
2941
  last4: string;
2543
- provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
2942
+ provider?: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape" | undefined;
2544
2943
  provider_payment_method_id?: string | undefined;
2545
2944
  preferred: boolean;
2546
2945
  metadata: Record<string, unknown> | null;
@@ -2625,7 +3024,7 @@ declare const updateCustomer: (id: string, body: CustomerUpdateInput, options?:
2625
3024
  last4: string;
2626
3025
  exp_month: number;
2627
3026
  exp_year: number;
2628
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
3027
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
2629
3028
  provider_payment_method_id: string;
2630
3029
  preferred: boolean;
2631
3030
  metadata: Record<string, unknown> | null;
@@ -2633,7 +3032,7 @@ declare const updateCustomer: (id: string, body: CustomerUpdateInput, options?:
2633
3032
  id: string;
2634
3033
  type: "WALLET";
2635
3034
  alias: string;
2636
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
3035
+ provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
2637
3036
  provider_payment_method_id: string;
2638
3037
  account_hint?: string | undefined;
2639
3038
  preferred: boolean;
@@ -2644,7 +3043,7 @@ declare const updateCustomer: (id: string, body: CustomerUpdateInput, options?:
2644
3043
  alias: string;
2645
3044
  bank_name?: string | undefined;
2646
3045
  last4: string;
2647
- provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
3046
+ provider?: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape" | undefined;
2648
3047
  provider_payment_method_id?: string | undefined;
2649
3048
  preferred: boolean;
2650
3049
  metadata: Record<string, unknown> | null;
@@ -3270,7 +3669,7 @@ declare const listPayments: (input: StorefrontPaymentsListInput, options?: Servi
3270
3669
  } | {
3271
3670
  interpretation?: "both" | "client" | "server" | undefined;
3272
3671
  primitive: "custom";
3273
- type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
3672
+ type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Payment" | "Payments" | "Store" | "Stores";
3274
3673
  operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
3275
3674
  value: string;
3276
3675
  label_ids?: string[] | undefined;
@@ -3285,13 +3684,109 @@ declare const listPayments: (input: StorefrontPaymentsListInput, options?: Servi
3285
3684
  };
3286
3685
  method: {
3287
3686
  id: string;
3288
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
3687
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
3289
3688
  name: string;
3290
3689
  version: string;
3690
+ config?: {
3691
+ [x: string]: unknown;
3692
+ device_fields?: {
3693
+ key: string;
3694
+ label: string;
3695
+ type: "boolean" | "number" | "password" | "select" | "text";
3696
+ required: boolean;
3697
+ secret: boolean;
3698
+ options?: string[] | undefined;
3699
+ visible_if?: Record<string, unknown> | undefined;
3700
+ }[] | undefined;
3701
+ qr_ttl_ms?: number | undefined;
3702
+ terminal_models?: string[] | undefined;
3703
+ supports_installments?: boolean | undefined;
3704
+ } | undefined;
3291
3705
  };
3292
3706
  config: Record<string, unknown>;
3293
3707
  has_conditions: boolean;
3294
3708
  }[]>;
3709
+ type PaymentOperationBody = {
3710
+ order_id: string | null;
3711
+ attempt_reference: string | null;
3712
+ input: Record<string, unknown>;
3713
+ };
3714
+ /** Server half of an adapter (`POST /payments/:id/operations/:operation`). */
3715
+ declare const callPaymentOperation: <T>(paymentId: string, operation: string, body: PaymentOperationBody, options?: ServiceHttpOptions) => Promise<T>;
3716
+ type TerminalFailureBody = {
3717
+ operation: string;
3718
+ device_id?: string | null;
3719
+ error: {
3720
+ code: string;
3721
+ message: string;
3722
+ } & Record<string, unknown>;
3723
+ };
3724
+ /** Reports a failed terminal operation (`payment.terminal_failed`). */
3725
+ declare const reportTerminalFailure: (paymentId: string, body: TerminalFailureBody, options?: ServiceHttpOptions) => Promise<{
3726
+ reported: boolean;
3727
+ }>;
3728
+ //#endregion
3729
+ //#region src/i18n/pos.d.ts
3730
+ type PosMessageLocale = "en" | "en-US" | "es" | "pt-BR";
3731
+ //#endregion
3732
+ //#region src/services/pos.d.ts
3733
+ declare const isPosDeviceNotLinked: (error: unknown) => boolean;
3734
+ declare const isPosUnauthorized: (error: unknown) => boolean;
3735
+ declare const isPosPinLocked: (error: unknown) => boolean;
3736
+ declare const localizePosError: (error: unknown, locale?: PosMessageLocale) => string | undefined;
3737
+ declare const pairPosDevice: (input: {
3738
+ pairing_code: string;
3739
+ device_secret: string;
3740
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
3741
+ declare const relinkPosDevice: (input: {
3742
+ relink_code: string;
3743
+ device_secret: string;
3744
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
3745
+ declare const postPosHeartbeat: (input: PosHeartbeatInput, options?: ServiceHttpOptions) => Promise<PosHeartbeatResult>;
3746
+ declare const postPosHealthSamples: (input: PosHealthBatchInput, options?: ServiceHttpOptions) => Promise<PosHealthBatchResult>;
3747
+ declare const postPosDeviceLogs: (input: unknown, options?: ServiceHttpOptions) => Promise<{
3748
+ ok: boolean;
3749
+ accepted: number;
3750
+ }>;
3751
+ declare const listPosOperators: (input: {
3752
+ device_uid: string;
3753
+ device_secret: string;
3754
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
3755
+ declare const verifyPosOperator: (input: {
3756
+ device_uid: string;
3757
+ device_secret: string;
3758
+ operator_id: string;
3759
+ pin: string;
3760
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
3761
+ declare const listPosAuthorizers: (input: {
3762
+ device_uid: string;
3763
+ device_secret: string;
3764
+ action: string;
3765
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
3766
+ declare const verifyPosAuthorizer: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
3767
+ declare const openPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
3768
+ declare const countPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
3769
+ declare const withdrawPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
3770
+ declare const drawerPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
3771
+ declare const closePosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
3772
+ declare const shiftEndPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
3773
+ /** The device's open caja and its events, or `{ session: null }`. */
3774
+ declare const getPosCurrentSession: (input: {
3775
+ device_uid: string;
3776
+ device_secret: string;
3777
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
3778
+ declare const listPosKioskOrders: (input: {
3779
+ device_uid: string;
3780
+ device_secret: string;
3781
+ }, options?: ServiceHttpOptions) => Promise<PosKioskOrder[]>;
3782
+ /** Safe to retry with the same `client_id`; the server dedupes the settle. */
3783
+ declare const settlePosKioskOrder: (input: PosKioskSettleInput, options?: ServiceHttpOptions) => Promise<PosKioskSettleResult>;
3784
+ declare const getPosCatalog: (input: {
3785
+ device_uid: string;
3786
+ device_secret: string;
3787
+ }, options?: ServiceHttpOptions) => Promise<PosCatalog>;
3788
+ /** Safe to retry with the same `client_id`; the server dedupes the sale. */
3789
+ declare const createPosOrder: (input: PosOrderInput, options?: ServiceHttpOptions) => Promise<PosOrderResult>;
3295
3790
  //#endregion
3296
3791
  //#region src/services/preferences.d.ts
3297
3792
  declare const getPreferences: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<{
@@ -3347,6 +3842,18 @@ declare const getPreferences: (scope?: StorefrontMenuScope, options?: ServiceHtt
3347
3842
  ios_store_url: string;
3348
3843
  android_store_url: string;
3349
3844
  };
3845
+ country?: string | undefined;
3846
+ locale?: string | undefined;
3847
+ currency?: {
3848
+ code: string;
3849
+ symbol: string;
3850
+ name: string;
3851
+ } | undefined;
3852
+ denominations?: {
3853
+ kind: "BILL" | "COIN";
3854
+ value: number;
3855
+ sort_order: number;
3856
+ }[] | undefined;
3350
3857
  }>;
3351
3858
  //#endregion
3352
3859
  //#region src/services/stores.d.ts
@@ -3676,11 +4183,14 @@ declare const services: {
3676
4183
  reorder: typeof reorderOrder;
3677
4184
  validate: typeof validateOrder;
3678
4185
  place: typeof placeOrder;
4186
+ recordPayment: typeof recordOrderPayment;
3679
4187
  getFulfillment: typeof getOrderFulfillment;
3680
4188
  listFulfillments: typeof listOrderFulfillments;
3681
4189
  };
3682
4190
  payments: {
3683
4191
  list: typeof listPayments;
4192
+ operation: typeof callPaymentOperation;
4193
+ terminalFailure: typeof reportTerminalFailure;
3684
4194
  };
3685
4195
  stores: {
3686
4196
  list: typeof listStores;
@@ -3700,6 +4210,32 @@ declare const services: {
3700
4210
  isDeviceNotLinked: typeof isDeviceNotLinked;
3701
4211
  isKioskUnauthorized: typeof isKioskUnauthorized;
3702
4212
  };
4213
+ pos: {
4214
+ pair: typeof pairPosDevice;
4215
+ relink: typeof relinkPosDevice;
4216
+ heartbeat: typeof postPosHeartbeat;
4217
+ postHealthSamples: typeof postPosHealthSamples;
4218
+ postLogs: typeof postPosDeviceLogs;
4219
+ listOperators: typeof listPosOperators;
4220
+ verifyOperator: typeof verifyPosOperator;
4221
+ listAuthorizers: typeof listPosAuthorizers;
4222
+ verifyAuthorizer: typeof verifyPosAuthorizer;
4223
+ openSession: typeof openPosSession;
4224
+ countSession: typeof countPosSession;
4225
+ withdraw: typeof withdrawPosSession;
4226
+ drawer: typeof drawerPosSession;
4227
+ closeSession: typeof closePosSession;
4228
+ shiftEnd: typeof shiftEndPosSession;
4229
+ currentSession: typeof getPosCurrentSession;
4230
+ listKioskOrders: typeof listPosKioskOrders;
4231
+ settleKioskOrder: typeof settlePosKioskOrder;
4232
+ getCatalog: typeof getPosCatalog;
4233
+ createOrder: typeof createPosOrder;
4234
+ isDeviceNotLinked: typeof isPosDeviceNotLinked;
4235
+ isUnauthorized: typeof isPosUnauthorized;
4236
+ isPinLocked: typeof isPosPinLocked;
4237
+ localizeError: typeof localizePosError;
4238
+ };
3703
4239
  };
3704
4240
  //#endregion
3705
4241
  //#region src/schedule/schedule.d.ts
@@ -3714,6 +4250,29 @@ type ScheduleWindow = {
3714
4250
  declare const getScheduleWindow: (schedule: Schedule | null | undefined, now?: Date) => ScheduleWindow;
3715
4251
  declare const isOnSchedule: (schedule: Schedule | null | undefined, now?: Date) => boolean;
3716
4252
  //#endregion
4253
+ //#region src/logs/context.d.ts
4254
+ declare const getLogContext: () => SdkLogContext;
4255
+ //#endregion
4256
+ //#region src/logs/log.d.ts
4257
+ /** Sends queued logs now; resolves once every batch has been attempted. */
4258
+ declare const flushLogs: () => Promise<void>;
4259
+ /**
4260
+ * Reports a log to the merchant dashboard with the SDK's current context
4261
+ * (channel, fulfillment, store, brand, device). Never throws; resolves to
4262
+ * `false` when the log could not be delivered.
4263
+ */
4264
+ declare const log: (level: SdkLogLevel, message: string, options?: SdkLogOptions) => Promise<boolean>;
4265
+ /** `log("error", …)` with message, name, stack and cause read from `error`. */
4266
+ declare const logError: (error: unknown, options?: SdkLogOptions) => Promise<boolean>;
4267
+ //#endregion
4268
+ //#region src/logs/serializeError.d.ts
4269
+ type SerializedError = {
4270
+ message: string;
4271
+ error: SdkLogErrorInfo;
4272
+ };
4273
+ /** Accepts anything a `catch` can receive. */
4274
+ declare const serializeError: (value: unknown) => SerializedError;
4275
+ //#endregion
3717
4276
  //#region src/shared/genId.d.ts
3718
4277
  type IdBuilder = {
3719
4278
  /**
@@ -3857,4 +4416,77 @@ declare const paymentMatchesClientConditions: (conditions: OrConditions | null |
3857
4416
  now?: string;
3858
4417
  }) => boolean;
3859
4418
  //#endregion
3860
- export { type ApplyRedeemInput, type AuthConfigureOptions, type CreateOrderOptions, type CreateSessionOptions, type CustomizationPath, type CustomizationSession, DEFAULT_RECOMMENDATION_TYPES, type ExchangeOptions, type FlatMenuCategory, type GroupDisplayType, type IdBuilder, type ListMenusStreamOptions, type Menu, type MenuCategoryNode, type MenuLookup, type MilestoneSteps, type MilestoneTrackItem, type ModifierControlType, type ModifierCtx, type ModifierGroupCtx, type NestedMenuCategory, Order, type OrderCustomerSource, type OrderDraft, type OrderIssue, type OrderIssueCode, type OrderLineDiff, type OrderLineIssue, type OrderLineIssueCode, type OrderScope, OrderSyncPendingError, OrderValidationError, type OrderValidationResult, type PricingModifier, type Product, type ProductCtx, type QuantitiesByPath, type RecommendationType, RecurringDateCron, type RemoveRedeemInput, type ReorderOrderOptions, type ResetOptions, RulesEngine, type ScheduleWindow, type SelectionStatus, type SelectionsByPath, type ServiceHttpOptions, type Snapshot, type StorefrontAccessToken, StorefrontHttpError, type TrackWorkflow, type ValidateOptions, type ValidateOrderAgainstMenuInput, type Variant, type VariantGroup, type VariantGroupCtx, type VariantOptionCtx, type VariantSelection, type VisitedState, addLines, auth, buildCustomerSnapshot, collectOrderLineDiffs, computeStartingPrice, countCartProducts, createSession, currentNodes, defaultConditionError, flattenMenuCategories, fromOrderLines, genId, genOrderId, getScheduleWindow, indexMenu, isCheckoutFieldFilled, isDeviceNotLinked, isKioskUnauthorized, isMilestoneStepDone, isOnSchedule, isOrderValidationError, isStorefrontNotFound, isVariantBase, listMenusStream, matchAbsoluteDateOperator, matchBooleanOperator, matchCurrencyOperator, matchEnumOperator, matchNumberOperator, matchRecurringDateOperator, matchRelativeDateOperator, matchStringOperator, milestoneSteps, milestoneTrack, nestMenuCategories, paymentMatchesClientConditions, recomputeRedemptions, recomputeTotals, resolveCheckout, services, storefrontJson, toOrderLines, validateOrderAgainstMenu, visitedStates };
4419
+ //#region src/card/card.types.d.ts
4420
+ type CardBrand = "visa" | "mastercard" | "amex" | "diners" | "discover" | "jcb" | "unionpay" | "unknown";
4421
+ /** Brands accepted by the customer `payments[].brand` contract. */
4422
+ type PaymentCardBrand = "visa" | "mastercard" | "amex" | "diners" | "discover" | "other";
4423
+ interface CardBrandSpec {
4424
+ brand: CardBrand;
4425
+ label: string;
4426
+ pattern: RegExp;
4427
+ /** Valid PAN lengths, ascending. */
4428
+ lengths: number[];
4429
+ /** Digit indexes where a space is inserted (e.g. `[4, 10]` for 4-6-5). */
4430
+ gaps: number[];
4431
+ /** Valid CVC lengths, ascending. */
4432
+ cvcLengths: number[];
4433
+ }
4434
+ type CardNumberError = "required" | "incomplete" | "invalid";
4435
+ type CardExpiryError = "required" | "incomplete" | "invalid_month" | "expired" | "too_far";
4436
+ type CardCvcError = "required" | "incomplete";
4437
+ type CardholderNameError = "required" | "too_short" | "too_long" | "invalid_chars";
4438
+ interface CardExpiry {
4439
+ month: number;
4440
+ /** Four-digit year. */
4441
+ year: number;
4442
+ }
4443
+ interface CardPreviewSlot {
4444
+ /** Digit, `•` for masked digits, or empty when not typed yet. */
4445
+ char: string;
4446
+ filled: boolean;
4447
+ }
4448
+ //#endregion
4449
+ //#region src/card/card.d.ts
4450
+ /** Detection order matters: narrower prefixes first. */
4451
+ declare const CARD_BRANDS: readonly CardBrandSpec[];
4452
+ declare const cardDigits: (value: string) => string;
4453
+ /** Mod-10 checksum. Expects digits only (non-digits are ignored). */
4454
+ declare const luhnCheck: (value: string) => boolean;
4455
+ declare const cardBrandSpec: (brand: CardBrand) => CardBrandSpec;
4456
+ /** Brand from the typed prefix; `unknown` until the prefix is unambiguous. */
4457
+ declare const detectCardBrand: (value: string) => CardBrand;
4458
+ declare const toPaymentCardBrand: (brand: CardBrand) => PaymentCardBrand;
4459
+ declare const cardNumberMaxLength: (brand: CardBrand) => number;
4460
+ /** Space positions for a PAN of `length` digits (Diners 14 → 4-6-4). */
4461
+ declare const cardNumberGaps: (brand: CardBrand, length: number) => number[];
4462
+ /** Digits only, capped to the brand max length, grouped with spaces. */
4463
+ declare const formatCardNumber: (value: string) => string;
4464
+ /** Caret index in `formatted` right after its `digitCount`-th digit. */
4465
+ declare const caretAfterDigits: (formatted: string, digitCount: number) => number;
4466
+ declare const validateCardNumber: (value: string) => CardNumberError | null;
4467
+ /** Ready to move focus on: a valid length for the brand that passes Luhn. */
4468
+ declare const isCardNumberComplete: (value: string) => boolean;
4469
+ /** Full-length PAN that fails Luhn — safe to flag while the user types. */
4470
+ declare const isCardNumberDefinitelyInvalid: (value: string) => boolean;
4471
+ /**
4472
+ * `MM/YY` as the user types or pastes: `4` → `04`, `13` → `01/3`,
4473
+ * `12/2030` → `12/30`. The slash only appears once a year digit exists so
4474
+ * backspace never gets stuck.
4475
+ */
4476
+ declare const formatExpiry: (value: string) => string;
4477
+ declare const parseExpiry: (value: string) => CardExpiry | null;
4478
+ declare const isExpiryComplete: (value: string) => boolean;
4479
+ declare const validateExpiry: (value: string, now?: Date) => CardExpiryError | null;
4480
+ declare const cvcMaxLength: (brand: CardBrand) => number;
4481
+ declare const formatCvc: (value: string, brand: CardBrand) => string;
4482
+ declare const validateCvc: (value: string, brand: CardBrand) => CardCvcError | null;
4483
+ declare const isCvcComplete: (value: string, brand: CardBrand) => boolean;
4484
+ declare const normalizeCardholderName: (value: string) => string;
4485
+ declare const validateCardholderName: (value: string) => CardholderNameError | null;
4486
+ /**
4487
+ * Digit slots for a card preview, grouped like the formatted number. Middle
4488
+ * digits are masked as `•`; first and last groups stay readable.
4489
+ */
4490
+ declare const cardPreviewGroups: (value: string) => CardPreviewSlot[][];
4491
+ //#endregion
4492
+ export { type ApplyRedeemInput, type AuthConfigureOptions, CARD_BRANDS, type CardBrand, type CardBrandSpec, type CardCvcError, type CardExpiry, type CardExpiryError, type CardNumberError, type CardPreviewSlot, type CardholderNameError, type CreateOrderOptions, type CreateSessionOptions, type CustomizationPath, type CustomizationSession, DEFAULT_RECOMMENDATION_TYPES, type ExchangeOptions, type FlatMenuCategory, type GroupDisplayType, type IdBuilder, type ListMenusStreamOptions, type Menu, type MenuCategoryNode, type MenuLookup, type MilestoneSteps, type MilestoneTrackItem, type ModifierControlType, type ModifierCtx, type ModifierGroupCtx, type NestedMenuCategory, Order, type OrderCustomerSource, type OrderDraft, type OrderIssue, type OrderIssueCode, type OrderLineDiff, type OrderLineIssue, type OrderLineIssueCode, type OrderScope, OrderSyncPendingError, OrderValidationError, type OrderValidationResult, type PayOptions, type PaymentCardBrand, type PaymentRunOptions, type PaymentSessionOptions, type PricingModifier, type Product, type ProductCtx, type QuantitiesByPath, type RecommendationType, RecurringDateCron, type RemoveRedeemInput, type ReorderOrderOptions, type ResetOptions, type ReversalOutcome, RulesEngine, type ScheduleWindow, type SelectionStatus, type SelectionsByPath, type SerializedError, type ServiceHttpOptions, type Snapshot, type StorefrontAccessToken, StorefrontHttpError, type TrackWorkflow, type ValidateOptions, type ValidateOrderAgainstMenuInput, type Variant, type VariantGroup, type VariantGroupCtx, type VariantOptionCtx, type VariantSelection, type VisitedState, addLines, auth, buildCustomerSnapshot, cardBrandSpec, cardDigits, cardNumberGaps, cardNumberMaxLength, cardPreviewGroups, caretAfterDigits, collectOrderLineDiffs, computeStartingPrice, countCartProducts, coveredAmount, createSession, currentNodes, cvcMaxLength, defaultConditionError, detectCardBrand, flattenMenuCategories, flushLogs, formatCardNumber, formatCvc, formatExpiry, fromOrderLines, genId, genOrderId, getLogContext, getScheduleWindow, indexMenu, isCardNumberComplete, isCardNumberDefinitelyInvalid, isCheckoutFieldFilled, isCvcComplete, isDeviceNotLinked, isExpiryComplete, isKioskUnauthorized, isMilestoneStepDone, isOnSchedule, isOrderValidationError, isPosDeviceNotLinked, isPosUnauthorized, isStorefrontNotFound, isVariantBase, listMenusStream, localizePosError, log, logError, luhnCheck, matchAbsoluteDateOperator, matchBooleanOperator, matchCurrencyOperator, matchEnumOperator, matchNumberOperator, matchRecurringDateOperator, matchRelativeDateOperator, matchStringOperator, milestoneSteps, milestoneTrack, nestMenuCategories, normalizeCardholderName, parseExpiry, paymentMatchesClientConditions, recomputeRedemptions, recomputeTotals, remainingAmount, removeLine, replaceLine, resolveCheckout, reversePayment, runPaymentAttempt, serializeError, services, setLineQuantity, storefrontJson, toOrderLines, toPaymentCardBrand, validateCardNumber, validateCardholderName, validateCvc, validateExpiry, validateOrderAgainstMenu, visitedStates };