createCheckout(), the SDK renders
a complete payment UI inside your container. Learn what the default checkout
includes and how to customize it.
Default styles
Out of the box,createCheckout() applies the
default CSS styles
and renders:
- An accordion with radio-button selection between available payment methods.
- A card form with Card number, Expiration date, and Security code fields, plus the optional fields described in Card form. The form’s submit button reads Continue.
- PayPal, Google Pay, and Apple Pay buttons in their own accordion sections. When Apple Pay is available, the checkout leaves out Google Pay.
- Loading spinners, error containers, and a success screen.
- A responsive layout with a mobile breakpoint at 768 px.
Override CSS
The default checkout renders elements with.ff-* CSS classes you can
target for visual overrides:
For example, to change the submit button border radius:
Custom layout
To place the card form and each payment button in your own layout, render them one by one with Billing.initMethod(). Each call renders one payment method into an element you choose.Payment method order
ThepaymentMethodOrder array controls the display order of payment methods
in the checkout accordion.
By default, it shows: APPLE_PAY > GOOGLE_PAY > PAYPAL > PAYMENT_CARD.
Card form
The card form always shows the card number, expiration date, and security code. The fields below are optional. Thecard option applies to both
createCheckout() and Billing.initMethod().
Cardholder name field
Setcard.cardholderName.required:
true: Show and require the field.false: Hide the field.- Unset: Follow
show_cardholder_name_fieldin Checkout page fields.
Email address field
Setcard.emailAddress.visible:
true: Show an email input pre-filled withcustomer.email.false: Hide the field.- Unset: Follow
show_email_fieldin Checkout page fields.
customer.email.
Use template to format that email before the SDK sends it. Any occurrence
of {{email}} is replaced with the email the buyer entered.
Country and zip code
The card form shows a Country selector and a Zip code field when your organization collects the customer’s location. Turn them on in Checkout page fields or with Collect the customer’s location on the payment form in Taxes. There’s no SDK option for these fields.- Country: Lists the countries FunnelFox Payments returns, with the buyer’s country detected from their IP selected. Without a list, the field shows the detected country and can’t be changed.
- Zip code: Shown for the countries where your settings require it, and required when shown. It updates when the buyer switches country.
Field validation
The card form shows errors the same way as Stripe’s payment form:- Impossible card number: Shown while the buyer types.
- Incomplete or invalid value: Shown after the buyer leaves the field and hidden while they retype it. An error stays visible when the buyer comes back to the field, until they start typing.
- Empty field: Shown after the buyer submits the form.
.errorContainer, in #df1b41 at
15px.
Payment button
Each payment button accepts styling options that are passed to the payment provider SDK.createCheckout() uses the default PayPal and Google Pay buttons and a black
Apple Pay button. There, you can set only the Apple Pay buttonType. All
options below apply to Billing.initMethod().Apple Pay
Set the button color withbuttonStyle: 'black' (default), 'white', or
'white-outline'. Set the button text with buttonType.
For the second group, the SDK loads Apple’s Apple Pay script from
applepay.cdn-apple.com and places Apple’s button over Primer’s button. The
payment still runs through Primer. The button uses the browser’s language
and a 28 px corner radius.
If Apple’s script fails to load or doesn’t create the button within 4
seconds, the SDK shows Primer’s plain Apple Pay button instead. If your page
uses a Content Security Policy, allow applepay.cdn-apple.com in
script-src.
PayPal
Customize the PayPal button appearance and payment flow.Google Pay
Customize the Google Pay button appearance and sizing.Card input
Card number, expiry, and CVV fields are rendered inside iframes by the payment provider, so regular CSS cannot reach them. Use thestyle option to
control their appearance:
base object also supports fontSize, color, fontFamily, and
fontWeight.
By default, SDK applies the following styles:
The cardholder name, email, and zip code inputs and the country selector are
native HTML elements. Style them with CSS using the
.ff-card-form-text-input
class, not through the style option.