I'm running into a weird problem. It's very intermittent. It's almost related to iPhone and Safari. And, to this day, I'm unable to replicate it. Probably happens a couple of transactions per month.
The issue is when the customer is clicking the PayPal button option to pay via PayPal. This is using the IPN form post to post the cart and transaction information to PayPal. A new window is opened, and they are presented with PayPal's page.. as if they just typed the URL. No information about the order, etc.
As I mentioned, this is very inconsistent and intermittent. 99% of the users are presented with the transaction total and they can check out, etc. If I'm emailed with this problem, I ask that they try a different browser, chrome, etc.. and it typically works. It seems like it's generally iPhone and Safari browser. Sometimes with old phones. Sometimes with new phones, etc.
This is not related to the post back info on the transaction from PayPal, but the posting of cart information to PayPal.
Here is my HTML/PHP code with this info.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<?
$count = 1;
$session->setValue('sInvoice', strtoupper(substr(md5(uniqid(rand(),1)),0,8)));
for($val = 0; $val < sizeof($Cart); $val++){
$productID = $Cart[$val]['ProductID'];
$productTitle = $Cart[$val]['ProductLineDescription'];
$productPrice = $Cart[$val]['UnitPrice'];
$quantity = $Cart[$val]['Quantity'];
$calcPrice = $Cart[$val]['LineItemPrice'];
$shipping = number_format($session->getValue("ShippingTotal"), 2, '.', ',');
?>
<input type="hidden" name="item_name_<?=$count?>" value="<?=specialchars($productTitle)?>" />
<input type="hidden" name="amount_<?=$count?>" value='<?=number_format($productPrice, 2, '.', ',')?>' />
<input type="hidden" name="quantity_<?=$count?>" value="<?=$quantity?>" />
<input type='hidden' name='item_number_<?=$count?>' value='' />
<?
$count++;
}
?>
<input type="hidden" name="shipping_1" value='<?=$shipping?>' />
<input type="hidden" name="no_shipping" value="2" />
<input type="image" id="PayPalButton" src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-large.png" name="submit" class="wp_cart_checkout_button" alt="Make payments with PayPal - it's fast, free and secure!" />
<input type="hidden" name="return" value="https://www.example.com/thankyou/" />
<input type="hidden" name="notify_url" value="https://www.example.com/paypal/" />
<input type="hidden" name="business" value="paypal@example.com" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="charset" value="utf-8" />
<input type="hidden" name="mrb" value="3FWGC6LFTMTUG" />
<input type="hidden" name="custom" value="cid=<?=$xCartID?>" />
</form>
When a user has a problem, I've noted the items and attributes in their cart, and try on my end, but never able to replicate the problem. Clicking the PayPal button behaves as expected.
Any ideas? TIA
I can tell you what I would do, which is switch to a current integration method that does not rely on outdated HTML form posts. Here's the client-side-only one: https://developer.paypal.com/demo/checkout/#/pattern/client
The v2/checkout/orders purchase_unit request object is documented here