Skip to content

Latest commit

 

History

History
653 lines (359 loc) · 15.9 KB

CheckoutStoreErrorSelector.md

File metadata and controls

653 lines (359 loc) · 15.9 KB

@bigcommerce/checkout-sdk / CheckoutStoreErrorSelector

Interface: CheckoutStoreErrorSelector

Responsible for getting the error of any asynchronous checkout action, if there is any.

This object has a set of getters that would return an error if an action is not executed successfully. For example, if you are unable to submit an order, you can use this object to retrieve the reason for the failure.

Table of contents

Methods

Methods

getApplyCouponError

getApplyCouponError(): undefined | RequestError<any>

Returns an error if unable to apply a coupon code.

Returns

undefined | RequestError<any>

The error object if unable to apply, otherwise undefined.


getApplyGiftCertificateError

getApplyGiftCertificateError(): undefined | RequestError<any>

Returns an error if unable to apply a gift certificate.

Returns

undefined | RequestError<any>

The error object if unable to apply, otherwise undefined.


getApplyStoreCreditError

getApplyStoreCreditError(): undefined | RequestError<any>

Returns an error if unable to apply store credit.

Returns

undefined | RequestError<any>

The error object if unable to apply, otherwise undefined.


getContinueAsGuestError

getContinueAsGuestError(): undefined | Error

Returns an error if unable to continue as guest.

The call could fail in scenarios where guest checkout is not allowed, for example, when existing accounts are required to sign-in.

In the background, this call tries to set the billing address email using the Storefront API. You could access the Storefront API response status code using getContinueAsGuestError error selector.

console.log(state.errors.getContinueAsGuestError());
console.log(state.errors.getContinueAsGuestError().status);

For more information about status codes, check Checkout Storefront API - Add Checkout Billing Address.

Returns

undefined | Error

The error object if unable to continue, otherwise undefined.


getCreateConsignmentsError

getCreateConsignmentsError(): undefined | Error

Returns an error if unable to create consignments.

Returns

undefined | Error

The error object if unable to create, otherwise undefined.


getCreateCustomerAccountError

getCreateCustomerAccountError(): undefined | Error

Returns an error if unable to create customer account.

Returns

undefined | Error

The error object if unable to create account, otherwise undefined.


getCreateCustomerAddressError

getCreateCustomerAddressError(): undefined | Error

Returns an error if unable to create customer address.

Returns

undefined | Error

The error object if unable to create address, otherwise undefined.


getDeleteConsignmentError

getDeleteConsignmentError(consignmentId?): undefined | Error

Returns an error if unable to delete a consignment.

A consignment ID should be provided when checking for an error for a specific consignment, otherwise it will check for all available consignments.

Parameters

Name Type Description
consignmentId? string The identifier of the consignment to be checked.

Returns

undefined | Error

The error object if unable to delete, otherwise undefined.


getDeleteInstrumentError

getDeleteInstrumentError(instrumentId?): undefined | Error

Returns an error if unable to delete a payment instrument.

Parameters

Name Type Description
instrumentId? string The identifier of the payment instrument to delete.

Returns

undefined | Error

The error object if unable to delete, otherwise undefined.


getError

getError(): undefined | Error

Returns

undefined | Error


getFinalizeOrderError

getFinalizeOrderError(): undefined | Error

Returns an error if unable to finalize the current order.

Returns

undefined | Error

The error object if unable to finalize, otherwise undefined.


getInitializeCustomerError

getInitializeCustomerError(methodId?): undefined | Error

Returns an error if unable to initialize the customer step of a checkout process.

Parameters

Name Type Description
methodId? string The identifer of the initialization method to execute.

Returns

undefined | Error

The error object if unable to initialize, otherwise undefined.


getInitializePaymentError

getInitializePaymentError(methodId?): undefined | Error

Returns an error if unable to initialize a specific payment method.

Parameters

Name Type Description
methodId? string The identifier of the payment method to initialize.

Returns

undefined | Error

The error object if unable to initialize, otherwise undefined.


getInitializeShippingError

getInitializeShippingError(methodId?): undefined | Error

Returns an error if unable to initialize the shipping step of a checkout process.

Parameters

Name Type Description
methodId? string The identifer of the initialization method to execute.

Returns

undefined | Error

The error object if unable to initialize, otherwise undefined.


getLoadBillingCountriesError

getLoadBillingCountriesError(): undefined | Error

Returns an error if unable to load billing countries.

Returns

undefined | Error

The error object if unable to load, otherwise undefined.


getLoadCartError

getLoadCartError(): undefined | Error

Returns an error if unable to load the current cart.

Returns

undefined | Error

The error object if unable to load, otherwise undefined.


getLoadCheckoutError

getLoadCheckoutError(): undefined | Error

Returns an error if unable to load the current checkout.

Returns

undefined | Error

The error object if unable to load, otherwise undefined.


getLoadConfigError

getLoadConfigError(): undefined | Error

Returns an error if unable to load the checkout configuration of a store.

Returns

undefined | Error

The error object if unable to load, otherwise undefined.


getLoadExtensionsError

getLoadExtensionsError(): undefined | Error

Returns an error if unable to fetch extensions.

alpha

Returns

undefined | Error

The error object if unable to fetch extensions, otherwise undefined.


getLoadInstrumentsError

getLoadInstrumentsError(): undefined | Error

Returns an error if unable to load payment instruments.

Returns

undefined | Error

The error object if unable to load, otherwise undefined.


getLoadOrderError

getLoadOrderError(): undefined | Error

Returns an error if unable to load the current order.

Returns

undefined | Error

The error object if unable to load, otherwise undefined.


getLoadPaymentMethodError

getLoadPaymentMethodError(methodId?): undefined | Error

Returns an error if unable to load a specific payment method.

Parameters

Name Type Description
methodId? string The identifier of the payment method to load.

Returns

undefined | Error

The error object if unable to load, otherwise undefined.


getLoadPaymentMethodsError

getLoadPaymentMethodsError(): undefined | Error

Returns an error if unable to load payment methods.

Returns

undefined | Error

The error object if unable to load, otherwise undefined.


getLoadShippingCountriesError

getLoadShippingCountriesError(): undefined | Error

Returns an error if unable to load shipping countries.

Returns

undefined | Error

The error object if unable to load, otherwise undefined.


getLoadShippingOptionsError

getLoadShippingOptionsError(): undefined | Error

Returns an error if unable to load shipping options.

Returns

undefined | Error

The error object if unable to load, otherwise undefined.


getPickupOptionsError

getPickupOptionsError(): undefined | Error

Returns an error if unable to fetch pickup options.

Returns

undefined | Error

The error object if unable to fetch pickup options, otherwise undefined.


getRemoveCouponError

getRemoveCouponError(): undefined | RequestError<any>

Returns an error if unable to remove a coupon code.

Returns

undefined | RequestError<any>

The error object if unable to remove, otherwise undefined.


getRemoveGiftCertificateError

getRemoveGiftCertificateError(): undefined | RequestError<any>

Returns an error if unable to remove a gift certificate.

Returns

undefined | RequestError<any>

The error object if unable to remove, otherwise undefined.


getSelectShippingOptionError

getSelectShippingOptionError(consignmentId?): undefined | Error

Returns an error if unable to select a shipping option.

A consignment ID should be provided when checking for an error for a specific consignment, otherwise it will check for all available consignments.

Parameters

Name Type Description
consignmentId? string The identifier of the consignment to be checked.

Returns

undefined | Error

The error object if unable to select, otherwise undefined.


getSignInEmailError

getSignInEmailError(): undefined | Error

Returns an error if unable to send sign-in email.

Returns

undefined | Error

The error object if unable to send email, otherwise undefined.


getSignInError

getSignInError(): undefined | Error

Returns an error if unable to sign in.

Returns

undefined | Error

The error object if unable to sign in, otherwise undefined.


getSignOutError

getSignOutError(): undefined | Error

Returns an error if unable to sign out.

Returns

undefined | Error

The error object if unable to sign out, otherwise undefined.


getSubmitOrderError

getSubmitOrderError(): undefined | Error | CartChangedError | CartConsistencyError

Returns an error if unable to submit the current order.

Returns

undefined | Error | CartChangedError | CartConsistencyError

The error object if unable to submit, otherwise undefined.


getUpdateBillingAddressError

getUpdateBillingAddressError(): undefined | Error

Returns an error if unable to update billing address.

Returns

undefined | Error

The error object if unable to update, otherwise undefined.


getUpdateCheckoutError

getUpdateCheckoutError(): undefined | Error

Returns an error if unable to update the current checkout.

Returns

undefined | Error

The error object if unable to update, otherwise undefined.


getUpdateConsignmentError

getUpdateConsignmentError(consignmentId?): undefined | Error

Returns an error if unable to update a consignment.

A consignment ID should be provided when checking for an error for a specific consignment, otherwise it will check for all available consignments.

Parameters

Name Type Description
consignmentId? string The identifier of the consignment to be checked.

Returns

undefined | Error

The error object if unable to update, otherwise undefined.


getUpdateShippingAddressError

getUpdateShippingAddressError(): undefined | Error

Returns an error if unable to update shipping address.

Returns

undefined | Error

The error object if unable to update, otherwise undefined.


getUpdateSubscriptionsError

getUpdateSubscriptionsError(): undefined | Error

Returns an error if unable to update subscriptions.

Returns

undefined | Error

The error object if unable to update, otherwise undefined.