import type { RappiConfig } from "../schemas/config"; import type { CheckoutDetail, CheckoutWidget } from "../schemas/checkout"; import { get, post, put } from "../http"; export async function getCheckoutDetail( storeType: string, config: RappiConfig ): Promise { return get( `/api/ms/shopping-cart/v1/${storeType}/checkout/detail`, config ); } export async function getCheckoutWidgets( storeType: string, config: RappiConfig ): Promise { return post( `/api/ms/checkout-component/${storeType}`, {}, config ); } export async function setTip( storeType: string, tip: number, config: RappiConfig ): Promise { await put( `/api/ms/shopping-cart/v1/${storeType}/tip`, { tip }, config ); } export async function setPaymentMethod( storeType: string, paymentMethod: unknown, config: RappiConfig ): Promise { return put( `/api/ms/shopping-cart/v1/${storeType}/payment-method`, paymentMethod, config ); }