onPaymentNotification method

  • Posts: 120
  • Thank you received: 2
9 years 10 months ago #186380

Sorry dear Nicolas I want to send a notification Email on my developing payment plugin. In my Plugin when verify my payment I want send in notification Email bank transaction id to my customer but I cann't send transaction id with payment notification Email
I'm using this code in verify part and it's not work

$email->body = JText::sprintf("Hello,\r\n Payment received with bank transaction id:".$transaction_id)."\r\n\r\n".$order_text;
I'm attach my email picture only send this email when verify my payments

Attachments:
Last edit: 9 years 10 months ago by kaya.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 10 months ago #186396

Hi,

Ok, that's better :)

So, first, the code

$email->body = JText::sprintf("Hello,\r\n Payment received with bank transaction id:".$transaction_id)."\r\n\r\n".$order_text;
that you have in your payment plugin is to send a payment notification to the shop owner, not the user, so add the transaction_id there won't make it appear on the email for the customer.

Second, the screenshot in your last message comes from the order creation notification which is sent at the end of the checkout process, before the user is redirected to the payment gateway and enter his credit card. So it is impossible to add the transaction id in that email since when that email is sent, no transaction has yet been done.

A second email is normally sent by the system when the order is confirmed by the payment plugin when it receives the payment notification from the payment gateway, but only if you set the $history parameter of the modifyOrder function to true and that the payment notification is actually received by your payment plugin.
So in that case, you would actually need to modify the code of the email via the menu System>Emails to display the transaction id and not modify the code of your payment plugin.
So for example, you would add such code in the email HTML version:
<?php echo $_POST; ?>
supposing that your payment gateway set the transaction id in a transaction_id parameter of the POST request sent to your server for the payment notification (probably something else, I'm just providing an example here).

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum