Payalogue Usage Guide
Payalogues are the easiest way to integrate Zaypay into your website without the hassle of having to code yourself. This document explains the types of Payalogues available and what you can do with them.
The Site Access Payalogue allows you to grant access after payment, and revoke access after a configurable time, without any knowledge about coding. The instructions for this type of Payalogue are specific and should be read from the Stats & Integration page of the specific Payalogue. The rest of this page is applicable to the types, but not to the Site Access Payalogue. Your webhost needs to support PHP if you want to use this.
An integrated Payalogue is the most simple Payalogue available. All it does is provide for a dialog to perform a payment, that's it. This is ideal if the service you offer is already provided for on your site and you just want the custumer to pay.
The name says it all! A donation Payalogue allows you to put a premade donation button (or a custom button if you prefer) on your website, to let your visitors make a donation to you. Donations can be made anonymously, but you can also specify for a donator to give his or her name, e-mail address, phone number and/or give some additional comments.
If you've decided to give any of the three Payalogue types described above a try, you'll see that you can click a 'Stats & Implementation' link. Besides showing you great statistics when payments for that Payalogue are coming in, it'll also tell you what you need to put into your webpage to make that Payalogue work. Lets go over this with a quick example. Assume your website is as simple as this:
<html> <head> <title>My website</title> </head> <body> <h1>Welcome to my website!</h1> </body> </html>
To integrate the Payalogue in your website, take the first line of the code and put it in between your <head></head> tags, like this:
This line is the same for each Payalogue you want to integrate into your website, except for the number in the URL. In this example the number is 1, but in your case it has to be the number of your Payalogue. You do not need to worry about the numbers, if you just copy and paste from the Payalogue code sample view.
The second piece of code you need to paste is the actual link to the Payalogue, which needs to be put somewhere in the body of your website, like this:
<body> <h1>Welcome to my website!</h1> <a href="http://www.zaypay.com/pay/1" onclick="ZPayment(this); return false"><img src="http://www.zaypay.com/pay/1/img" border="0" /></a> </body>
That's it! Just reload your webpage and let the payments flow.
In the example explained above, you've cut-and-pasted the code from the Payalogue statistics page into your website. This resulted in a clickable button you have selected when you created the Payalogue. If you want to have a custom button or text, just replace the <img /> tag, like this:
<body> <h1>Welcome to my website!</h1> <a href="http://www.zaypay.com/pay/1" onclick="ZPayment(this); return false">Click me!</a> </body>
Of course, instead of the text Click me!, you can place your own <img /> tag there to point to a picture on your website.
More advanced users would like to pass custom parameters for each payment. This can be useful when the Payalogue links are dynamically created for users logged in to their site, for example. These parameters are stored for each payment, so they can be viewed by your Transactions viewer or caught by your report_url script. An example of passing the arguments name=Zaypay and state=cool looks as follows:
<body> <h1>Welcome to my website!</h1> <a href="http://www.zaypay.com/pay/1?name=Zaypay&state=cool" onclick="ZPayment(this); return false">Click me!</a> </body>
If you're a more advanced user of the Zaypay services, you might want to have full control over each payment status. The Report URL field allows you to specify a URL on which you receive status reports. This overwrites the Report URL from the price setting this Payalogue is attached to, so you'll only receive reports on the one specified in your Payalogue. If you're using custom parameters in your Payalogue like mentioned above, these will be sent along with the Report URL.
For more information about Report URL, see the Api Integration Guide.
The custom parameter example as described above is very simple, but also very open to abuse if you use it in the wrong way. For example, you don't want to pass an internal identifier like a tracking number, since it would be easy for anyone visiting your website to change the identifier into something else. Instead, convert your tracking number to a unique hash. Chances are when visitors try to change the hash, it points to something nonexistent. Ofcourse, this means you'll have to do a hash-to-tracking-number lookup each time you use it.