Jump to content

How to call Function validateOrder from classes/paymentModule directly?


beebee1987

Recommended Posts

Hi, everyone

 

I am from Malaysia and sorry for my poor english.

 

My question is, could I direct call a validateOrder function from classes/paymentModule?

 

Because I'm using local Payment Gateway, It is facing an issue frequently is some customer puchase items, the payment gateway has data but admin site of Prestashop do not have.

 

The solution provided from local payment gateway is called PSQ (MERCHANT REQUEST APIs), which is let me request data from them and then Insert into Prestashop system.

 

Anybody has idea?

 

One of the data get from payment gateway is ReturnUrl, ReturnURL is let me process the data.

 

So, how do I direct call validateOrder function inside ReturnURL to let me insert to Order table instead of I manually Key In data in admin?

 

Thanks!!!

 

Link to comment
Share on other sites

I assume you have a payment module already that handles sending the customer to the payment gateway website?

 

If so, you would need to add a payment module controller class to this module that is used as the return url.  You could use the bankwire module "controllers/front/validation.php" as a template.

 

 

 

This class would need to validate that the payment was successful using the API provided by your gateway, and if successful it would invoke the validateOrder function and create the order.

 

If you are looking to hire someone, send me a PM and we can discuss the details.  Be prepared to shared your payment gateway integration documents

Link to comment
Share on other sites

  • 2 years later...

$this->module->validateOrder($cart->id, Configuration::get('PS_OS_PAYMENT'), $total_paid, $this->module->displayName.' API', NULL, $extra_vars, (int)$currency->id, false,$customer->secure_key);

Just use this to call a validate order function from core classes after payement get successful.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...