There is an updated version available of this page

Tutorial: Add Payment to an Appointment Booking System

This tutorial will show how to accomplish the following:

The payment system can be also used in connection with a credit system, this is explained in the Advanced Pricing tutorial. There is also functionality for electronic coupon codes, this is explained in the documentation on Coupons and vouchers.

You can choose to handle payments yourself or use PayPal, one of the largest payment providers in the world. If you handle payments yourself you have to approve each booking on the site after you receive payment, if you use PayPal bookings are approved automatically when payment is received. A PayPal account is free and your clients are not required to have a PayPal account too. They can pay using their credit card, much like a normal merchant processing experience.

Set up a basic appointment booking system

For the purpose of this demonstration we will create an appointment system for a conference organizer. You can equally well use this tutorial to set up any other appointment booking system that needs a payment system; it should be straightforward to change the example to fit your specific application.

If you don’t have a schedule set up yet you can create one with the “New Schedule” wizard, or you can use one of the tutorials to help you along. In our example we want to allow more than participant to visit our conference, obviously, so we create a “Capacity” type schedule for this example. The steps below look slightly different for a resource type schedule.

We make some changes to the default setup to fit with our particular purpose. First of all we have to add a price, obviously. We do that on the configuration page, “Resources” tab, by ticking the box “Add a price field” at the bottom of the page and optionally enter a default amount to be used when creating a new slot.

For this example we also change the setting "Term used to describe a spot…" from “slot” to “other: conference”. This is, of course, optional but changing the terminology can help to better understand what is happening. This will cause any error messages or emails to use the appropriate term. Similarly, we can change the word “user” to “participant” on the “Layout Settings” page.

New conference dialog

Create something for people to book

Next we click the “Use” button to go to the schedule to create a slot for a conference that people will be able to book. We go to the “Month” calendar, but another view such as the “week” view would have been fine too. On the “Layout” tab you can specify which one you would like your clients to see.

Month view with the newly created conference

We click an empty spot on the calendar to make a ‘New Conference’ dialog appear and we fill out the details and enter a price. Make sure the price you enter is at least $0.10, otherwise the automatic payment system later on will not work. If you are using a resource schedule, then you wouldn’t need to do this step, clients can then just pick an empty spot to book.

Payment flowchart

Set up automatic payment

To change the process flow to include a payment step we go to the “Process” tab. Under the heading ‘Require payment or approval?' we select “Complete payment before continuing”. Next we visit the ‘Payment Setup' page to define the kind of payment step we want. This page can be found by going to the dashboard (by clicking the link in the top right corner) with the link in the menu on the right. Here we switch the Gateway mode to ‘PayPal – Automatic' and save the page. The ‘Manual' option is intended for when you want to handle the payments yourself; we will come back to that later. The rest of the configuration is done on the PayPal site.

PayPal sign up

Set up a PayPal account

Payment for SuperSaaS is handled through PayPal, one of the largest payment providers in the world. The advantage of using PayPal instead of handling credit cards on SuperSaaS is that you and your customers don’t have to trust anyone with your credit card details, except PayPal. Also, it is free to set up and free for your customers to use. They will charge you a small percentage from any payments you receive, see their site for more details. Set up only takes a few simple steps:

When a customer books, the booking is put into your schedule right away to avoid anyone else taking the same spot, but it is marked as pending until payment is received. SuperSaaS does not rely on the connection that your customer has with our site. If they close their browser half way during a transaction or their computer crashes you will not have a booking that is not paid for in your schedule. The SuperSaaS server has a separate (encrypted) connection to PayPal and for each booking confirms that the amount and currency received match our records. Email confirmation to you and the client are only sent out after payment is confirmed. If payment somehow fails then the pending booking is removed from your calendar after 15 minutes. (If payment comes in after that time the booking will be reinstated)

You can add a tax to payments inside your PayPal account and it will be added at checkout. If you want to give a discount to an individual customer you can put a percentage such as "−10%" in the supervisor field of that customer on the “User Management” screen. The discount will be calculated on the total amount and is applied only at checkout (so not for credit payments). You can enable the supervisor field on the “Access Control” screen and change the field for individual customers on the “User Management” screen.

Try out the automatic system

The payment settings page has a ‘Test mode’ setting for the gateway at the bottom of the page, which will send any payments to a special test (“sandbox”) gateway. You don’t really need this setting because you can just try out the system by making a booking and then reverse it again, on the live system. However, PayPal will charge you a fee for the refund ($0.30 or €0.35 depending on currency used). If you want to avoid that charge, or if you want to do more extensive testing then see the explanation of the test gateway later on. It is generally a good idea to get a realistic view of what your clients will see before you go live with the system. Note that you will need to log out as administrator to make sure that the process works as expected from a visitor’s point of view.

Checkout screen

So to try out the system we create a customer log in and make a reservation for the conference. If you don’t see a payment page check during the booking process here are a few things that might cause the problem:

If you purchased more than one item it will show a calculation on the payment page. But if your application only allows a quantity of one the system is smart enough not to ask the client to enter a quantity, and no calculation is shown. Once the booking is paid all confirmation emails will get sent. Note that PayPal does not allow you to send money to yourself, so you will have to use another credit card or PayPal account. You can then log into your PayPal account and refund the charge (be aware that PayPal charges a refund fee since August 2010).

Within a few minutes after you have refunded the amount through PayPal the reservation should be deleted. You can find out what happened to a reservation by going to the ‘Supervisor’ screen and click the ‘Details’ spyglass for a slot. This will reveal a ‘Show Trash’ option that shows deleted items. The payment indicators will explain whether a reservation was deleted because of a refund or any other reason. Note that if you, or your clients, cancel a reservation on the SuperSaaS it will not be automatically refunded. However if you refund a reservation through PayPal, the corresponding reservation will automatically be cancelled at the SuperSaaS site.

If need to do more extensive testing or want to avoid refund charges then you can use the test gateway. You will first need to create a PayPal developer account. Then, within the development sandbox, create fake PayPal accounts for a receiver and a sender. It’s a good idea to pick a different password in the sandbox so you can’t accidentally log into your real PayPal account. Make sure you remain logged in to the developer sandbox in another window, switch the gateway mode to ‘Test’, and try out your SuperSaaS system. All actions on the PayPal site will be fake: no emails will be sent and no payments will be made. All actions on the SuperSaaS will be treated as ‘real’: bookings will be marked as confirmed, and emails will be sent.

Manual approve dialog

Overriding the payment indicator

Sometimes you want to override the approval process manually. When you are logged in as administrator you will see an ‘Approve’ or ‘Revert’ button when looking at the reservation details with which you can manually override the status. For example you may want to mark something as paid with ‘Approve’ because you want to give away a reservation for free, or you have received payment through another channel.

You should not need to manually change the payment status for a cancellation. If you refund the payment through PayPal the reservation will automatically be marked as refunded and moved to the trash after a few minutes. If a client abandons an automatic payment by closing his browser window, the reservation is automatically cancelled after 5 to 10 minutes to avoid claiming a space. If a payment comes in after an automatic timeout it is automatically reinstated from the trash. In this case there is a small chance that another client has taken the spot in the mean time and filled it to capacity. If that happens the client will be put on the waiting list or marked as overbooked depending on the setting in the ‘Resource’ configuration screen.

Set up manual payment

There are two ways of manually handling payments. Which one you need depends on whether or not you can accept credit cards. The first option, without credit cards, is the simplest. It displays payment instructions that you provide and you go to the site and click the ‘Approve’ button for any reservations for which you have received payment. This is particularly useful to request checks or bank transfers (which are more common than credit card payments in many European countries). To enter the payment instruction that will be displayed upon check out go to the configuration screen, ‘Layout’ tab. The field ‘Message to display at the checkout screen’ is near the bottom of the page. Here you can enter an instruction such as “Send a check made payable to ‘My Company’ to my address”. Please note that it is not appropriate to ask people to fill out credit card information in the custom fields, since those are sent across the internet unencrypted. You can ask customers to phone in credit card details, but you would probably want to use the other option: “Manual – Credit Card”.

Collecting Credit Card Information

The “Manual – Credit Card” option can be used to collect credit card information from your clients. Upon creating a new reservation the customer is taken to a checkout screen on a secure server where he can safely enter credit card details. Note that credit card companies do not allow one to store the so-called CVC code of the credit card so that information is not obtained. There are several things you can customize on this screen. Firstly, you can provide additional payment conditions or instructions, you do this on the Configure screen, Layout tab. Secondly, you can define which credit card types you accept. You do this on the Payment screen. You can also choose to skip that question by deselecting all card types. Thirdly, by setting the price to zero no pricing info is displayed, which is useful if you just want to collect the credit card information to capture an authorization. The advantage of specifying the card types is that SuperSaaS will do a rudimentary check on number length, starting digits and a checksum, which helps avoid typing errors. One thing you cannot do is display a custom domain name on the payment screen because browsers will only set up a secure connection with servers that have appropriate certificates. The software will automatically change the domain when the client enters the secure server, and as soon as he leaves the payment screen it is switched back to the custom domain.

When your clients enter their credit card information on the checkout screen, how does is get to you? For security reasons it is not possible to send credit card details by email so you will have to come to the site to retrieve the information. To facilitate this process you can specify that you want to receive email for each transaction with a check box on the Configure screen, Process tab. This email contains a direct link to the secure server where you log in with your account name and password. You can also choose to receive a daily overview on this screen. The overview can also be sent to several people at once. Reservations that have credit card information will contain a link beneath their status icon to display it. Only the administrator and superusers can view this information when they are logged in. To see the full details you need to click the ‘Reveal’ link to switch you to an encrypted connection that can safely send the credit card details.

Try out the credit card payment process

Log out to make sure you see your schedule exactly as your clients would see it, and navigate to the web address for your schedule. When you make a booking you should now be asked for your credit card details. You can enter any valid credit card number, or use the fake Visa card number 4111 1111 1111 1111. The customer will see their booking marked with a “P” which displays ‘Payment authorization pending’ when they hover over it. Customers will be able to get back to these details by clicking the ‘P’ icon. Log out and back in as administrator. You should see the same ‘P’ icon as before, but now an ‘Approve’ button is available when you look at the reservation details. If you don’t want to approve it you can simply click ‘Delete’. If you change your mind later on you can go to the trash on the ‘Supervise’ screen (click the spyglass icon next to the slot you want to inspect) and reinstate it as pending or approve it after all.


Next chapter: Advanced Pricing Options