@godaddy/react
Version:
The `createCheckoutSession` function creates a new checkout session with GoDaddy's commerce API.
238 lines (236 loc) • 6.42 kB
TypeScript
import { D as CheckoutSessionOptions, T as CheckoutSessionInput, ft as GoDaddyAppearance } from "./types-BDqklfoW.js";
import { ResultOf } from "gql.tada";
//#region src/lib/godaddy/godaddy.d.ts
type CreateCheckoutSessionInputWithKebabCase = Omit<CheckoutSessionInput['input'], 'appearance'> & {
appearance?: GoDaddyAppearance;
};
//#endregion
//#region src/server.d.ts
declare function createCheckoutSession(input: CreateCheckoutSessionInputWithKebabCase, options?: CheckoutSessionOptions): Promise<{
id: string;
token: string | null;
url: string | null;
sourceApp: string | null;
returnUrl: string;
successUrl: string;
storeId: string;
businessId: string | null;
channelId: string;
customerId: string | null;
storeName: string | null;
environment: "dev" | "ote" | "prod" | "test" | null;
enableTips: boolean | null;
enabledLocales: string[] | null;
enableSurcharge: boolean | null;
enableLocalPickup: boolean | null;
enableShipping: boolean | null;
enablePhoneCollection: boolean | null;
enableNotesCollection: boolean | null;
enablePromotionCodes: boolean | null;
enableTaxCollection: boolean | null;
enableShippingAddressCollection: boolean | null;
enableBillingAddressCollection: boolean | null;
enableAddressAutocomplete: boolean | null;
appearance: {
theme: "base" | "orange" | "purple" | null;
variables: {
fontSans: string | null;
fontSerif: string | null;
fontMono: string | null;
defaultFontFamily: string | null;
background: string | null;
secondaryBackground: string | null;
foreground: string | null;
card: string | null;
cardForeground: string | null;
popover: string | null;
popoverForeground: string | null;
primary: string | null;
primaryForeground: string | null;
secondary: string | null;
secondaryForeground: string | null;
muted: string | null;
mutedForeground: string | null;
accent: string | null;
accentForeground: string | null;
destructive: string | null;
destructiveForeground: string | null;
border: string | null;
input: string | null;
ring: string | null;
radius: string | null;
} | null;
} | null;
experimental_rules: {
freeShipping: {
enabled: boolean;
minimumOrderTotal: number;
} | null;
} | null;
shipping: {
originAddress: {
addressLine1: string | null;
addressLine2: string | null;
addressLine3: string | null;
postalCode: string | null;
countryCode: string | null;
adminArea1: string | null;
adminArea2: string | null;
adminArea3: string | null;
adminArea4: string | null;
} | null;
} | null;
paymentMethods: {
card: {
processor: string;
checkoutTypes: string[];
} | null;
ccavenue: {
processor: string;
checkoutTypes: string[];
} | null;
express: {
processor: string;
checkoutTypes: string[];
} | null;
applePay: {
processor: string;
checkoutTypes: string[];
} | null;
googlePay: {
processor: string;
checkoutTypes: string[];
} | null;
paypal: {
processor: string;
checkoutTypes: string[];
} | null;
paze: {
processor: string;
checkoutTypes: string[];
} | null;
offline: {
processor: string;
checkoutTypes: string[];
} | null;
mercadopago: {
processor: string;
checkoutTypes: string[];
} | null;
} | null;
draftOrder: {
id: string | null;
statuses: {
status: string | null;
} | null;
totals: {
total: {
currencyCode: string | null;
value: number | null;
} | null;
} | null;
} | null;
locations: {
id: string;
isDefault: boolean;
address: {
addressLine1: string | null;
addressLine2: string | null;
addressLine3: string | null;
postalCode: string | null;
countryCode: string | null;
adminArea1: string | null;
adminArea2: string | null;
adminArea3: string | null;
adminArea4: string | null;
};
operatingHours: {
pickupWindowInDays: number;
leadTime: number;
pickupSlotInterval: number | null;
timeZone: string;
hours: {
monday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
tuesday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
wednesday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
thursday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
friday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
saturday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
sunday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
};
} | null;
}[] | null;
defaultOperatingHours: {
pickupWindowInDays: number;
leadTime: number;
pickupSlotInterval: number | null;
timeZone: string;
hours: {
monday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
tuesday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
wednesday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
thursday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
friday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
saturday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
sunday: {
enabled: boolean;
openTime: string | null;
closeTime: string | null;
} | null;
};
} | null;
} | null>;
//#endregion
export { createCheckoutSession };