@bigcommerce/checkout-sdk
- AdyenV2CardFields
- AdyenV3CardFields
- AmazonPayV2ButtonColor
- AmazonPayV2ButtonDesign
- AmazonPayV2CheckoutLanguage
- AmazonPayV2LedgerCurrency
- AmazonPayV2PayOptions
- AmazonPayV2Placement
- BraintreeFormFieldType
- ButtonColor
- ButtonType
- CheckoutButtonMethodType
- CheckoutIncludes
- EmbeddedCheckoutEventType
- ExtensionCommandType
- ExtensionRegion
- GooglePayKey
- HostedFieldType
- HostedInputEventType
- IconStyle
- PaypalButtonStyleColorOption
- PaypalButtonStyleLabelOption
- PaypalButtonStyleLayoutOption
- PaypalButtonStyleShapeOption
- PaypalButtonStyleSizeOption
- RadiusUnit
- StyleButtonColor
- StyleButtonLabel
- StyleButtonShape
- StyleButtonShape_2
- StyleButtonSize
- UntrustedShippingCardVerificationType
- CartChangedError
- CartConsistencyError
- CheckoutButtonErrorSelector
- CheckoutButtonInitializer
- CheckoutButtonStatusSelector
- CheckoutService
- CurrencyService
- EmbeddedCheckout
- LanguageService
- RequestError
- StandardError
- AchInstrument
- Address
- AddressRequestBody
- AdyenAdditionalActionCallbacks
- AdyenAdditionalActionCallbacks_2
- AdyenAdditionalActionOptions
- AdyenAdditionalActionOptions_2
- AdyenBaseCardComponentOptions
- AdyenBaseCardComponentOptions_2
- AdyenComponent
- AdyenComponentEvents
- AdyenComponentEvents_2
- AdyenComponent_2
- AdyenCreditCardComponentOptions
- AdyenIdealComponentOptions
- AdyenPaymentMethodState
- AdyenPaymentMethodState_2
- AdyenPlaceholderData
- AdyenPlaceholderData_2
- AdyenThreeDS2Options
- AdyenV2PaymentInitializeOptions
- AdyenV2ValidationState
- AdyenV3CreditCardComponentOptions
- AdyenV3PaymentInitializeOptions
- AdyenV3ValidationState
- AmazonPayV2ButtonConfig
- AmazonPayV2ButtonParams
- AmazonPayV2CheckoutSession
- AmazonPayV2CheckoutSessionConfig
- AmazonPayV2CustomerInitializeOptions
- AmazonPayV2NewButtonParams
- AmazonPayV2PaymentInitializeOptions
- AmazonPayV2Price
- AmazonPayV2ShippingInitializeOptions
- ApplePayButtonInitializeOptions
- ApplePayCustomerInitializeOptions
- ApplePayPaymentInitializeOptions
- BankInstrument
- Banner
- BaseAccountInstrument
- BaseCheckoutButtonInitializeOptions
- BaseCustomerInitializeOptions
- BaseElementOptions
- BaseElementOptions_2
- BaseIndividualElementOptions
- BaseInstrument
- BasePaymentInitializeOptions
- BillingAddress
- BillingAddressRequestBody
- BirthDate
- BlockElementStyles
- BlueSnapDirectAPMInitializeOptions
- BlueSnapDirectStyleProps
- BlueSnapV2PaymentInitializeOptions
- BlueSnapV2StyleProps
- BodlEventsPayload
- BodlService
- BodyStyles
- BoletoDataPaymentMethodState
- BoletoState
- BoltButtonInitializeOptions
- BoltButtonStyleOptions
- BoltBuyNowInitializeOptions
- BoltCustomerInitializeOptions
- BoltPaymentInitializeOptions
- BraintreeAcceleratedCheckoutCustomer
- BraintreeAcceleratedCheckoutPaymentInitializeOptions
- BraintreeAcceleratedCheckoutShippingInitializeOptions
- BraintreeError
- BraintreeFormFieldCardTypeChangeEventData
- BraintreeFormFieldKeyboardEventData
- BraintreeFormFieldOptions
- BraintreeFormFieldState
- BraintreeFormFieldStylesMap
- BraintreeFormFieldValidateErrorData
- BraintreeFormFieldValidateEventData
- BraintreeFormFieldsMap
- BraintreeFormOptions
- BraintreeLocalMethods
- BraintreePaymentInitializeOptions
- BraintreePaypalAchInitializeOptions
- BraintreePaypalButtonInitializeOptions
- BraintreePaypalCreditButtonInitializeOptions
- BraintreePaypalCreditCustomerInitializeOptions
- BraintreePaypalCustomerInitializeOptions
- BraintreeStoredCardFieldOptions
- BraintreeStoredCardFieldsMap
- BraintreeThreeDSecureOptions
- BraintreeVenmoButtonInitializeOptions
- BraintreeVerifyPayload
- BraintreeVisaCheckoutCustomerInitializeOptions
- BraintreeVisaCheckoutPaymentInitializeOptions
- BrowserInfo
- ButtonResponse
- ButtonStyles
- BuyNowCartRequestBody
- CardCvcElementOptions
- CardDataPaymentMethodState
- CardDataPaymentMethodState_2
- CardElementOptions
- CardExpiryElementOptions
- CardInstrument
- CardNumberElementOptions
- CardPaymentMethodState
- CardPaymentMethodState_2
- CardState
- CardStateErrors
- CardStateErrors_2
- CardState_2
- Cart
- ChasePayCustomerInitializeOptions
- ChasePayInitializeOptions
- CheckableInputStyles
- ChecklistStyles
- Checkout
- CheckoutButtonInitializerOptions
- CheckoutButtonOptions
- CheckoutButtonSelectors
- CheckoutParams
- CheckoutPayment
- CheckoutPaymentMethodExecutedOptions
- CheckoutRequestBody
- CheckoutSelectors
- CheckoutServiceOptions
- CheckoutSettings
- CheckoutStoreErrorSelector
- CheckoutStoreSelector
- CheckoutStoreStatusSelector
- Consignment
- ConsignmentAssignmentBaseRequestBodyWithAddress
- ConsignmentAssignmentBaseRequestBodyWithShippingAddress
- ConsignmentCreateRequestBody
- ConsignmentLineItem
- ConsignmentPickupOption
- ConsignmentUpdateRequestBody
- Coordinates
- Country
- Coupon
- CreditCardInstrument
- CreditCardPaymentInitializeOptions_2
- CreditCardPlaceHolder
- CreditCardPlaceHolder_2
- CssProperties
- CssProperties_2
- Currency
- CustomError
- CustomItem
- Customer
- CustomerAccountRequestBody
- CustomerAddress
- CustomerCredentials
- CustomerGroup
- CustomerPasswordRequirements
- CustomerRequestOptions
- DeprecatedPayPalCommerceCreditCardsPaymentInitializeOptions
- DigitalItem
- DigitalRiverElementClasses
- DigitalRiverPaymentInitializeOptions
- Discount
- DisplaySettings
- EmbeddedCheckoutCompleteEvent
- EmbeddedCheckoutError
- EmbeddedCheckoutErrorEvent
- EmbeddedCheckoutFrameErrorEvent
- EmbeddedCheckoutFrameLoadedEvent
- EmbeddedCheckoutLoadedEvent
- EmbeddedCheckoutMessenger
- EmbeddedCheckoutMessengerOptions
- EmbeddedCheckoutOptions
- EmbeddedCheckoutSignedOutEvent
- EmbeddedCheckoutStyles
- EmbeddedContentOptions
- ExecutePaymentMethodCheckoutOptions
- Extension
- ExtensionCommandMap
- Fee
- FlashMessage
- FormField
- FormFieldItem
- FormFieldOptions
- FormFields
- GatewayOrderPayment
- GiftCertificate
- GiftCertificateItem
- GiftCertificateOrderPayment
- GooglePayButtonInitializeOptions
- GooglePayBuyNowInitializeOptions
- GooglePayCustomerInitializeOptions
- GooglePayCustomerInitializeOptions_2
- GooglePayPaymentInitializeOptions
- GooglePayPaymentInitializeOptions_2
- HostedCardFieldOptions
- HostedCardFieldOptionsMap
- HostedFieldStylesMap
- HostedFormErrorData
- HostedFormOptions
- HostedInputBlurEvent
- HostedInputCardTypeChangeEvent
- HostedInputEnterEvent
- HostedInputFocusEvent
- HostedInputValidateErrorData
- HostedInputValidateErrorDataMap
- HostedInputValidateEvent
- HostedInputValidateResults
- HostedInstrument
- HostedStoredCardFieldOptions
- HostedStoredCardFieldOptionsMap
- IbanElementOptions
- IdealElementOptions
- IndividualCardElementOptions
- InitializationStrategy
- InlineElementStyles
- InputDetail
- InputDetail_2
- InputStyles
- Item
- Item_2
- Item_3
- KlarnaLoadResponse
- KlarnaLoadResponse_2
- KlarnaPaymentInitializeOptions
- KlarnaV2PaymentInitializeOptions
- LabelStyles
- LanguageConfig
- LineItem
- LineItemCategory
- LineItemMap
- LineItemOption
- LineItemSocialData
- LineItem_2
- LinkStyles
- Locales
- MasterpassCustomerInitializeOptions
- MasterpassPaymentInitializeOptions
- MolliePaymentInitializeOptions
- MonerisPaymentInitializeOptions
- MonerisStylingProps
- NonceGenerationError
- NonceInstrument
- Option
- OptionsResponse
- OpyPaymentInitializeOptions
- Order
- OrderBillingAddress
- OrderConsignment
- OrderFee
- OrderPayment
- OrderPaymentRequestBody
- OrderRequestBody
- OrderShippingConsignment
- PasswordRequirements
- PayPalButtonStyleOptions
- PayPalBuyNowInitializeOptions
- PayPalCommerceAlternativeMethodsButtonOptions
- PayPalCommerceAlternativeMethodsPaymentOptions
- PayPalCommerceButtonInitializeOptions
- PayPalCommerceCreditButtonInitializeOptions
- PayPalCommerceCreditCardsPaymentInitializeOptions
- PayPalCommerceCreditCustomerInitializeOptions
- PayPalCommerceCreditPaymentInitializeOptions
- PayPalCommerceCustomerInitializeOptions
- PayPalCommerceFieldsStyleOptions
- PayPalCommercePaymentInitializeOptions
- PayPalCommerceVenmoButtonInitializeOptions
- PayPalCommerceVenmoCustomerInitializeOptions
- PayPalCommerceVenmoPaymentInitializeOptions
- PayPalInstrument
- PaymentMethod
- PaymentMethodConfig
- PaymentRequestOptions
- PaymentSettings
- PaypalButtonInitializeOptions
- PaypalCommerceRatePay
- PaypalExpressPaymentInitializeOptions
- PaypalStyleOptions
- PhysicalItem
- PickupMethod
- PickupOptionRequestBody
- PickupOptionResult
- Promotion
- Radius
- Region
- ReloadCheckoutCommand
- RequestOptions
- SearchArea
- SepaPlaceHolder
- SepaPlaceHolder_2
- SetIframeStyleCommand
- ShippingInitializeOptions
- ShippingOption
- ShippingRequestOptions
- ShopperConfig
- ShopperCurrency
- ShowLoadingIndicatorCommand
- SignInEmail
- SignInEmailRequestBody
- SpamProtectionOptions
- SquareFormElement
- SquarePaymentInitializeOptions
- SquareV2PaymentInitializeOptions
- StepStyles
- StepTracker
- StepTrackerConfig
- StoreConfig
- StoreCurrency
- StoreLinks
- StoreProfile
- StripeCustomerEvent
- StripeElementCSSProperties
- StripeElementClasses
- StripeElementStyle
- StripeElementStyleVariant
- StripeEvent
- StripeShippingEvent
- StripeUPECustomerInitializeOptions
- StripeUPEPaymentInitializeOptions
- StripeUPEShippingInitializeOptions
- StripeV3PaymentInitializeOptions
- StyleOptions
- StyleOptions_2
- SubInputDetail
- SubInputDetail_2
- Subscriptions
- Tax
- TextInputStyles
- ThreeDSecure
- ThreeDSecureToken
- TranslationData
- Translations
- UnknownObject
- UserExperienceSettings
- VaultedInstrument
- WechatDataPaymentMethodState
- WechatDataPaymentMethodState_2
- WechatState
- WechatState_2
- WithAdyenV2PaymentInitializeOptions
- WithAdyenV3PaymentInitializeOptions
- WithApplePayButtonInitializeOptions
- WithApplePayCustomerInitializeOptions
- WithApplePayPaymentInitializeOptions
- WithBlueSnapDirectAPMPaymentInitializeOptions
- WithBoltButtonInitializeOptions
- WithBoltCustomerInitializeOptions
- WithBoltPaymentInitializeOptions
- WithBraintreeAcceleratedCheckoutPaymentInitializeOptions
- WithBraintreeLocalMethodsPaymentInitializeOptions
- WithBraintreePaypalAchPaymentInitializeOptions
- WithBraintreePaypalCustomerInitializeOptions
- WithBuyNowFeature
- WithCheckoutcomFawryInstrument
- WithCheckoutcomSEPAInstrument
- WithCheckoutcomiDealInstrument
- WithCreditCardPaymentInitializeOptions
- WithDocumentInstrument
- WithMollieIssuerInstrument
- WithMolliePaymentInitializeOptions
- WithPayPalCommerceAlternativeMethodsButtonInitializeOptions
- WithPayPalCommerceAlternativeMethodsPaymentInitializeOptions
- WithPayPalCommerceButtonInitializeOptions
- WithPayPalCommerceCreditButtonInitializeOptions
- WithPayPalCommerceCreditCardsPaymentInitializeOptions
- WithPayPalCommerceCreditCustomerInitializeOptions
- WithPayPalCommerceCreditPaymentInitializeOptions
- WithPayPalCommerceCustomerInitializeOptions
- WithPayPalCommercePaymentInitializeOptions
- WithPayPalCommerceVenmoButtonInitializeOptions
- WithPayPalCommerceVenmoCustomerInitializeOptions
- WithPayPalCommerceVenmoPaymentInitializeOptions
- WithSquareV2PaymentInitializeOptions
- WithStripeV3PaymentInitializeOptions
- WorldpayAccessPaymentInitializeOptions
- ZipCodeElementOptions
- AccountInstrument
- AddressKey
- AdyenComponentState
- AdyenV3ComponentState
- AmazonPayV2ButtonInitializeOptions
- AmazonPayV2ButtonParameters
- AnalyticStepType
- BraintreeFormErrorData
- BraintreeFormErrorDataKeys
- BraintreeFormErrorsData
- BraintreeFormFieldBlurEventData
- BraintreeFormFieldEnterEventData
- BraintreeFormFieldFocusEventData
- BraintreeFormFieldStyles
- CheckoutButtonInitializeOptions
- CheckoutIncludeParam
- ComparableCheckout
- ConsignmentAssignmentRequestBody
- ConsignmentsRequestBody
- CustomerAddressRequestBody
- CustomerInitializeOptions
- FlashMessageType
- FormFieldFieldType
- FormFieldType
- GooglePayButtonColor
- GooglePayButtonType
- GuestCredentials
- HostedCreditCardInstrument
- HostedFieldBlurEventData
- HostedFieldCardTypeChangeEventData
- HostedFieldEnterEventData
- HostedFieldFocusEventData
- HostedFieldOptionsMap
- HostedFieldStyles
- HostedFieldValidateEventData
- HostedFormErrorDataKeys
- HostedFormErrorsData
- HostedInputStyles
- HostedVaultedInstrument
- Instrument
- Omit
- OrderPaymentInstrument
- OrderPayments
- PaymentInitializeOptions
- PaymentInstrument
- PaymentProviderCustomer
- StripeElementOptions
- StripeEventType
- WithGooglePayCustomerInitializeOptions
- WithGooglePayPaymentInitializeOptions
- createBodlService
- createCheckoutButtonInitializer
- createCheckoutService
- createCurrencyService
- createEmbeddedCheckoutMessenger
- createLanguageService
- createStepTracker
- embedCheckout
Ƭ AccountInstrument: PayPalInstrument
| BankInstrument
| AchInstrument
Ƭ AddressKey: keyof Address
Ƭ AdyenComponentState: CardState
| WechatState
Ƭ AdyenV3ComponentState: CardState_2
| WechatState_2
| BoletoState
Ƭ AmazonPayV2ButtonInitializeOptions: AmazonPayV2ButtonParameters
| WithBuyNowFeature
The required config to render the AmazonPayV2 button.
Ƭ AmazonPayV2ButtonParameters: AmazonPayV2ButtonParams
| AmazonPayV2NewButtonParams
Ƭ AnalyticStepType: "customer"
| "shipping"
| "billing"
| "payment"
Ƭ BraintreeFormErrorData: Omit
<BraintreeFormFieldState
, "isFocused"
>
Ƭ BraintreeFormErrorDataKeys: "number"
| "expirationDate"
| "expirationMonth"
| "expirationYear"
| "cvv"
| "postalCode"
Ƭ BraintreeFormErrorsData: Partial
<Record
<BraintreeFormErrorDataKeys
, BraintreeFormErrorData
>>
Ƭ BraintreeFormFieldBlurEventData: BraintreeFormFieldKeyboardEventData
Ƭ BraintreeFormFieldEnterEventData: BraintreeFormFieldKeyboardEventData
Ƭ BraintreeFormFieldFocusEventData: BraintreeFormFieldKeyboardEventData
Ƭ BraintreeFormFieldStyles: Partial
<Pick
<CSSStyleDeclaration
, "color"
| "fontFamily"
| "fontSize"
| "fontWeight"
>>
Ƭ CheckoutButtonInitializeOptions: BaseCheckoutButtonInitializeOptions
& WithApplePayButtonInitializeOptions
& WithBoltButtonInitializeOptions
& WithPayPalCommerceButtonInitializeOptions
& WithPayPalCommerceCreditButtonInitializeOptions
& WithPayPalCommerceVenmoButtonInitializeOptions
& WithPayPalCommerceAlternativeMethodsButtonInitializeOptions
Ƭ CheckoutIncludeParam: { [key in CheckoutIncludes]?: boolean }
Ƭ ComparableCheckout: Pick
<Checkout
, "outstandingBalance"
| "coupons"
| "giftCertificates"
> & { cart
: Partial
<Cart
> }
Ƭ ConsignmentAssignmentRequestBody: ConsignmentAssignmentBaseRequestBodyWithShippingAddress
| ConsignmentAssignmentBaseRequestBodyWithAddress
Ƭ ConsignmentsRequestBody: ConsignmentCreateRequestBody
[]
Ƭ CustomerAddressRequestBody: AddressRequestBody
Ƭ CustomerInitializeOptions: BaseCustomerInitializeOptions
& WithApplePayCustomerInitializeOptions
& WithBoltCustomerInitializeOptions
& WithBraintreePaypalCustomerInitializeOptions
& WithGooglePayCustomerInitializeOptions
& WithPayPalCommerceCustomerInitializeOptions
& WithPayPalCommerceCreditCustomerInitializeOptions
& WithPayPalCommerceVenmoCustomerInitializeOptions
Ƭ FlashMessageType: "error"
| "info"
| "warning"
| "success"
Ƭ FormFieldFieldType: "checkbox"
| "date"
| "text"
| "dropdown"
| "password"
| "radio"
| "multiline"
Ƭ FormFieldType: "array"
| "date"
| "integer"
| "string"
Ƭ GooglePayButtonColor: "default"
| "black"
| "white"
Ƭ GooglePayButtonType: "book"
| "buy"
| "checkout"
| "donate"
| "order"
| "pay"
| "plain"
| "subscribe"
| "long"
| "short"
Ƭ GuestCredentials: Partial
<Subscriptions
> & { email
: string
; id?
: string
}
Ƭ HostedCreditCardInstrument: Omit
<CreditCardInstrument
, "ccExpiry"
| "ccName"
| "ccNumber"
| "ccCvv"
>
Ƭ HostedFieldBlurEventData: HostedInputBlurEvent
["payload"
]
Ƭ HostedFieldCardTypeChangeEventData: HostedInputCardTypeChangeEvent
["payload"
]
Ƭ HostedFieldEnterEventData: HostedInputEnterEvent
["payload"
]
Ƭ HostedFieldFocusEventData: HostedInputFocusEvent
["payload"
]
Ƭ HostedFieldOptionsMap: HostedCardFieldOptionsMap
| HostedStoredCardFieldOptionsMap
Ƭ HostedFieldStyles: HostedInputStyles
Ƭ HostedFieldValidateEventData: HostedInputValidateEvent
["payload"
]
Ƭ HostedFormErrorDataKeys: "number"
| "expirationDate"
| "expirationMonth"
| "expirationYear"
| "cvv"
| "postalCode"
Ƭ HostedFormErrorsData: Partial
<Record
<HostedFormErrorDataKeys
, HostedFormErrorData
>>
Ƭ HostedInputStyles: Partial
<Pick
<CSSStyleDeclaration
, "color"
| "fontFamily"
| "fontSize"
| "fontWeight"
>>
Ƭ HostedVaultedInstrument: Omit
<VaultedInstrument
, "ccNumber"
| "ccCvv"
>
Ƭ Instrument: CardInstrument
Ƭ Omit<T
, K
>: Pick
<T
, Exclude
<keyof T
, K
>>
Name | Type |
---|---|
T |
T |
K |
extends keyof T |
Ƭ OrderPaymentInstrument: WithBankAccountInstrument
| CreditCardInstrument
| HostedInstrument
| HostedCreditCardInstrument
| HostedVaultedInstrument
| NonceInstrument
| VaultedInstrument
| BlueSnapDirectEcpInstrument
| CreditCardInstrument
& WithDocumentInstrument
| CreditCardInstrument
& WithCheckoutcomFawryInstrument
| CreditCardInstrument
& WithCheckoutcomSEPAInstrument
| CreditCardInstrument
& WithCheckoutcomiDealInstrument
| HostedInstrument
& WithMollieIssuerInstrument
| WithAccountCreation
Ƭ OrderPayments: (GatewayOrderPayment
| GiftCertificateOrderPayment
)[]
Ƭ PaymentInitializeOptions: BasePaymentInitializeOptions
& WithAdyenV2PaymentInitializeOptions
& WithAdyenV3PaymentInitializeOptions
& WithApplePayPaymentInitializeOptions
& WithBlueSnapDirectAPMPaymentInitializeOptions
& WithBoltPaymentInitializeOptions
& WithBraintreePaypalAchPaymentInitializeOptions
& WithBraintreeLocalMethodsPaymentInitializeOptions
& WithBraintreeAcceleratedCheckoutPaymentInitializeOptions
& WithCreditCardPaymentInitializeOptions
& WithGooglePayPaymentInitializeOptions
& WithMolliePaymentInitializeOptions
& WithPayPalCommercePaymentInitializeOptions
& WithPayPalCommerceCreditPaymentInitializeOptions
& WithPayPalCommerceVenmoPaymentInitializeOptions
& WithPayPalCommerceAlternativeMethodsPaymentInitializeOptions
& WithPayPalCommerceCreditCardsPaymentInitializeOptions
& WithSquareV2PaymentInitializeOptions
& WithStripeV3PaymentInitializeOptions
Ƭ PaymentInstrument: CardInstrument
| AccountInstrument
Ƭ PaymentProviderCustomer: BraintreeAcceleratedCheckoutCustomer
Ƭ StripeElementOptions: CardElementOptions
| CardExpiryElementOptions
| CardNumberElementOptions
| CardCvcElementOptions
| IdealElementOptions
| IbanElementOptions
| ZipCodeElementOptions
Ƭ StripeEventType: StripeShippingEvent
| StripeCustomerEvent
Ƭ WithGooglePayCustomerInitializeOptions: { [k in GooglePayKey]?: GooglePayCustomerInitializeOptions_2 }
The options that are required to initialize the GooglePay payment method. They can be omitted unless you need to support GooglePay.
Ƭ WithGooglePayPaymentInitializeOptions: { [k in GooglePayKey]?: GooglePayPaymentInitializeOptions_2 }
The options that are required to initialize the GooglePay payment method. They can be omitted unless you need to support GooglePay.
▸ createBodlService(subscribe
): BodlService
Creates an instance of BodlService
.
remarks
const bodlService = BodlService();
bodlService.checkoutBegin();
Name | Type | Description |
---|---|---|
subscribe |
(subscriber : (state : CheckoutSelectors ) => void ) => void |
The callback function, what get a subscriber as a property, that subscribes to state changes. |
an instance of BodlService
.
▸ createCheckoutButtonInitializer(options?
): CheckoutButtonInitializer
Creates an instance of CheckoutButtonInitializer
.
remarks
const initializer = createCheckoutButtonInitializer();
initializer.initializeButton({
methodId: 'braintreepaypal',
braintreepaypal: {
container: '#checkoutButton',
},
});
alpha
Please note that CheckoutButtonInitializer
is currently in an early stage
of development. Therefore the API is unstable and not ready for public
consumption.
Name | Type | Description |
---|---|---|
options? |
CheckoutButtonInitializerOptions |
A set of construction options. |
an instance of CheckoutButtonInitializer
.
▸ createCheckoutService(options?
): CheckoutService
Creates an instance of CheckoutService
.
remarks
const service = createCheckoutService();
service.subscribe(state => {
console.log(state);
});
service.loadCheckout();
Name | Type | Description |
---|---|---|
options? |
CheckoutServiceOptions |
A set of construction options. |
an instance of CheckoutService
.
▸ createCurrencyService(config
): CurrencyService
Creates an instance of CurrencyService
.
remarks
const { data } = checkoutService.getState();
const config = data.getConfig();
const checkout = data.getCheckout();
const currencyService = createCurrencyService(config);
currencyService.toStoreCurrency(checkout.grandTotal);
currencyService.toCustomerCurrency(checkout.grandTotal);
Name | Type | Description |
---|---|---|
config |
StoreConfig |
The config object containing the currency configuration |
an instance of CurrencyService
.
▸ createEmbeddedCheckoutMessenger(options
): EmbeddedCheckoutMessenger
Create an instance of EmbeddedCheckoutMessenger
.
remarks
The object is responsible for posting messages to the parent window from the
iframe when certain events have occurred. For example, when the checkout
form is first loaded, you should notify the parent window about it.
The iframe can only be embedded in domains that are allowed by the store.
const messenger = createEmbeddedCheckoutMessenger({
parentOrigin: 'https://some/website',
});
messenger.postFrameLoaded();
alpha
Please note that this feature is currently in an early stage of development.
Therefore the API is unstable and not ready for public consumption.
Name | Type | Description |
---|---|---|
options |
EmbeddedCheckoutMessengerOptions |
Options for creating EmbeddedCheckoutMessenger |
- An instance of
EmbeddedCheckoutMessenger
▸ createLanguageService(config?
): LanguageService
Creates an instance of LanguageService
.
remarks
const language = {{{langJson 'optimized_checkout'}}}; // `langJson` is a Handlebars helper provided by BigCommerce's Stencil template engine.
const service = createLanguageService(language);
console.log(service.translate('address.city_label'));
Name | Type | Description |
---|---|---|
config? |
Partial <LanguageConfig > |
A configuration object. |
An instance of LanguageService
.
▸ createStepTracker(checkoutService
, stepTrackerConfig?
): StepTracker
Creates an instance of StepTracker
.
remarks
const checkoutService = createCheckoutService();
await checkoutService.loadCheckout();
const stepTracker = createStepTracker(checkoutService);
stepTracker.trackCheckoutStarted();
Name | Type |
---|---|
checkoutService |
CheckoutService |
stepTrackerConfig? |
StepTrackerConfig |
an instance of StepTracker
.
▸ embedCheckout(options
): Promise
<EmbeddedCheckout
>
Embed the checkout form in an iframe.
remarks
Once the iframe is embedded, it will automatically resize according to the
size of the checkout form. It will also notify the parent window when certain
events have occurred. i.e.: when the form is loaded and ready to be used.
embedCheckout({
url: 'https://checkout/url',
containerId: 'container-id',
});
Name | Type | Description |
---|---|---|
options |
EmbeddedCheckoutOptions |
Options for embedding the checkout form. |
Promise
<EmbeddedCheckout
>
A promise that resolves to an instance of EmbeddedCheckout
.