Jump to content

Do something while calling actionPaymentConfirmation.


GoksaP

Recommended Posts

Hello!

 

I would like to execute my code while the hook actionPaymentConfirmation has been called.

 

Example:

User is changing order state to PaymentAccepted - and now I would like to execute my code from my module.

How can I do this?

 

 

I have this code:

// this also works, and is more future-proof
public function install() {
	return parent :: install()
 && $this->registerHook('actionPaymentConfirmation');
}[/size][/font][/color]
 public function hookActionPaymentConfirmation($params) {
   return Db::getInstance()->execute('
  UPDATE `'._DB_PREFIX_.'gp_history`
  SET `history_message`= `TEST23`
  WHERE `id_gp_history` = 2');
}

But it doesn't work :(

 

 

Thanks.

Edited by GoksaP (see edit history)
Link to comment
Share on other sites

Hi

I am not sure to understand but try this

public function hookUpdateOrderStatus($params)
if ( !($params['newOrderStatus']->id == Configuration::get('PS_OS_WS_PAYMENT'))  &&  !($params['newOrderStatus']->id == Configuration::get('PS_OS_PAYMENT') ) return ;

 

This is for 'remote payment accepted' and 'payment accepted' order status change.

 

Good luck :)

Edited by math_php (see edit history)
  • Like 1
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...