Style the hosted payment page
Give the hosted payment page of a project its own logo, background and colours, and preview it before it goes live.
The hosted payment page is the checkout Ginger shows to the shopper when a merchant creates an order. Each project can give it its own logo, background image and colours. You set the style with the Boarding API. Merchants can also set it themselves in the Merchant portal.
What you can style
The style is stored on the project, in settings.hosted-payment-page, in two sets:
default: the style shoppers see.preview: a draft you check on the preview page before you copy it todefault.
Each set styles these parts of the page:
A drawing of the hosted payment page for an example merchant, with numbers on the parts you can style: 1 the logo, 2 the language selector, 3 the cancel link, 4 the header of the payment form, 5 the order summary, 6 the pay button and 7 the background of the page. The list below the drawing explains each number.
- Logo, top left: an image you upload. Stored in
logo_.image_ url - Language selector, top right: the colour of the text in
language_.selector_ font_ color - Cancel link, above the form, that takes the shopper back to the webshop: the colour of the text in
return_.button_ font_ color - Header of the payment form, such as "Enter your card details": the background in
header_and the text inbackground_ color header_. Setfont_ color hide_toheader trueto hide it, for example when the page is shown in an app. - Order summary next to the form, with the order description and the amount: the background in
sidebar_and the text inbackground_ color sidebar_.font_ color - Pay button: the background in
payment_and the text inbutton_ background_ color payment_. When they are not set, the button takes the colours of the header.button_ font_ color - Background of the page behind the form: an image you upload. Stored in
background_.image_ url
The input fields and the card brand logos of the form have no style fields. See
settings.hosted-payment-page in Update a project for every field.
Colours are hexadecimal RGB values including the #, such as #0ade63. To go back to the default colour, set the
field to an empty string or null.
The order of the payment methods on the page is set in payment_, a list of payment method identifiers.
The project's terms_ is shown on the page as a link to the merchant's terms.
Preview the page
Open the preview page of the project to see the preview style:
https://api.example.com/pay/preview/<merchant_id>/<project_id>/Set the colours
Send the style in an update of the project. The update needs the required project fields trade_,
description, status and website_. Send their current values, so the update doesn't change them.
curl https://api.example.com/v1/admin/merchants/$MERCHANT_ID/projects/$PROJECT_ID/ \
--user "$API_KEY:" \
--header "Content-Type: application/json" \
--request PUT \
--data '{
"trade_name": "Acme Coffee",
"description": "Acme Coffee webshop",
"status": "active-production",
"website_url": "https://www.example.com/",
"settings": {
"hosted-payment-page": {
"preview": {
"header_background_color": "#1d3557",
"header_font_color": "#ffffff",
"payment_button_background_color": "#e63946"
}
}
}
}'See Update a project in the API reference for every style field.
Check the preview page. When it looks right, send the same values in default.
Upload a logo or background
Upload the image as the request body. The path says which image (logo or background) and which set (preview or default). The Content-Type must be
image/, image/ or image/.
curl https://api.example.com/v1/admin/merchants/$MERCHANT_ID/projects/$PROJECT_ID/hpp-uploads/logo/preview/ \
--user "$API_KEY:" \
--header "Content-Type: image/png" \
--request PUT \
--data-binary @logo.pngGinger answers 201 Created and stores the URL of the image in logo_ or background_ of that
set. To remove an image, send a DELETE to the same path. See
Upload a hosted payment page image and
Delete a hosted payment page image in the API reference.
Next steps
- Take a test payment: the merchant is boarded, test it before it goes live.
- Hosted payment page in the payment acceptance docs: how merchants send shoppers to the page.