API Overview
Application Programming Interface: Absolute freedom
When you're reading this, you've probably already read about or even played with a Payalogue to handle Zaypay payments fast and easy. Nice isn't it? Making payments easy is our specialty. However, your clever idea for an online service might require a different approach than provided by our Payalogues. Checkout the sidebar for an example of such a case, or cut right to the chase below to get an overview of what's technically possible.
Your app and Zaypay keeping each other POST-ed.
Using our API enables your application to talk with Zaypay directly, and allows Zaypay to talk back to your application. Your customers might not even know that Zaypay is working hard in the background to make all this happen. Your visitors just use your service and pay for it through a payment process controlled by your own application.
There's only a few topics your application and Zaypay can discuss through the API. We'll talk you through them here. The nitty gritty of the exact URLS and their parameters or classes can be found in the Api Integration Guide. Let's go through those API-calls in a logical sequence.
Price Setting required
When logged in to your free Zaypay account, you can create so-called 'Price Settings'. A Price Setting defines what countries and payment methods you want to support and is the base for working with the API. You can dynamically choose the amount to be paid through the API (though you could also choose not to do this, and use the amount setup in the Price Setting). The API won't go outside the boundaries of what you chose to support in the Price Setting you're using it with.
Tech details, language specific classes, plugins and other tools
You can read all the actual technical details - about URLs and variables - in the Api Integration Guide. This guide provides all the details of the communication on the lowest level. However, there are Zaypay Classes, Zaypay Plugins and other tools available for a couple computer languages and frameworks, which are easier to use than developing your own interface with the Zaypay API. A list of these and links to the downloads are also provided in the Api Integration Guide.
API flowsheet
Below you'll find a short example of the Zaypay API flowsheet. You'll notice the API can do a lot more for you then only process a payment. It will also help you with the text for you customers in their own locale.
- Zaypay determines your customers country and assumed language
You use the locale_for_ip method of the API to send us the IP of your customer. The API answers with your customers locale (country & lanugage). - You let your visitor confirm the country and language
You use the list_locales method to get all supported countries and languages and show a list to your customer with the locale from step 2 preselected. In most cases your customer will just have to confirm this, not change it. - You let your customer select a payment method
You show the customer the list of payment methods that you chose to support for his country. This list can be fetched with the list_payment_methods API method. - You let Zaypay prepare the payment
You command Zaypay to prepare that payment for the selected payment method. Zaypay does so and responds with all the information of the prepared Payment. The API method create_payment is used for this. - Show the instructions to you customer
From the last response Zaypay gave you, you can build the page to show your customer what to do to make the payment. Instructions for your customer are passed through by the API in the selected langague. - Your customer follows instructions and makes the payment
Your customer makes the actual payment. The payment changes status. You are notified (Report URL) of this and you use the show API method to fetch the Payment object and check if it was actually paid for. - You provide the customer with the product / service
You can now provide the customer the service that was paid for.
Who needs the API?
Anyone can fool around with our API, it's just as free as everything we provide (and fun to play with!), but sometimes you downright need more control. Let's imagine a situation in which this would be the case.
damn-fast-downloads.com free last time we checked!
Say you're fed up with always waiting in line for downloads of updates to your favorite online game. You're the scratch-that-itch-yourself kind of person and decide to build a simple site where people can blazingly fast download updates after making a small payment.
You could use the API here. Zaypay sports the Download Payaloque that does just this and although the maximum file-size is a fair 20MB this is not enough for most game updates. You could also use the Integrated Payalogue but you're a little stubborn and want those downloads to start during the payment-process.
You need to host those files yourself and provide access to them after you detect a payment has been made. So your application needs to be able to setup a payment in the Zaypay system, on your behalf. When the payment is done, you need the Zaypay system to communicate this to your application. All of this must be done "in the background". This means, not through the browser of the customer, for security reasons.