Show payment terms
A rental may sell one car type on more than one payment term, such as "Pay now, non-refundable", "Pay now, refundable" for a little more, or "Pay on arrival". This page shows how to draw that choice on your own site.
A payment term has two parts:
refundable: false keeps what was paid when the customer cancels. True gives the rental's free cancel.confirmationBp: the share of the total paid at booking, in basis points. 10000 is full payment, 2000 is a 20% confirmation, 0 is pay on arrival. The rest is paid at pickup.
The rental decides what it sells on Settings · Payment methods, and prices each term with price rules. A rental that sells one term gives one term, and your page shows no choice.
1. Get the terms
Every quote lists the terms the rental sells, cheapest first:
Code
Code
Code
POST /quotes gives the same terms on each quote, so one call fills a list of car types. locale sets the language of title and summary: en, is, de, fr, es or it.
2. Draw the choice
One radio for each term. A layout that works:
Code
- Show "Included" where
differenceMinoris 0, and "+ amount" for the others. - Show the
summaryunder the picked term. Or write your own words fromfreeCancelUntil,changesUntilandconfirmationBp. - Show the picked term's
totalMinoras the price, and itspayNowMinoron the Pay button. - In a car type list, show the first term's total: it is the cheapest.
3. Price and book the picked term
Send the picked term's refundable and confirmationBp on the next quote, the hold and the booking. The answer then prices that term, and the booking keeps it.
Code
A term the rental does not sell is refused with 422 term_not_sold. That is a share under the rental's own, or non-refundable while the rental sells only refundable.
4. Pay on arrival
A term with confirmationBp 0 has payNowMinor 0. There is nothing to pay, so a website books the hold with no payment:
Code
The answer is the hold, booked, with its booking. A hold with money to pay is refused with 409 to_pay: ask for its payment with POST /rentals/{slug}/holds/{id}/payments.
The booking widget
The widget does all of this. <mellow-payment-terms> shows the terms on a car type's details, and the hold takes the pick. See Elements.