how to confirm payment with paypal?[solved]

Author Message

ludo thomas

Thursday 01 September 2005 1:14:43 am

after a payment, user is redirected to shop/checkout.
all is working fine.
I use Paypal sandbox for the moment.

Perhaps I should be redirected to orderview?
but I stay on a blank page.
perhaps it's because of a not real payment gateway?

but I would like to display a message that says "thanxs for your payment"...(in a custom template)

I dont know how to redirect from this page.

I try to modify shop/checkout.php but nothing works fine.

Please help..

Kristof Coomans

Thursday 01 September 2005 2:07:42 am

You can make a workflow event type which fetches the template, and let shop/checkout/after trigger a workflow with this event.

Or you can modify shop/checkout.php.

Line 170:

$module->redirectTo( '/shop/orderview/' . $orderID );

You can change it so it redirects to a custom module view:

$module->redirectTo( '/shop/thanks/' . $orderID );

Or you can fetch the template:

include_once( 'kernel/common/template.php' );

$tpl =& templateInit();
$tpl->setVariable( 'order_id', $orderID );

$Result['content'] =& $tpl->fetch( 'design:shop/thanks.tpl' );
$Result['path'] = array( array( 'url' => false, 'text' => ezi18n( 'kernel/shop', 'Checkout' ) ) );

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

ludo thomas

Thursday 01 September 2005 2:30:49 am

thx kristof,
I've found where is the problem:

no problem for template redirection.

but checkout.php just make loop at sleep function here:

 if ( $paymentObj != null )
        {
		echo"paymentobject!=null<br>";
            $startTime = time();
            while( ( time() - $startTime ) < 29 )
            {
                eZDebug::writeDebug( "next iteration", "checkout" );
                $order =& eZOrder::fetch( $orderID );
                if ( $order->attribute( 'is_temporary' ) == 0 )
                {
				echo"order temporary=0 ok<br>";	
                    break;
                }
                else
                {
				echo"sleep<br>";
                    sleep ( 2 );
                }

so , I don't understand what it means exactly

Kristof Coomans

Thursday 01 September 2005 6:22:33 am

I have no experience with the eZ shop functionality, but it seems to wait some seconds until the value is_temporary is 0.

As far as I've studied the code, I think it's waiting for the shop/checkout operation to finish. eZShopOperationCollection::activateOrder uses $someEZOrder->activate( ), which sets is_temporary to 0. The pre-checkout workflow however doesn't finish.

Can you do some virtual payings with the Paypal sandbox? If an order get's payed, it should do a callback to your site and the workflow will finish (and with it the checkout operation).

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Kristof Coomans

Thursday 01 September 2005 6:32:33 am

Can you access the module view paypal/notify_url at your site?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

ludo thomas

Thursday 01 September 2005 6:55:01 am

yes I can access this module
(no kernel error but nothing displayed)

look at this:
http://ez.no/community/forum/setup_design/ezpaypal_extension_order_paid_but_not_validated_on_ez#msg82372

Kristof Coomans

Thursday 01 September 2005 7:07:20 am

In the other thread you write:

<i>in my case server is no visible from the internet so ...no solution for testing it.. :(</i>

If your server isn't accesible from outside, Paypal won't be able to do the callback to the paypal module, and the workflow won't end.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

ludo thomas

Thursday 01 September 2005 7:29:05 am

yes, i do the necessery for it and try to test after.
thx for your attention

Xavier Dutoit

Thursday 01 September 2005 7:53:47 am

Kristof is right, your server has to be accessible from the internet.

FYI, you have several logs on your var/log directory about the payments :
eZPaypal_notify_url.log is going to be created and full of information.

BTW, the new interface at paypal seems to have a positive impact on the bottom line (easier to order if you don't have a paypal account).

http://www.sydesy.com

ludo thomas

Monday 05 September 2005 5:45:03 am

nothig more after that myserver is accessible from internet.

All is working fine but not the last notification that allows payment to be ok.

do I need a special paypal administration configuration?
do i need to modify the ezpaypalchecker.php
do I need to modify the ezpaymentcallbackchecker.php(I have modify ezpaymentgatewey for sending multiref basket)
what can I do with the "token"?

If someone can make it work thanx in advance.

ludo thomas

Friday 09 September 2005 6:57:17 am

It was just because of the paypal.ini.

you have to modify:
# field: "business"
# e-mail of receiver
Business=ludovic@lestudiot.com

(with:business=email adress of the business compte you have created.)

for having adress of your buyer:
change in ezpaypalgateway.php

$noShipping = '';

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 22:29:46
Script start
Timing: Jan 18 2025 22:29:46
Module start 'layout'
Timing: Jan 18 2025 22:29:46
Module start 'content'
Timing: Jan 18 2025 22:29:48
Module end 'content'
Timing: Jan 18 2025 22:29:48
Script end

Main resources:

Total runtime1.6054 sec
Peak memory usage4,096.0000 KB
Database Queries83

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.4766152.6406
Module start 'layout' 0.00470.0038 742.117239.4766
Module start 'content' 0.00841.5956 781.5938691.7891
Module end 'content' 1.60410.0013 1,473.382824.1250
Script end 1.6054  1,497.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2052160.0002
Check MTime0.00130.0782160.0001
Mysql Total
Database connection0.00060.037310.0006
Mysqli_queries1.508793.9783830.0182
Looping result0.00090.0543810.0000
Template Total1.572998.020.7864
Template load0.00170.108420.0009
Template processing1.571197.862920.7856
Template load and register function0.00010.006710.0001
states
state_id_array0.00130.077910.0013
state_identifier_array0.00140.087120.0007
Override
Cache load0.00170.1031810.0000
Sytem overhead
Fetch class attribute can translate value0.00070.045030.0002
Fetch class attribute name0.00190.1169140.0001
XML
Image XML parsing0.00180.113330.0006
class_abstraction
Instantiating content class attribute0.00010.0035220.0000
General
dbfile0.00100.0652280.0000
String conversion0.00000.000640.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
11content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
20content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/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: 58
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs