Print

Tutorial: Add Payment to an Appointment Booking System

This tutorial will show how to accomplish the following:

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. PayPal offer other advantages such as the ability to use gift certificates. 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.

First of all log in to your SuperSaaS account, or create one if you haven't already done so. This takes you to the Dashboard page where you can select the option 'New Schedule' from the right hand menu. Next, the 'New Schedule Wizard' appears. Carefully consider whether you are going to need a 'Capacity' or a 'Resource' type schedule in the first step, this is the only setting that cannot be changed afterwards. We want to allow more than participant to visit our conference, obviously, so we select a 'Capacity' type schedule for this example. Click 'next step' and fill out a name for the schedule, our example uses 'Conference'. The next screen asks details about the capacity. Our conference can hold 50 people, takes 1 day, and a waiting list should appear once it's full. When you click 'Finish' the empty appointment booking system will be created.

Customize the basic system to fit our purpose

Next we want to make some changes to the default setup to fit with our particular purpose. Click the 'Configure' button in the top right (or, if you are back at the dashboard page, click the configure button next to the schedule). Select the 'Resources' tab and make the following changes:

Save the changes by clicking "Save changes" at the bottom. Changing the terminology as we did in the last step is of course optional, but it can help your client better understand what is happening. Similarly, we can change the word 'user' to 'participant' in the 'Layout Settings' menu item on the dashboard page. This will cause any error messages or e-mails to use the appropriate term when referring to a client.

New conference dialog

Create a new 'Conference'

Click the "Use" button to take you to the calendar screen where we will create an entry for a new conference that people can later book. Because we have selected that a conference takes a full day the system takes us to the month calendar. If your event takes less time you would see a week calendar instead. You can change this preference in the layout options also.

Click on the calendar and a 'New Conference' dialog will pop up where you can fill out the details of the conference. Make sure the price you enter is at least $0.10, otherwise the automatic payment system later on will not work.

Month view

By default the wizard creates a booking system where anyone can see the schedule, and people will have to register to make an appointment. This is appropriate in this case but you will probably want to customize the schedule to change the level of detail displayed so that participants can no longer see who else registered in the 'Configure Access' tab. This is especially important of you intend to collect confidential information.

Payment flowchart

Set up automatic payment

Click on the 'Configure' button, if it is not already highlighted and then click the 'Process' tab. Under the heading 'Payment or approval' you can select 'Complete payment before continuing'. You may want to change a few other options on this page, for example to obtain additional information from the client when he makes the appointment. Click 'Save changes' and go back to the dashboard by clicking the link in the far top right corner. On the dashboard page click 'Payment Setup', the last option in the menu on the right.

Switch the Gateway mode to 'PayPal – Automatic' and save the page. The rest of the configuration is done on the PayPal site. The 'Manual' option is intended for when you want to handle the payments yourself; we will come back to that later.

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:

Note that no encryption is used between you, your customer and SuperSaaS. The reason this is safe is that we don't need to trust any interaction with a customer: Once a payment comes in the SuperSaaS server sets up a separate (encrypted) connection to PayPal and confirms that the amount and currency received, as well as the beneficiary, match our records.

You can add a tax to payments inside your PayPal account and it will be added at checkout. You can also give a customer an individual discount by putting, for example, "-10%" in the supervisor field of that user on the user management screen. You can enable the supervisor field on the "Access Control" screen and change the field for individual users on the "User Management" screen.

Try out the automatic system

The payment settings page has a 'Test' setting for the gateway mode, 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. To get a realistic view of what your clients will see log out from SuperSaaS and go to the appropriate web address for your schedule. If you happen to have two browsers installed on your system you can pretend to be a regular user in one browser and administrator in another. This trick will not work by just using another window from the same browser: if you log out in one window the browser will log you out in all its windows.

Checkout screen

Create a user log in and make a reservation for the conference. You should now be taken to the payment page. If you don't see a payment page make sure you have set a price of more than $0.10 (the minimum amount allowed for automatic payments). If your application only allows a quantity of one the system is smart enough not to ask the client to enter a quantity, and an amount calculation is not shown. You can pay for a booking and check that all confirmation e-mails get sent as appropriate. 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).

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. The receiver should have the e-mail address that you use as your administrator e-mail. 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. It is also possible that you want to delete a payment received for one and use it for another event at a later date.

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). First, enter the payment instruction that will be displayed upon check out. You do this by going to the 'Configure' screen for the schedule and then click the 'Layout' tab. The entry '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 second 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 user is taken to a checkout screen on a secure server where he can safely enter credit card details. There are several things you can customize on this screen. First of all you can display a price, a quantity and a total. But 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. Secondly, you can provide additional payment instructions, for example to specify terms, you do this on the Configure screen, Layout tab. Thirdly, you can define which credit card types you accept. You do this on the Payment screen. You can also choose to skip that question. 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 use a custom domain name on the payment screen because browsers will only set up a secure connection with servers that have appropriate certificates. The server 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 e-mail so you will have to come to the site to retrieve the information. Reservations that have credit card information will contain a link beneath their status icon to display it. Only the administrator and super users 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. To facilitate this process you can specify that you want to receive e-mail for each transaction with a checkbox on the Configure screen, Process tab. This e-mail 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.

Try out the manual 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. Create a reservation and ensure that the payment details are correctly displayed. Users will be able to get back to these details by clicking the 'P' ('Payment authorization pending') icon next to the reservation in their agenda overview. 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.

Use the credit system for discounts or to pre-approve a set of bookings

When you switch on the credit system it will add a "credit" field to every user. If a client has a credit then it will be applied towards the next purchase he makes. You can change the credit a user has on the User Management screen. If a client has a non-zero credit it will show in the top right corner of his screen (he cannot change it, of course). There are two situations in which the credit system is useful. First of all, you can simply give a credit in dollars (or another currency) to give a discount towards the next purchase. This can be useful if you want to refund the cost of a booking so people can book again without money changing hands. You can even give an unlimited credit, in case you have some other payment arrangement with him. The second way in which the credit system can be used is to allow people to pay for a set of things. For example, you could ask a student to pay $200 for a set of 10 lessons of $20 and let him book those lessons without paying for each one. In this case it may be preferable to work with 'credits' rather than a real currency, so you would sell 10 credits for $200 and the lessons would cost 1 credit each. The "credits" function like a regular currency (you can price something at 1.5 credits, for example) but can only be obtained upfront. When using a regular currency you can partially pay for an item with credit and pay the rest with real money, with credits that won't work, of course.

If a client cancels a booking that was (partially) made with credit then the credit will be returned to him. Therefore, you may want to ensure that clients cannot cancel bookings that have already taken place (on the Configure screen, Process tab). This can get quite sophisticated: When a client creates a repeating booking and pays for it with credit, the credit will be spread out over the bookings, so a partial credit is returned if he cancels just one booking. If he partially paid with credit for a repeating booking, the credit is applied to the last bookings in the series. If a client partially pays with credit and the PayPal or credit card transaction takes too long to complete, the credit will be returned to him when the process times out. The credit will be taken away again if the transaction still comes through after the time out. If an administrator manually reinstates a booking that was moved to the trash credit is unaffected.

Shop

Selling credit or items in the shop

There are several ways to give your users credit:

  1. Set a starting amount of credit for new users in the sign up process on the Access Control page.
  2. Sell credit to your users yourself and manually update their credit levels on the user management screen.
  3. Use the shop to sell credit via PayPal and have them automatically added to the users' account.

Your shop won't be visible unless you have at least one item defined for sale; you can define new items for your shop on the Shop Management screen. This screen can be reached by clicking the "sell credit" link in the Credit System section of the "Payment Setup" screen. Once you have an item in your shop there will also be a link to the Shop Management screen in the right hand menu on your dashboard. The options on the Shop Management screen should be largely self-explanatory. You could define a product to be "$100 for a package of 10 credits", for example, or you can ask your client to enter a number of lessons they want to purchase in one go and set a price per lesson. You can also set credit to zero, in case you want to sell something else, like a T-shirt, through the shop. In that case you can use the "Inventory" field to ensure that you are not overselling an item. You can set a tax and/or shipping charge inside your PayPal account and it will be added at checkout. Finally, you can also set the credit to unlmited by entering a dash (-).

If you want to give an individual customer a discount you can do that by putting some like -x% in the supervisor field of that user, where x is the discount percentage, as is explained earlier in this chapter. Note that the discount gets applied at the PayPal checkout, it does not get applied when a user books with credit to avoid applying the discount twice.

How will customers find your shop? The system will automatically show a link to buy credit above the schedule if a user has no credit and you have at least one item defined in the shop that yields credit. This link is in the "auto text" above the schedule so it won't be visible if you've put your own text there, but you can reveal it again by adding the magic word $auto to the text. You can also add the magic word $shop to the text above the schedule, this generates a link to the shop that is always visible, even if the user has enough credit. Note that a user must log in before he will be able to use the shop. To change the text above the schedule click the configure button, choose the "Layout" tab, and in the box "Message to show above the schedule" enter something like: "Please buy a T-shirt in our $shop". There is one more way for your user to arrive in your shop: when a user clicks his "Your Settings" link there will also be a "Buy credit" link next to his credit level (only visible if there is something appropriate in your shop, of course).


Next chapter: Create a custom URL | Back to Tutorial index