Adding controllers

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

We will have 2 controllers in our module Validation and IPN. Validation controller will be used for validation of your cart and submission of the request whereas the IPN will work when user submits the payment and our server receives payment notification.

Open the controllers/front/validation.php and put following content it.

Here is the elaboration of the important function for validation.php.

postProcess

  • This function envokes when user selects EasyPaisa payment from payment selection screen. 
  • It then call the function to generate EasyPaisa payment token.
  • Create the order and sends the email.
  • and finally displays confirmation page.

Another file is controllers/front/ipn.php. Now open the controllers/front/ipn.php and put following content it.

This is a simple controller which, upon initialization, updates the status of the order. Email goes out to customer upon status change.

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