Forums / Developer / howto not delete eZPaymentObject

howto not delete eZPaymentObject

Author Message

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

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Sylvain Gogel

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

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony