Writing /home/www/www/webta.net/www/docs/wiki/data/cache/f/f201ac3084c69a640d4b472f26fead23.i failed
Writing /home/www/www/webta.net/www/docs/wiki/data/cache/f/f201ac3084c69a640d4b472f26fead23.xhtml failed

EPP-DRS payment modules API

This document will help you to create EPP-DRS payment module.

:!: You can find sources for PayPal and BeanStream modules inside EPP-DRS SDK.

Essential requirements

EPP-DRS payment module is a folder inside module/payments. Folder name is the name of your module. Module folder must contain at least one file named class.PaymentModule.php. This file must contain PHP class called MyPaymentModule, where My is the name of your payment module. :!: Module folder must also be named My in this case.

The class must conform the following requirements:

  1. Extend AbstractPaymentModule
  2. Implement either IPostBackPaymentModule or IDirectPaymentModule interface


For example, PayPal module will be defined like this:

class PayPalPaymentModule extends AbstractPaymentModule implements IPostBackPaymentModule
{
}

IDirectPaymentModule or IPostBackPaymentModule?

If your module does not redirect users to external webpage and proccesses your payment internally (for example, using XML-RPC, SOAP or other protocol), and the status of the payment is known immediately, than you must implement IDirectPaymentModule. If to make a payment, user must leave your site and fill forms on gateway's website, then you must implement IPostBackPaymentModule.

IDirectPaymentModule

IDirectPaymentModule contains one single method, ProcessPayment(), which is called when user submits a payment form. See phpdoc for detailed description of a method.

IPostbackPaymentModule

Since this interface describes stateless transactions, it has two main methods: RedirectToGateway() and OnPaymentComplete() See phpdoc for detailed description of each method.

The following proccess diagram will help you understand the ordering proccess flow:

Guide: Creating module using sample

  1. Copy folder from PAPI/samples/PayPal/ or PAPI/samples/BeanStream/ inside SDK to modules/payments inside EPP-DRS.
  2. Rename folder to MyPaymentModule. This will be the name of your module.
  3. Open class.PaymentModule.php and rename the class inside to MyPaymentModule.
  4. Fill all methods.
  5. Create module icon and copy it to www/images/modules/My_icon.gif
  6. Log in to Registrar CP, configure module and try to make a payment using it.

Module icon

You must create an image that will be displayed as a module icon, and copy it in www/images/modules/ModuleName_icon.gif.
You can find a template for creating module icons in resources/www/images/modules/template.png inside SDK.

 
epp-drs.payment.modules.api.txt · Last modified: 2009/02/16 13:18 by marat