Forums / Developer / how to confirm payment with paypal?[solved]

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 = '';

eZ debug

Timing: Jan 19 2025 01:07:42
Script start
Timing: Jan 19 2025 01:07:42
Module start 'content'
Timing: Jan 19 2025 01:07:42
Module end 'content'
Timing: Jan 19 2025 01:07:42
Script end

Main resources:

Total runtime0.1515 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 590.2188180.8125
Module start 'content' 0.00590.0057 771.0313110.0547
Module end 'content' 0.01170.1398 881.0859538.6250
Script end 0.1514  1,419.7109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00362.3453200.0002
Check MTime0.00150.9797200.0001
Mysql Total
Database connection0.00070.450010.0007
Mysqli_queries0.104669.02141410.0007
Looping result0.00120.81411390.0000
Template Total0.139492.010.1394
Template load0.00090.595810.0009
Template processing0.138591.398610.1385
Override
Cache load0.00060.421010.0006
Sytem overhead
Fetch class attribute can translate value0.00100.658010.0010
XML
Image XML parsing0.00030.173510.0003
General
dbfile0.00614.0008200.0003
String conversion0.00000.004130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs