Free-Form Purchase Options¶
By default each entry in a page’s purchase list corresponds to a LaterPay Purchase Option specified via Connector Admin Interface or the In-Page Configuration Token or a combination of both.
Free-Form Purchase Options allow you to add custom entries to the purchase list. An example application is a login link for existing customers which can be visually integrated into the purchase list using Free-Form Purchase Options.
Examples¶
Add login link for existing customers to the top of the purchase list
<script type="application/json" id="laterpay-connector">
{
"freeFormPurchaseOptions": [
{
"title": "I'm a print subscriber",
"description": "Log in with your print subscriber account to get access to all articles",
"purchaseButtonLabel": "Login with your print subscriber account",
"purchaseUrl": "http://example.com/print_subscriber_login",
"position": 0,
"target": "_blank"
}
]
}
</script>
{
connectorScript: {
freeFormPurchaseOptions: [
{
title: 'I\'m a print subscriber',
description: 'Log in with your print subscriber account to get access to all articles',
purchaseButtonLabel: 'Login with your print subscriber account',
purchaseUrl: 'http://example.com/print_subscriber_login',
position: 0,
target: '_blank'
}
]
}
}
The example above adds a custom login link to the top of the purchase list. When the item is selected and the user clicks the Purchase Button, the specified URL will be opened in a new window/tab.
Object Properties¶
freeFormPurchaseOptionsAn array of Free-Form Purchase Options. Each element is an object with a
title, adescription, apurchaseUrland apurchaseButtonLabel. Optional properties areprice,positionandtarget.titleRequired
The Free-Form Purchase Option’s title (displayed in the first row of the list entry).
descriptionRequired
The Free-Form Purchase Option’s description (displayed in the second row of the list entry).
purchaseUrlRequired
The Free-Form Purchase Option’s URL. The user will be navigated to this URL when they click the Purchase Button.
purchaseButtonLabelRequired
The Purchase Button label that will be displayed when the Free-Form Purchase Option is selected.
priceOptional
An object stating the amount and currency. It is used for presentational purposes, only. To display a 1.23 EUR pricing, use this:
"price": { "amount": 123, "currency": "EUR" }
Note that you can use whatever currency you like here, because Free-Form Purchase Options don’t correspond to actual LaterPay Purchase Options.
positionOptional
An index starting with 0 for the top position. It indicates the Free-Form Purchase Option’s position in the purchase list.
The default position is the bottom of the purchase list.
tagetOptional
A link target that is used when the Purchase Button is clicked (e.g.
_blankfor a new window).The default behavior is a redirect (equivalent to the target
_self).