Custom Gateway

Connect a payment gateway that Beds24 doesn't integrate with in Settings > Payments > Payment Gateways > Custom Gateway. The guest sees a pay button that takes them to your gateway's URL, and your gateway reports successful payments back to Beds24 through a notify URL.

Prerequisites: HTML and programming skills, or a developer.

Table of Contents

  1. Send the guest to the custom gateway
  2. Confirmation page
  3. Notify Beds24 of the payment status
  4. Gateways with specific requirements

Send the guest to the custom gateway

When the guest clicks the pay button, their browser sends the value in Post Data to the specified URL as an HTML POST, as if a normal HTML form were submitted. If the POST fields are empty, a GET request is made to the URL instead.

  • Both the URL and the POST fields can contain template variables with values from the booking.
  • [PAYMENTAMOUNT] contains the deposit when booking, and the payment request amount when used for payment requests.

Example: deposit=[PAYMENTAMOUNT]&bookid=[BOOKID] posts the fields deposit and bookid to the external gateway.

Note: The POST data is sent from the guest's browser, so it's visible in the page source. Don't include secret or private data.

Confirmation page

Your payment gateway shows the guest whether the payment succeeded or failed. After the booking (and after sending the notify webhook), you can return the guest to booking.php?page=bookconfirmed, which shows the booking they just made.

Note: The booking is stored in a session variable. The confirmation page must be on the same domain as the booking, it doesn't work in incognito mode, and it might time out after 15 minutes.

Notify Beds24 of the payment status

The external gateway reports a successful deposit to the notify URL. The notify adds the deposit to the booking invoice and triggers the booking status update and the email notifications to guest and host.

https://api.beds24.com/custompaymentgateway/notify.php

Send the data as HTML POST form data. The key must match the value in the custom gateway Key setting and be at least 6 characters.

POST field Required Value
key Yes The value in the custom gateway Key setting
bookid Yes The booking ID
status No Booking status: 0 (cancelled), 1 (confirmed), 2 (new), 3 (request) or -2 (no change)
amount No Amount of the deposit collected
description No Description of the payment for the invoice item
payment_status No Status of the payment for the invoice item
txnid No Unique ID for this payment, to prevent false duplicates

Expected result: a success returns HTTP 200 with no text. Any text in the response is an error message: the notify wasn't successful.

Gateways with specific requirements

Some gateways need data Beds24 can't send directly, for example authorisation headers, passwords or a specific data format. In that case, post the payment values to your own server first. Your server converts the data into the format the gateway needs and then redirects the guest to the gateway.

Related Articles

Was this article helpful?
0 out of 0 found this helpful

How to Contact us :