<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.test.visitgroup.com/index.php?action=history&amp;feed=atom&amp;title=Custom_Gateway</id>
	<title>Custom Gateway - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.test.visitgroup.com/index.php?action=history&amp;feed=atom&amp;title=Custom_Gateway"/>
	<link rel="alternate" type="text/html" href="https://wiki.test.visitgroup.com/index.php?title=Custom_Gateway&amp;action=history"/>
	<updated>2026-10-26T11:04:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.test.visitgroup.com/index.php?title=Custom_Gateway&amp;diff=1655&amp;oldid=prev</id>
		<title>Admin at 13:04, 12 June 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.test.visitgroup.com/index.php?title=Custom_Gateway&amp;diff=1655&amp;oldid=prev"/>
		<updated>2025-06-12T13:04:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Payments]]&lt;br /&gt;
[[Category:Payment_Gateways]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;heading&amp;quot;&amp;gt;Custom Gateway&amp;lt;/div&amp;gt;&lt;br /&gt;
 This page is about the menu  {{#fas:cog}} (SETTINGS)  PAYMENTS &amp;gt; PAYMENT GATEWAYS &amp;gt; CUSTOM GATEWAY and explains how to connect with a payment gateway of your choice.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: #f3e504; font-size: 250%;&amp;quot; &amp;gt;{{#fas:lightbulb}} &amp;lt;/span&amp;gt; Required skills: html, programming&lt;br /&gt;
__TOC__&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
You can create an interface to an external (not integrated) payment gateway.&lt;br /&gt;
&lt;br /&gt;
The booker will be shown a button which will take them to the specified URL with the value from &amp;quot;Post Data&amp;quot; included as an HTML POST.&lt;br /&gt;
&lt;br /&gt;
= Transfer to Custom Gateway =&lt;br /&gt;
&lt;br /&gt;
The post data is sent to the custom gateway with a POST method as if it came from a normal HTML form being submitted on a web page.&lt;br /&gt;
&lt;br /&gt;
Both the URL and POST fields can contain template variables to include values from the booking.&lt;br /&gt;
&lt;br /&gt;
If the POST fields are empty, a GET request is made to the specified URL.&lt;br /&gt;
&lt;br /&gt;
A special template variable [PAYMENTAMOUNT] will contain the value of the deposit when booking and the value of the payment request when used for payment requests.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;: &amp;lt;code&amp;gt; deposit=[PAYMENTAMOUNT]&amp;amp;bookid=[BOOKID]&amp;lt;/code&amp;gt; will post fields deposit and bookid to the external gateway.&lt;br /&gt;
&lt;br /&gt;
*The custom gateway POST data is posted from the users browser when they click the pay button.&lt;br /&gt;
*This means the POSTED data will be visible in the page source code and should not contain any secret or private data.&lt;br /&gt;
&lt;br /&gt;
= Confirmation Page =&lt;br /&gt;
&lt;br /&gt;
The payment gateway should show the payment status to the booker confirming the success or failure of their payment.&lt;br /&gt;
&lt;br /&gt;
After the booking (and sending the webhook to notify of payment success) the booker can be returned to the page booking.php?page=bookconfirmed which will show the booking they just made.&lt;br /&gt;
&lt;br /&gt;
The booking is a stored in a session variable, which means that the confirmation page needs to be on the same domain as the booking otherwise it wont work or if it&amp;#039;s in incognito mode and might time out after 15 minutes.&lt;br /&gt;
&lt;br /&gt;
= Webhook to notify of payment status =&lt;br /&gt;
&lt;br /&gt;
A notify URL is available for the external gateway to report a successful collection of the deposit.&lt;br /&gt;
&lt;br /&gt;
The notify will add the deposit to the booking invoice and trigger updates to booking status and email notifications to guest and host.&lt;br /&gt;
&lt;br /&gt;
The notify must post a key value that matches the value in the key setting and contain at least 6 characters.&lt;br /&gt;
&lt;br /&gt;
The data should be sent as HTML POST form data&lt;br /&gt;
&lt;br /&gt;
Notify URL: https://api.beds24.com/custompaymentgateway/notify.php&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The notify should contain the following POST fields:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;= value in custom gateway key setting&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;bookid&amp;lt;/code&amp;gt; = the bookid of the booking&lt;br /&gt;
&lt;br /&gt;
These POST fields are optional:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; = booking status, 0 (cancelled), 1 (confirmed), 2 (new), 3 (request) or -2 (nochange)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt; = amount of the deposit collected&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; = description of payment for invoice item&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;payment_status&amp;lt;/code&amp;gt; = status of payment for invoice item&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;txnid&amp;lt;/code&amp;gt; = unique id for this payment to prevent false duplicates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A success will have HTTP 200 response with no text.&lt;br /&gt;
If there is any text content in the response, it will be an error message which means it was not successful.&lt;br /&gt;
&lt;br /&gt;
= Payment gateways with specific requirements =&lt;br /&gt;
The payment values can be first posted to your server. &lt;br /&gt;
Your server can process the data and convert it into the format required by the payment gateway.&lt;br /&gt;
Finally redirecting the guest to the payment gateway with the data in the required format.&lt;br /&gt;
&lt;br /&gt;
Examples where this may be required are adding authorization headers or passwords or transforming the data into a specific format required by the payment gateway.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>