Forums / Developer / howto not delete eZPaymentObject
Sylvain Gogel
Monday 22 June 2009 8:46:11 am
Heya there,i got a customer request to send by mail the payment method used during shop checkout.
investigating bigEZ i found out that eZPaymentObject are removed from db at some time which prevent my custom ConfirmOrderHandler to find payment method.
$payment = eZPaymentObject::fetchByOrderID( $order->attribute( 'id' ) ); $tpl->setVariable( 'payment', $payment); $templateResult = $tpl->fetch( 'design:shop/orderemail.tpl' );
ps: i'm running ez4.0.1
-- http://www.ecedi.fr Agence Web, Créa/Conseils, Accessibilité eZPublish, Drupal, Zend, Symfony
Heath
Monday 22 June 2009 2:00:29 pm
Hello,
Ahh email notification containing payment method. This is a common request. Though I imagine you'll solve it differently than others.
Most payment gateways (like say the default ezredirectgateway) includes a 'cleanup' function which appears to remove the eZPaymentObject from the system when called.
I would need to know what payment gateway you are using in order to tell you how to disable this call accurately. The objects appear to be removed after the customer is redirected back from the payment gateway service provider (after entering customer payment information securely). Exaqmple
See: <i>http://pubsvn.ez.no/nextgen/trunk/kernel/shop/classes/ezredirectgateway.php</i>
/*! Removes temporary eZPaymentObject from database. */ function cleanup( $process, $event ) { //__DEBUG__ $this->logger->writeTimedString("cleanup"); //___end____ $paymentObj = eZPaymentObject::fetchByProcessID( $process->attribute( 'id' ) ); if ( is_object( $paymentObj ) ) { $paymentObj->remove(); } }
Cheers, Heath
7x | https://se7enx.com/ Brookins Consulting | https://brookinsconsulting.com/ Certified | http://web.archive.org/web/201012...th.ez.no/certification/verify/380350 Solutions | https://projects.exponential.earth/users/community/brookins-consulting eZpedia community documentation project | http://ezpedia.se7enx.com
Tuesday 29 September 2009 6:04:40 am
Hey, sorry i'm late to answer
Pb is still up to date, Actualy i'm using two custom built payment gateway
i hope i only have to override the cleanup method. Will keep you in touch