Easypaisa module creation and basic functionality

This post is continuation of the series of posts on EasyPaisa integration on Prestashop

For reaction of the module we will replicate the other payment module because all the hooks required for payment processing and validation are already implemented in it. With this we can focus on the work related to EasyPaisa only.

You can just copy/paste any of the payment module and rename the folder and files within it. Your module should look like something similar to this.

Now open easypaisa.php and put following content in it.

In above code, you will need to populate variables with your EasyPaisa account details.

Now, lets try to get an understanding of what actually the mentioned code does.

The above code defines a class EasyPaisa. This is the module class for EasyPaisa to work. Below is the list of function and their functionality.

install
  • This will install the module. 
  • Create a new database function with name ep_payment_token to hold the payment tokens generated by EasyPaisa.
  • Register a new order status with label "Awaiting Easy Paisa Payment".
hookPayment
  • It will display EasyPaisa payment option on payment option selection page.
initiateTransactionRequest
  • It will send request to EasyPaisa for generation of payment token. If you are using older version of PHP you will need to add PHPSoap support to you server. 

Comments

  1. i am unable to make the tpl file that's why i am unable to post some token.
    and get the user detail's

    ReplyDelete

Post a Comment