Bolt Checkout Button
Once you’ve successfully set up the Bolt iOS SDK and payment provider, you can customize your webview checkout buttons, webview options, and by passing hints to pre-fill your fields with shopper/user information.
To install the Bolt Checkout Button, include
.withCheckoutButton() in your
boltVC function as:
let boltVC = Bolt() .withPublishableKey(publishableKey) .withOrderToken(orderToken) .withHints(merchantHints) // Optional. .withCheckoutButton() // Bolt Checkout button. .checkoutPanel()
Customize Checkout Button Styling
The default checkout button looks something like this:
The merchant can choose to add custom styling to this button. The different styles that can be customized are
Border Color, and
To set custom styling to the checkout button, the merchant must make a
CheckoutButtonStyle object using the builder pattern, where some or all of these fields can be custom set.
let style = Bolt.CheckoutButtonStyleBuilder() .withTitle("Check This Out") .withBackgroundColor(UIColor.black.cgColor) .build() // let boltVC = Bolt() // ... // ... .withCheckoutButton(delegate: self, checkoutButtonStyle: style) .checkoutPanel()
Checkout Button Order
You must state which buttons you would like to include, in the order you would like them to appear.
For instance, the following will place the Bolt Checkout button on top of the Apple Pay button.
You can also only include one, if you only want that button.
Webview Checkout Button Options
You can customize your webview to include multiple configuration options, including the addition of an Apple Pay button. You can find a variety of these options below.
let boltVC = Bolt() .withPublishableKey(publishableKey) .withOrderToken(orderToken) .withMerchantName(merchantName) .withMerchantAppleId(merchantAppleId) .withHints(merchantHints) // Optional. .withCheckoutButton() // Bolt Checkout button. .withApplePayButton() // Only required for Apple Pay .checkoutPanel() // Must include .checkoutPanel() at the end
||REQUIRED FIELD FOR EITHER BUTTON. Your publishable key assigned to you by Bolt.|
||REQUIRED FIELD FOR EITHER BUTTON. The token created by calling
||REQUIRED FIELD FOR APPLE PAY. The name of your merchant as it will be shown on the Apple Pay view controller.|
||REQUIRED FIELD FOR APPLE PAY. The id assigned to your merchant by Apple.|
||The URL that webview will open for Bolt Checkout. By default, this is
||The API endpoint that will be used. By default, this is
||Hints that will help you populate fields in the Bolt Checkout webview.|
Merchants can now leverage the builder pattern to configure the Bolt View Controller with the following fields. These configuration fields are used to configure the Checkout and Apple Pay buttons, which are contained within the Bolt View Controller.
Merchants can also (optionally) pass in hints when creating the Bolt View Controller. The Hints object will be created using the builder pattern.
Hints are certain fields that merchants can provide shopper information for, which the checkout webview will use to pre-populate the corresponding fields.
If the merchant already has information about the shopper prior to checkout, they can pre-populate some fields in the checkout modal.
// Example Usage (all fields are optional to include) let hints = Bolt.HintsBuilder() .withPhone("416 123 1298") .withFirstName("Bob") .withLastName("Frazer") .withEmail("firstname.lastname@example.org") .withPhone("4161231234") .withAddressLine1("1 New York Street") .withAddressLine2("Apt. #24") .withCity("New York City") .withState("NY") .withZip("12345") .build() // must end with .build() // Let boltVC = Bolt() // ... // ... .withHints(hints) .checkoutPanel()
Be sure to thoroughly test your customizations before launching to your iOS application! You can also choose to customize the Exit Checkout experience or enable Apple Pay Please reach out to your Bolt representative if you have any questions or feedback.