Last updated

checkout()

Proceeds to checkout with the current cart. Redirects to the checkout page or triggers any custom checkout handler.

Signature

await window.FairShareSDK.checkout();

Example

// Proceed to checkout
await window.FairShareSDK.checkout();

Custom Checkout Handler

You can set a custom checkout handler using setOnCheckout:

window.FairShareSDK.setOnCheckout(async () => {
  // Custom checkout logic
  window.location.href = '/custom-checkout';
});

// Now checkout() will call your custom handler
await window.FairShareSDK.checkout();