usimple-saleor-sdk
Version:
This package contains all queries and mutations that are used in our sample storefront. It can be used for semi-custom or fully-custom (with ability to extend existing queries) storefront solutions.
32 lines (31 loc) • 2.14 kB
TypeScript
import { PaymentGateway } from "../../fragments/gqlTypes/PaymentGateway";
import { ErrorListener } from "../../helpers";
import { JobsManager } from "../../jobs";
import { SaleorState } from "../../state";
import { Config } from "../../types";
import { PromiseRunResponse } from "../types";
import { DataErrorCheckoutTypes, FunctionErrorCheckoutTypes, IAddress, IAvailableShippingMethods, ICheckout, ITaxedMoney, IPayment, IPromoCodeDiscount, CreatePaymentInput, CompleteCheckoutInput } from "./types";
export declare class SaleorCheckoutAPI extends ErrorListener {
loaded: boolean;
checkout?: ICheckout;
promoCodeDiscount?: IPromoCodeDiscount;
billingAsShipping?: boolean;
selectedShippingAddressId?: string;
selectedBillingAddressId?: string;
availableShippingMethods?: IAvailableShippingMethods;
availablePaymentGateways?: PaymentGateway[];
payment?: IPayment;
shippingPrice?: ITaxedMoney;
private saleorState;
private jobsManager;
private config;
constructor(saleorState: SaleorState, jobsManager: JobsManager, config: Config);
setShippingAddress: (shippingAddress: IAddress, email: string) => PromiseRunResponse<DataErrorCheckoutTypes, FunctionErrorCheckoutTypes>;
setBillingAddress: (billingAddress: IAddress, email?: string | undefined) => PromiseRunResponse<DataErrorCheckoutTypes, FunctionErrorCheckoutTypes>;
setBillingAsShippingAddress: () => PromiseRunResponse<DataErrorCheckoutTypes, FunctionErrorCheckoutTypes>;
setShippingMethod: (shippingMethodId: string) => PromiseRunResponse<DataErrorCheckoutTypes, FunctionErrorCheckoutTypes>;
addPromoCode: (promoCode: string) => PromiseRunResponse<DataErrorCheckoutTypes, FunctionErrorCheckoutTypes>;
removePromoCode: (promoCode: string) => PromiseRunResponse<DataErrorCheckoutTypes, FunctionErrorCheckoutTypes>;
createPayment: (input: CreatePaymentInput) => PromiseRunResponse<DataErrorCheckoutTypes, FunctionErrorCheckoutTypes>;
completeCheckout: (input?: CompleteCheckoutInput | undefined) => PromiseRunResponse<DataErrorCheckoutTypes, FunctionErrorCheckoutTypes>;
}