Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
860 views
in Technique[技术] by (71.8m points)

php - Paypal Checkout in mobile website

I am developing one mobile website for selling products through paypal. When i click the paypal button it redirects to paypal site in desktop mode. i want to change that to mobile mode...

I use the following code

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="product1">
<input type="hidden" name="amount" value="1.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="www.website.com/mobile/paypalreturn.php"/>
<input type="hidden" name="cancel_return" value="www.website.com/mobile/" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="shopping_url" value="www.website.com/mobile/index.php"> 
<input type="hidden" name="notify_url" value="www.website.com/mobile/paypalnotify.php">
<script>document.paypal.submit();</script>
</form>

Here it show Desktop version . I want to change to mobile version.. I checked this with Android and Iphone Devices. in Mobile device also its shows desktop version. I googled it, some site said it automatically change according to devices but not working for me..

Please suggest on this to rectify

Thanks in advance....

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Do not know what alternative there is for command _xclick, but with Express Checkout you can use instead of

<input type="hidden" name="cmd" value="_express-checkout" />

this

<input type="hidden" name="cmd" value="_express-checkout-mobile" />

So the URL looks like https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout-mobile&token=.... See more about Express Checkout Mobile here: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_WPECOnMobileDevices .

Try to find similar solution for Your xclick cmd parameter.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...