Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Mobile Devices - PayPal Standard - Buyer Being Returned to Shopping Cart After Purchase


''B''

Recommended Posts

Paypal Standard 3.2
osCommerce 2.3.3.4

I have found an issue that appears to be isolated to purchases made with mobile devices.

To start, whenever a customer makes a purchase with a laptop/desktop computer, the transaction completes just fine with the buyer being returned to the success page after clicking the pay button over at PayPal. The PayPal purchases made via a laptop/desktop computer process all the way through to completion 100% of the time.

However, whenever a purchase is made with a mobile device, the buyer is returned to the shopping cart after clicking the pay button over at PayPal. The item is still in the shopping cart, inventory is not reduced, the buyer does not receive a store receipt, and in the admin order details there is only the PayPal IPN verified line and not the other PayPal verified line.

So far this has happened on an iPhone, an iPad, and two Android phones (one of which was my Android phone that I used to double check how the transaction progresses).

On my Android phone, when I was returned back to the shopping cart, at the top of the page there was a message that said “Could not verify the PayPal transaction. Please try again.” FYI, the money was taken from my PayPal account. So the order did go through… it’s just that it didn’t process all the way at the merchant website.

In looking at the mobile device transactions in the raw access logs, here is how these “semi-failed” transactions progress:

checkout_shipping.php
checkout_payment.php
checkout_confirmation.php
(go to Paypal, login to Paypal, click the Pay button)
checkout_process.php
shopping_cart.php
standard_ipn.php

This is very confusing to the customer as they think their purchase has not gone through. In addition, they don’t get a store acknowledgement receipt and inventory is not reduced. In the case where an item is a one off, this could create problems if someone else comes along and purchases the same item when it has already been sold.

Any thoughts on this? Hopefully there is a fix for it. Thanks…

Brenda
 

Link to comment
Share on other sites

  • 2 weeks later...

Harald, not sure why I didn't hear back form you in regards to this thread. But after monitoring the raw access logs and speaking with a tech person over at PayPal, I think I possibly know what the issue is.

 

Take a look at what is seen in the raw access logs for the response being returned back to the checkout_process.php page

 

 

On a mobile device

 

166.170.49.219 - - [22/Aug/2014:23:25:10 -0400] "GET /checkout_process.php HTTP/1.1" 302 - "https://mobile.paypal.com/us/cgi-bin/wapapp?cmd=_flow&CONTEXT=X3%2d7SZn2ExXucINxlliZ%5f05NdFsrIIpaV9TcRYNLL%5fGiOwm9XgEZzWKQeV0&SESSION=DnXm4ii8E3PzB9v4_YbCvebUD9TImECYZix78VW4s25x5AWm8gt1RYtkY7G&login_paypal=&jsEnabled=" "Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; SGH-I927 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"

 

 

86.161.14.39 - - [24/Aug/2014:18:37:22 -0400] "GET /checkout_process.php HTTP/1.1" 302 - "https://mobile.paypal.com/uk/cgi-bin/webscr?cmd=_express-checkout-mobile&useraction=commit&token=EC-5DE47862P19792205" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53"

 

 

 

On a desktop

 

92.18.247.41 - - [15/Aug/2014:16:53:35 -0400] "POST /checkout_process.php HTTP/1.1" 302 - "https://www.paypal.com/uk/cgi-bin/webscr?cmd=_flow&SESSION=jJuxGba1oHpENSyORRigfhMXwa8t0eDR7_3Ok5ZNh0YGEUiQOMwfC592hDi&dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b08198a0586321b47f5ae7b54ee269d9200b8b" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"

 

 

109.240.29.102 - - [17/Aug/2014:10:38:32 -0400] "POST /checkout_process.php HTTP/1.1" 302 - "https://www.paypal.com/fi/cgi-bin/webscr?cmd=_flow&SESSION=KUx-Sg4NozAndmMynjkPaZiDeQEHC7reOi0WxIDWJI4gZjst3PS57T7eoAC&dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b08198a0586321b47f5ae7b54ee269d9200b8b" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/6.1.3 Safari/537.75.14"

 

Paypal is using the GET method for the response when the purchase is made from a mobile device. But they are using the POST method from the response when the purchase is made from a desktop/laptop.

 

Based on what I've seen in the code in the paypal_standard.php and standard_ipn.php pages, it appears that it's set up only to process responses sent via POST. Specifically the code below in the paypal_standard.php page is what I believe is sending buyers back to the shopping cart, since there's no way a verified response can be handled when sent via GET since the code is looking for a POST response:

 

 

if ( isset($HTTP_POST_VARS['receiver_email']) && (($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_ID) || (defined('MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID') && tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID) && ($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID))) ) {
        $parameters = 'cmd=_notify-validate';

        foreach ($HTTP_POST_VARS as $key => $value) {
          $parameters .= '&' . $key . '=' . urlencode(stripslashes($value));
        }

        $result = $this->sendTransactionToGateway($this->form_action_url, $parameters);
      }

      if ($result != 'VERIFIED') {
        if (defined('MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION')) {
          $messageStack->add_session('header', MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION);
        }

        $this->sendDebugEmail($result);

        tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
      }

 

Please let me know your thoughts and what can be done so that purchases made via mobile devices go to full completion.

Link to comment
Share on other sites

Do you know a good reason why isn't paypal mobile using POST ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Hello!

Paypal Standard 3.2
osCommerce 2.3.4
iPad mini

And so also in my shop.

Strangely “Could not verify the PayPal transaction. Please try again.” appears on the demo.oscommerce.com too.

So it can't be a fault of the configuration!?

 

 

Thomas

Link to comment
Share on other sites

Same problem with PayPal Payments Standard 3.1 on Desktop ... Buyer is sent back to their shopping cart and it appears like the order didn't complete. The order winds up in the dashboard and PayPal takes the order. No IPN errors on PayPal site.

Link to comment
Share on other sites

Hi all,

 

@''B'' is it Safari browser issue? I suspect that its only a Safari technical comunication problem.

The mobile and the desktop payment are could be different. On mobile you can use mobile Pay app to pay with against desktop where not availabe the Pay applications. So this could be the reason of GET/POST differencies.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@''B''

 

respected

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Hi all, I’m having the same issue too, though I didn’t know until recently that is was something having to do with mobile devices versus regular computers.

 

Prior to this, all I knew was that some Paypal orders go through just fine, while others don’t – I’ve had customers contact me asking if their order is okay because they were sent back to the shopping cart with their items still in the cart and an error message at the top of the page. I don’t remember what they told me the error was, but I’m going to assume it’s the same one posted in the first post at top.  They also don't receive any order confirmation from the site (though they do receive a payment notification from Paypal, as do I).

 

I contacted two of the customers who had this issue and one was using an iPad and another was using a Samsung Galaxy tablet when they made the order. So just want to add more evidence to this thread. I can contact more of my customers that had issues if needed to see what kind of computer they were using.  At a glance, credit card orders go through perfectly, and it looks like Paypal orders done on regular computers are fine, too.  The problem is with mobile devices.

 

I've had to shut down my site because my items are one-of-a-kind, so when someone purchases something but the item is left on the site (since that is what's happening when they use a mobile device - stock is not taken down from the website), I am left in the embarrassing position of having to tell the next person who 'buys' the item that it is actually not available, having already been purchased by someone else.  It was making my site look very unprofessional, and my customers will start doubting me if this happens again, so I took the site down.  Worryingly, this means no income for me!  I'm really hoping there is a solution to this problem, because I'm losing my customers, my reputation, and the visibility in my field.  There are only so many times I can apologize to people for my site being down before they move on to other online shops.

 

Is Harald the owner of osCommerce? Where is he? I'm hoping maybe he's working on a solution but some feedback would be good. The lack of support doesn’t look good and this is an important issue, which I sure would like to be resolved, as I cannot open my online shop until this is fixed.

 

Thanks!

Link to comment
Share on other sites

Soooooooooo five days on since my comment and still nothing?  Is anyone here?  Is Harald still part of osCommerce?  This is an issue that is greatly affecting my website and I was hoping it would be sorted out soon, especially since this thread was started more than three weeks ago.  Any advice - or more importantly, working solutions - would be very much appreciated!

 

Thank you.

Link to comment
Share on other sites

I previously used a different shopping cart for my website and I didn't like it. So I paid a lot of money to have my site re-designed and switched to oscommerce. I opened my new site 3 weeks ago and it works great except for this same issue that others are having. Since opening, I have had several customers contact me via email asking if their order went through because after paying with paypal they were taken back to their shopping cart with the items purchased still there. A couple of people told me there was an error message at the top of the page.

 

Since I can't afford to pay any more money out for my website, the developer of my site sent me a link to this forum and wished me luck.

 

After reading this entire posting, I contacted every customer who has placed an order since my new site opened and asked what kind of computer they used, whether or not they were taken back to their shopping cart, and whether or not they received a order confirmation email from my store. I heard back from everyone except three.

 

For the 11 orders where the customer was taken back to their shopping cart with the items still in their cart, every single purchase was either made from a cell phone or ipad or tablet. None of these customers received a confirmation email from my store.

 

For the 8 orders that had no issues, the customer was using a regular computer. These customers received a confirmaton email from my store.

 

I don't use any other payment method except paypal. So I can't even have the developer of my site turn it off and have customers use another payment method.

 

This issue makes my site - Me!!! - look stupid and amateur.

 

I don't understand why someone official hasn't addressed this issue!!! Why??? If said official person or people are too busy right now, at least throw a bone and give a date as to when you think you'll be able to look at the issue.

 

To just ignore an entire posting of people having this issue is really unprofessional.

 

I am trying to build my business and I just really want to give everyone a smooth shopping experience so that they will be more likely to come back. Please help.

 

Except for the paypal payment issue, the site otherwise works great and I like oscommerce so much more than the shopping cart I previously used.

 

Thanks for (hopefully) reading this.

 

Ana

Link to comment
Share on other sites

Hi there

 

I can tell you why maybe this is happening and I have a quick sticking plaster 'fix' that may help

 

PayPal will send your customers to their 'new' mobile express checkout - in turn that will send your customers back to your site via an HTTP GET method. The desktop checkout at PayPal will use a HTTP POST return

 

The PayPal Standard module file in osCommerce traps the return in the before_process() function:

function before_process() {
global $customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_PayPal_Standard_ID, $payment, $HTTP_GET_VARS, $HTTP_POST_VARS, $messageStack;

$result = false;

if ( isset($HTTP_POST_VARS['receiver_email']) && (($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_ID) || (defined('MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID') && tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID) && ($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID))) ) {
$parameters = 'cmd=_notify-validate';

foreach ($HTTP_POST_VARS as $key => $value) {
$parameters .= '&' . $key . '=' . urlencode(stripslashes($value));
}

$result = $this->sendTransactionToGateway($this->form_action_url, $parameters);
}

if ($result != 'VERIFIED') {
if (defined('MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION')) {
$messageStack->add_session('header', MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION);
}

$this->sendDebugEmail($result);

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}

as there is no POST data to check line 512 above will always see a GET return as !='VERIFIED' so your customer gets booted back to the shopping cart despite having paid

 

It is possible to get some data returned from PayPal by GET (you setup PDT on your account) however that does not hold the same values as a POST return (instead it sends back a token that you need to verify)

 

Attached is some new code that replaces the stock includes/modules/payment/paypal_standard.php - you will need to go to your store admin, uninstall Paypal, then replace the file and reinstall. There is a new field in the admin that wants you to enter a PDT code - get that code by following the advice here (or Google it)

 

When you setup the PDT you'll need to set the auto return to 'on' and enter a valid looking url at PayPal (it can be anything - the osCommerce code over rides it but PayPal will insist you pop something in there)

 

If properly setup this will send your customers back with a PDT GET url which includes a token - there's some new code in the file that checks that for you and will update the order. It will add a comment that an order total does not match PayPal e.g. PayPal Verified [Transaction ID: 4LR5883905582730T; Completed (Verified; $1,313.37); PayPal transaction value (1313.37) does not match order value (1,313.37)]

Just ignore that bit!

 

This is a patch on the standard file - it is used at your own risk and the code really needs tidying up by one of the Core Team. I have tested this on the PayPal Sandbox only. Using Chrome on a desktop you can spoof a user agent for a mobile to check what happens

paypal_standard.php

Edited by Bob Terveuren
Link to comment
Share on other sites

@@Bob Terveuren does this issue also exist with PP express? if not may be worth considering using express

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

Tested with sandbox and real system:
PC WIndows 7 Firefox 32.0.2 and Chrome 37.0.2062
Macbook Pro Firefox 32.0.2
iPad mini iOS 7.1.2 Safari and Chrome 37.0.2062
iPhone 4 iOS 7.1.2 Safari
works everywhere fine and seems to fix the problem!

Many thanks!

Link to comment
Share on other sites

Experienced the same problem using FF on my laptop (no result on sendtransactiontogateway). Installed the GIT fix from hpdl (from another forum post) but that didn't do it.

Now with the version of @@Bob Terveuren it works like a charm!

 

Great work! Thanks! (Pity these kind of errors occur in a "recent" version...)

Link to comment
Share on other sites

  • 1 month later...

This was a great find indeed.  Kudos, Bob.  Now if we could just get IPN to handle stock decrements and order emails....we'd be golden.  HPDL said he was looking at that for the next PayPal Standard release - at least the stock portion of it.

Link to comment
Share on other sites

Does this updated file fix the issue for oscommerce 2.3.4 desktops also- for customers and admin not receiving the Order Process emails (after paying through Paypal) or not removing items from shopping cart after succesful transaction and checkout on store??

I am using oscommerce 2.3.4

Paypal Standard 3.2 version

 

Awaiting your early response.... :)

Link to comment
Share on other sites

@@radhavallabh

 

I believe you're probably having the same issues as I am.  A customer MUST return to the store to have stock updated and send order process emails.  The problem is not affected by this fix - this only fixes mobile device purchases, which were completely broken (again, Ty Bob).

 

Currently, if a non-mobile customer pays with PP account, they are auto-returned.  If they do NOT log into PP, and instead pay with a credit card, they are NOT auto-returned - they must 'click to return to (store)'  

 

For click-to-return, there is no message telling them it's required, so some simply don't return.  For those orders...no emails...no stock updates.

Link to comment
Share on other sites

I have been meaning for a while now to come back to reply to this thread.

 

Bob Terveuren, thank you so much for stepping up and offering a fix. Using your code, PayPal Standard now works fine with mobile devices and continues to work fine with desktop computers.

 

For those of you having issues with stock decrements and order emails, Harald's code (which is supposed to trigger the stock decrement and order emails in the case where the buyer doesn't return to the store) doesn't work. The buyer MUST return to the merchant shop in order for the transaction to go to full completion. So if they don't, that's what causes the issue with stock not being adjusted and buyer's not receiving a store confirmation email.

 

The only thing I could do was to force the buyer to return back to the shop through my friend's PayPal account settings. To do this, I enabled the Return URL feature in my friend's PayPal Website Payment Preferences with a return URL that sends the buyer back to the webAddress/checkout_process.php page. This works great as long as the buyer is paying direct through PayPal and not a credit card via PayPal. The buyer is forced back to the site and the order goes to full completion. However, if the buyer pays via PayPal using a credit card, then I believe at the end of the transaction they have to click a return button to go back to the merchant site. If they don't click that button, then the order does not complete fully because the buyer did not return back to the site. So I turned off the "PayPal Account Optional" feature in my friend's account. If you do this, that means that the buyer can't use a credit card through PayPal (bummer). But at least turning on the return URL feature, turning off the PayPal Account optional feature, and Bob's code has fixed it so that PayPal Standard works as it should.

 

Thanks again Bob!! I appreciate that you took the time to help!!

Link to comment
Share on other sites

  • 9 months later...
  • 2 months later...

I have run into mobile payment issues with Paypal App and paypal standard. Its running on to shopping_cart.php in all cases

The reason seems that the return come with GET without parameters and POST variables.

 

Array
(
    [DOCUMENT_ROOT] => /home/xxxx/public_html/responsive
    [GATEWAY_INTERFACE] => CGI/1.1
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_ACCEPT_LANGUAGE] => hu-hu
    [HTTP_CONNECTION] => keep-alive
    [HTTP_COOKIE] => __utma=185732138.545464339.1445349555.1445349555.1445349555.1; __utmb=185732138.24.10.1445349555; __utmc=185732138; __utmt=1; __utmz=185732138.1445349555.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); cart=a%3A1%3A%7Bi%3A1131%3Ba%3A1%3A%7Bs%3A3%3A%22qty%22%3Bs%3A1%3A%221%22%3B%7D%7D; cookie_test=please_accept_for_session; hasConsent=true; osCsid=dleh455r7i9acbds09buv9rbk5
    [HTTP_HOST] => responsive.xxxxshop.com
    [HTTP_USER_AGENT] => Mozilla/5.0 (iPhone; CPU iPhone OS 9_0_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13A452 Safari/601.1
    [PATH] => /bin:/usr/bin
    [QUERY_STRING] => 
    [REDIRECT_STATUS] => 200
    [REMOTE_ADDR] => 00000000000
    [REMOTE_PORT] => 49626
    [REQUEST_METHOD] => GET
    [REQUEST_URI] => /checkout_process.php
    [SCRIPT_FILENAME] => /home/xxxx/public_html/responsive/checkout_process.php
    [SCRIPT_NAME] => /checkout_process.php
    [SERVER_ADDR] => 000000000000000000
    [SERVER_ADMIN] => [email protected]
    [SERVER_NAME] => responsive.xxxxshop.com
    [SERVER_PORT] => 80
    [SERVER_PROTOCOL] => HTTP/1.1
    [SERVER_SIGNATURE] => 
    [SERVER_SOFTWARE] => Apache
    [UNIQUE_ID] => ViZPP1jGk9gACNf@yvUAAAAA
    [PHP_SELF] => /checkout_process.php
    [REQUEST_TIME] => 1445351231
)

I see only one solution we should use after the return one recall for the actual paypal status with Paypal API and the request result give the right directions.

Do you have any experiancies?

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...