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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 16:08:49
Script start
Timing: Jan 18 2025 16:08:49
Module start 'layout'
Timing: Jan 18 2025 16:08:49
Module start 'content'
Timing: Jan 18 2025 16:08:50
Module end 'content'
Timing: Jan 18 2025 16:08:50
Script end

Main resources:

Total runtime0.7799 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 587.9219152.6250
Module start 'layout' 0.00600.0030 740.546939.4453
Module start 'content' 0.00900.7681 779.9922547.8750
Module end 'content' 0.77720.0026 1,327.867212.1563
Script end 0.7798  1,340.0234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4558160.0002
Check MTime0.00160.2095160.0001
Mysql Total
Database connection0.00100.122210.0010
Mysqli_queries0.720492.3729570.0126
Looping result0.00050.0664550.0000
Template Total0.747995.920.3739
Template load0.00290.372120.0015
Template processing0.745095.523120.3725
Template load and register function0.00010.016010.0001
states
state_id_array0.00120.154510.0012
state_identifier_array0.00170.221720.0009
Override
Cache load0.00190.2393240.0001
Sytem overhead
Fetch class attribute can translate value0.00090.111820.0004
Fetch class attribute name0.00120.147550.0002
XML
Image XML parsing0.00260.328520.0013
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00300.3869230.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs