| Purpose | Set up a custom payment gateway or gift card workflow in Booking Engine Plus and understand the supported implementation and support path. |
| Best for | PMS Administrators, Property Managers, Owners, and web developers or integration partners working on a custom payment flow. |
| Use this when | You want to register a custom payment option through Booking Engine Plus, support gift card entry with custom fields, test a third-party gateway, or understand what is supported with the Immersive Experience. |
| Requirements | Booking Engine Plus, Bank Transfer enabled for the Booking Engine, access to the Booking Engine Customize tab, and an experienced web developer or integration partner for custom JavaScript. Gift card workflows also require a custom guest field. |
| Expected result | The custom payment option is registered through the Booking Engine EventSystem, appears during hosted checkout, and the provider's custom logic can redirect the guest to complete payment after the reservation is created. |
| Limitations | Only one custom payment gateway can be configured. Custom payment methods are supported only in the hosted Booking Engine, not in the full Immersive Experience. Cloudbeds does not develop or maintain custom gateway logic. |
Introduction
Cloudbeds Booking Engine Plus can support a custom payment gateway or gift card workflow through custom JavaScript. The custom payment option uses the Booking Engine EventSystem and the Bank Transfer payment option as the base for the custom flow.
The hosted Booking Engine remains the supported checkout environment for custom payment methods. This article explains the setup requirements, what Cloudbeds Support can help with, what remains the responsibility of the payment provider or developer, and how to use premium embeds when a property wants a more immersive website entry experience.
Table of contents
- Who this affects and how
- Requirements and support boundaries
- Use custom payment methods with the Immersive Experience
- Set up a third-party payment gateway or gift card workflow
- Test and troubleshoot a custom payment gateway
Who this affects and how
Custom payment workflows involve both Cloudbeds configuration and third-party development. Use this table to identify which part of the process applies to you.
| Role | What to know |
|---|---|
| PMS Administrator or Property Manager | Enable the required Booking Engine payment setting, add provider-supplied code in the Customize tab, and complete the supported test setup. Review Requirements and support boundaries before implementing the script. |
| Web developer or payment gateway provider | Build, maintain, and troubleshoot the custom JavaScript, gateway redirect, and provider-side logic. For deeper integration questions, the payment provider should work with the Cloudbeds Integrations team. Review Test and troubleshoot a custom payment gateway. |
| Owner or General Manager | Use the hosted Booking Engine for the custom payment checkout. If you want a more branded website entry experience, review the supported premium-embed approach in Use custom payment methods with the Immersive Experience. |
Requirements and support boundaries
Before implementing a custom payment gateway or gift card workflow, confirm the required Booking Engine settings and who owns each part of the implementation.
- Enable Bank Transfer as a payment option for the Booking Engine in Cloudbeds PMS.
- Use custom JavaScript with the Booking Engine EventSystem to register the custom payment option.
- Only one custom payment gateway can be integrated. The property cannot offer Bank Transfer and a custom payment gateway as separate options at the same time.
- Gift card support requires a custom guest field for the guest to enter the gift card number.
- Custom payment methods are supported only in hosted Booking Engine environments. They are not supported in the full Cloudbeds Booking Engine Immersive Experience 2.0.
- The implementation steps in this article apply only to Booking Engine Plus.
Cloudbeds does not develop or maintain custom payment gateways. Building, changing, or troubleshooting custom gateway logic is outside the scope of Cloudbeds Support and Cloudbeds Payments. Your web developer, payment gateway provider, reseller, or integration partner must own the custom code and provider-side behavior.
How Cloudbeds Support can assist
Cloudbeds Support can help with the Cloudbeds-side setup needed for your provider to test its implementation. Support can:
- Guide you in creating a test rate plan with a promo code so the payment provider can review the browser console. Use a custom rate of USD 0.50 and make the test rate plan available only for the Booking Engine source.
- Help you add custom scripts supplied by your payment gateway provider to the Booking Engine Customize panel.
For advanced troubleshooting or integration questions, the payment gateway provider must work directly with the Cloudbeds Integrations team. If the provider is not yet a Cloudbeds partner, ask them to apply through the Partner with Cloudbeds page.
Use custom payment methods with the Immersive Experience
Custom payment methods are not supported in the full Cloudbeds Booking Engine Immersive Experience 2.0. If you want to keep the beginning of the booking journey on your property website, use premium embeds as the entry point and complete the booking on the hosted Booking Engine.
You can use premium embeds such as the multi-property, date picker, and accommodation picker widgets on your website. Guests can interact with the supported widget experience on your site, then continue to the Cloudbeds-hosted Booking Engine to complete the reservation and use the custom payment redirect.
Current limitation: Guests cannot view the full Booking Engine search results natively on the property website before being handed off to the hosted page for booking and payment.
Set up a third-party payment gateway or gift card workflow
The custom payment option must be registered through the Booking Engine EventSystem. The setup below covers the Cloudbeds-side event registration and the reservation-created event used by a provider's redirect logic.
Step 1: Add the custom JavaScript to the Customize tab
- Open the Account Menu
and go to Settings > Booking Engine.
- Click Customize.
- Add the custom JavaScript to the JavaScript field.
- Click Save.
The custom JavaScript must subscribe to the on-booking-engine-ready event. This event is dispatched when the Booking Engine is ready to trigger and listen to events. The script must also dispatch the custom-payment-option-change event so the Booking Engine can register the custom payment option.
<script>
window.addEventListener('on-booking-engine-ready', (e) => {
const { eventSystem } = e.detail;
eventSystem.dispatchEvent("custom-payment-option-change", {
id: "%PAYMENT_OPTION_ID%",
instructions: "Your default text for the instructions goes here.",
name: "Your default text for the label goes here.",
});
});
</script>When you save changes to the JavaScript field, Cloudbeds may ask you to complete step-up multi-factor authentication (MFA). Review Step-up MFA for Booking Engine Custom HTML and JavaScript Fields for the verification flow.
Step 2: Register the custom payment option with EventSystem
Use eventSystem.dispatchEvent() to dispatch the custom-payment-option-change event with the required payment option details:
-
id [string]: Required. The value must have a length greater than 0 and be valid for use as a CSS id. Do not use spaces, semicolons, or special characters that are invalid in CSS selectors. The suggested format is kebab-case. Replace%PAYMENT_OPTION_ID%with the id for the custom payment gateway. -
instructions [string]: Optional. Displays instructions or a description when the guest expands the custom payment option. Use this value as the default text when language-specific text is not customized with CSS. -
name [string]: Required. The value must have a length greater than 0.
If the event payload does not meet the required conditions, the custom payment option will not be registered and the Bank Transfer option will continue to display.
After saving the changes, open the hosted Booking Engine and test checkout. The payment step may open in a separate popup or modal instead of appearing inline on the reservation page. The custom payment option must still be registered through the Booking Engine EventSystem.
The following visual shows the hosted payment window with the available payment methods after the guest continues through checkout.
Step 3: Handle the reservation-created event and provider redirect
When a guest makes a reservation using the custom payment option, the reservation is created in Cloudbeds PMS with an e-banking payment method and no payment is collected by Cloudbeds. The provider's custom script can listen for the reservation-created event, use the reservation data, and redirect the guest to the third-party payment gateway to complete payment.
eventSystem.addEventListener('reservation-created', (data) = {
// Your code to execute after a booking is created...
})Use the Booking Engine EventSystem for the registration and reservation-created events. Do not rely only on page-specific click listeners, accordion button clicks, or UI selectors to determine whether the custom payment option was selected.
Expand the advanced reference sections below if you need optional label, instruction, icon, or reservation-data details.
Optional label, instruction, and icon customizations
You can specify language-based text for the custom payment option label:
html[lang="%LANG%"] [data-id="%PAYMENT_OPTION_ID%-name"]::before {
content: "Your lang-specific text for the label goes here.";
}
You can also configure language-based instructions:
html[lang="%LANG%"] [data-id="%PAYMENT_OPTION_ID%-instructions"]::before {
content: "Your lang-specific text for the instructions goes here.";
}
You can hide the default icon and add a custom logo or icon:
// To hide the default SVG icon
[data-id="%PAYMENT_OPTION_ID%-icon"] svg {
display: none;
}
// To customize the icon by setting it as a background image
[data-id="%PAYMENT_OPTION_ID%-icon"] {
background-image: url(PAYMENT_OPTION_ICON_URL);
background-size: cover;
background-position: center;
width: 40px;
height: 40px;
}
reservation-created data reference
The data exposed by the reservation-created event has the following shape:
interface CreatedReservation {
booking_id?: `${number}`;
booking_total?: number;
checkin_date?: string;
checkout_date?: string;
city?: string;
currency_code?: string;
hotel_name?: string;
real_booking_total?: number;
resRooms?: {
adults: `${number}`;
id: `${number}`;
kids: `${number}`;
package: `${number}`;
package_name: string | null;
rate_id: `${number}`;
room_total: `${number}`;
room_type_id: `${number}`;
room_type_name: string;
room_type_photos: ({
TYPE?: string;
alt: string;
cropParam: string | null;
croppedImage: string;
fullPath: string;
galleryPath?: string | null;
id: string;
imageHeight: string;
imageWidth: string;
mime?: string;
originalName: string;
ownerId?: string;
ownerType?: string;
parentId: string;
path: string;
section?: string;
size?: string;
thumbPath: string;
uploadedAt?: string;
utype?: string;
} & {
featured: number;
featuredPath: string | null;
})[];
}[];
rooms?: Record<string, {="{" adults:="adults:" number;="number;" amount:="amount:" bookedid:="bookedId:" string[];="string[];" kids:="kids:" name:="name:" string;="string;" packageid?:="packageId?:" packagename?:="packageName?:" picture?:="picture?:" price?:="price?:" rateid:="rateId:" roomid:="roomId:" unit?:="unit?:" }="}">;
state?: string;
total_tax?: number;
widget_property?: number;
};</string,>
Test and troubleshoot a custom payment gateway
Use a controlled Booking Engine test flow when your payment provider needs to inspect browser-console behavior or validate its redirect logic. Cloudbeds Support can help with the Cloudbeds-side test setup, but the payment provider remains responsible for custom gateway code and provider-side troubleshooting.
Create a test rate plan for provider troubleshooting
Cloudbeds Support can guide you in creating a temporary rate plan with a promo code for testing. Use a custom rate of USD 0.50 and make the rate plan available only for the Booking Engine source so your payment provider can reproduce the checkout flow and review the browser console.
Expand the issue that matches the behavior you are seeing.
The custom payment option does not display
Check the following:
- Confirm that Bank Transfer is enabled for the Booking Engine in Cloudbeds PMS.
- Confirm that the custom JavaScript is added to the Booking Engine Customize tab.
- Confirm that the
custom-payment-option-changeevent payload includes a valididandname. - Confirm that the
iddoes not include spaces, semicolons, or invalid CSS selector characters. - Confirm that only one custom payment gateway is configured.
If the event payload does not meet all requirements, the custom payment option will not be registered and Bank Transfer will continue to display.
The custom payment redirect does not work
Check the following:
- Confirm that the custom script listens for the
reservation-createdevent. - Confirm that the script does not rely only on page-specific click listeners, accordion button clicks, or UI selectors.
- Confirm that the third-party payment gateway URL and redirect parameters are valid.
If the redirect still fails after the Cloudbeds-side setup is confirmed, the payment gateway provider or developer must troubleshoot the custom logic. For deeper integration questions, the provider should work directly with the Cloudbeds Integrations team. If the provider is not yet a Cloudbeds partner, ask them to apply through the Partner with Cloudbeds page.
Related articles
Now that you understand the supported custom-payment setup and ownership boundaries, review these resources for broader Booking Engine Plus capabilities and the supported Immersive Experience configuration:
Comments
Hello
I am testing on a cloudbeds' demo account and I am trying to add a third-party payment gateway.
When I added a custom javascript code for step 1 and then refreshed the customize page, there was not the javascript code I entered and I couldn't see any custom payment option on the payment page.
Doesn't custom javascript work in demo account?
Hello, Muhammad Aiman Sulaiman!
Please contact our Support Team directly for more details about this particular request. They will be able to verify your inquiry and assist as soon as possible.
Regards!
Please sign in to leave a comment.