问题
I've been trying to switch over our classic express checkout to in-context express checkout.
As instructed, I've switched the URL to https://www.paypal.com/checkoutnow/
This is the HTML snippet in the cart:
<div class="col-md-6">
<a id="paypalcheckout" href="paypal_checkout/PostToPaypal.cfm?orderidentifier=XXXX">
<img class="paypal-button-hidden" src="/img/paypal.png" alt="" class="img-responsive center-block"/>
</a>
</div>
<script>
window.paypalCheckoutReady = function() {
paypal.checkout.setup("ZZZZ", {locale: 'en_US', environment: 'sandbox', button: ['paypalcheckout']});
}
</script>
<script async src="//www.paypalobjects.com/api/checkout.js"></script>
PostToPaypal.cfm makes the necessary api requests and gets back the EC-code and then redirects to this link:
https://www.sandbox.paypal.com/checkoutnow/2?incontext=1&token=EC-YYYY
The click results in a pop up window with the main window going dark. But after a few seconds, the pop up window makes the main page go to classic checkout and closes. It's letting me continue and checkout successfully with the old method. So I know the EC number is correct. Can anyone help me understand what I need to do to make in-context checkout work? Thank you in advance.
回答1:
For me the issue was the CALLBACK
param when getting transaction id. When I removed it, it worked.
回答2:
I had the exact same problem.
The solution turned out to be in the server-side settings. In the paypalfunctions.php file (which PayPal itself generated for me), there are a couple of lines that you need to remove, ones pertaining to it being a digital item. Look for a similar line:
$nvpstr .= "&L_PAYMENTREQUEST_0_ITEMCATEGORY" . $index . "=Digital";
It might be repeated several times. Basically, the Digital Goods are not allowed through the in-context checkout, which is why I was getting the redirect issue.
回答3:
I have the same issue with LANDINGPAGE set to Billing.
In that particular case sandbox reverts to classic express checkout version. In production both Billing and Login values for LANDINGPAGE parameter result in a correct popup window.
回答4:
I had to remove these parameters to get it to work
FlatRateShippingOptions
cppHeaderImage
CallbackURL
CallbackTimeout
来源:https://stackoverflow.com/questions/29898739/paypal-in-context-checkout-reverts-back-to-classic-express-checkout