WPPizza – A Restaurant Plugin for WordPress › Support › Add-Ons › Gateways › Epay.dk (Payment Window) › Warning epaydk payment error
- AuthorPosts
- 7 April, 2018 at 11:54 pm #36590
Hi olly,
Lately i have had a lot of payments that get a warning message. Those orders are not being printed via the google plugin.
Here is a link to the debug log:
http://qadar.dk/debug.txtIn the next post i will add the email warning
7 April, 2018 at 11:55 pm #36591This reply has been marked as private.8 April, 2018 at 12:01 am #36592This reply has been marked as private.8 April, 2018 at 12:57 am #36593This reply has been marked as private.8 April, 2018 at 1:22 am #36595This reply has been marked as private.8 April, 2018 at 3:36 am #36597This reply has been marked as private.8 April, 2018 at 10:03 am #36601This reply has been marked as private.8 April, 2018 at 10:43 am #36602ahh, now that makes sense , because it means that the notification message (at ipn.php) gets sent multiple times back to the server as otherwise you would not ever receive the normal order confirmation email
(this seems to happen only sometimes from what i can see and for reasons only ebay would be able to track down. might be waiting for a timely server response or any other reason, i don’t know)in a nutshell, the order execution goes like this (there are a few other steps , but to keep it simple)
notification received at ipn, look for an order that has status “inprogress” or “unconfirmed” for that id.
if found, execute order, sending emails etc. once that’s all happened set status to “completed” – doneif the same ipn gets sent again, it will be looking for that “inprogress” status , however, it does not exist anymore as it is now “completed” (as we do not want to execute that order multiple times of course)
that’s as an explanation and it’s the only way i can see this happening
as there is a possibility somewhat, that other gateways might do the same, i will add something to the plugin (that’s the main wppizza plugin) to account for this. As I am in the middle of tearing a number of things apart an update is quite a few days away yet, so in the meantime, you could edit a corefile as follows (assuming you are familiar with simple php editing)
in
wp-content/plugins/wppizza/classes/class.wppizza.order_execute.php
you will find at approx line 1166/* error details */ $result['error'][] = array( 'critical'=> $critical, /* force sending of email to admin */ 'error_id'=> 30007, 'error_message' => __('order not found using order id','wppizza-admin'), 'wp_error' => '' ); /* logging, and sending */ $this->gateway_logging($result['error'], $gateway_reply, $order_id, $this->wppizza_gateway_ident, 'get-prepared-error'); /* ipn, just return false ! */ return false;
edit this to be the following
/* if we receive ipn notifications multiple times for the same order, the status will already have changed to completed, so before throwing errors, check if that is the case and if so , simply ignore */ $order = WPPIZZA()->db->fetch_order_details(false, $order_id, false, array('COMPLETED'), $wp_user_id); if(!empty($order)){return;} /* error details */ $result['error'][] = array( 'critical'=> $critical, /* force sending of email to admin */ 'error_id'=> 30007, 'error_message' => __('order not found using order id','wppizza-admin'), 'wp_error' => '' ); /* logging, and sending */ $this->gateway_logging($result['error'], $gateway_reply, $order_id, $this->wppizza_gateway_ident, 'get-prepared-error'); /* ipn, just return false ! */ return false;
save (and make a test order i would suggest)
i’ll add something like that to the next update
if you still have issues once this is added, please let me know.
while making sure that this works, maybe you could also perhaps enable
“Log successful orders” /wp-admin/edit.php?post_type=wppizza&page=settings for a few days
as it might give us a better idea/clue in case the above does not rectify the issue(if it all works , after letting things run for a while, you can turn this off again)
- AuthorPosts
- The topic ‘Warning epaydk payment error’ is closed to new replies.