Paypal Express结账无法使用?

时间:2013-06-27 09:57:09

标签: php ios paypal payment-gateway paypal-sandbox

我一直在使用Paypal Express结帐在我的应用程序中付款。它仍处于沙盒模式。直到上周,它一直没有任何问题。但从本周开始,交易ID就没有了。

首先,我将解释我的全部交易流程。

1.当我结账时,我将在我的服务器中调用php文件,其中包含客户详细信息和产品详细信息。

2.然后这个php文件将调用Paypal API并生成一个令牌并将其发送回我的应用程序。

3.使用事务ID和设备令牌(由libPayPalEC.a库生成)并使用这两个参数加载沙箱paypal URL。如果我成功从我的服务器获取令牌,我将在webview中加载URL。 / p>

NSString *urlAddress = [NSString  stringWithFormat:@"https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout-mobile&useraction=commit&drt=%@&token=%@",_deviceToken,_payPalToken]; 

4.将在webView中加载登录页面并进行进一步的交易。

上面的过程很好地工作到上周,但现在它停留在第二点本身。我的php没有提供令牌。相反它的响应如下。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:ns1="og" lang="en" xmlns="http://www.w3.org/1999/xhtml" ns1:xmlns="http://ogp.me/ns#"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--
         Script info: script: merchantpaymentweb, cmd: &#x5f;express&#x2d;checkout, template: xpt&#x2f;Checkout&#x2f;ec&#x2f;Login, date: Jun&#x20;26&#x2c;&#x20;2013&#x20;08&#x3a;06&#x3a;00&#x20;PDT; country: US, language: en_US, xslt server: 
        web version: 104&#x2e;0&#x2d;6660064 branch: 54acf8f793ee3c83461ce755fea6f9b7ceeea381
        content version: &#x2d;
        pexml version: 104&#x2e;0&#x2d;6561375
        page XSL: Checkout/default/en_US/ec/Login.xsl
       hostname : fbS&#x2e;6KL5lvTqGnDaa&#x2d;D3Z7mrkSj1m0cLx4&#x2d;hBxdfN7U
         rlogid : ukDrJAYX6XpzjZWCm13fDfZSMweU30&#x25;2bmKW&#x25;2bO7bgiwIlt8cKrcoR32LdDR4kzkZZIuUQ690k&#x25;2bI7U&#x25;3d&#x5f;13f84f881b6
-->
<title>Pay with a PayPal account - PayPal</title>
<!--googleoff: all-->
<meta name="description" content="PayPal is the safer, easier way to pay online without revealing your credit card number.">
<!--googleon: all-->
<meta http-equiv="X-UA-Compatible" content="IE=9"><link media="screen" rel="stylesheet" type="text/css" href="https://www.sandbox.paypal.com/MERCHANTPAYMENTWEB-640-20130622-1/css/core/xptdev.css"><link media="screen" rel="stylesheet" type="text/css" href="https://www.sandbox.paypal.com/MERCHANTPAYMENTWEB-640-20130622-1/css/core/global.css"><link rel="stylesheet" type="text/css" href="https://www.sandbox.paypal.com/MERCHANTPAYMENTWEB-640-20130622-1/Checkout/css/checkout.css">
<!--[if lte IE 9]><link media="screen" rel="stylesheet" type="text/css" href="https&#x3a;&#x2f;&#x2f;www&#x2e;sandbox&#x2e;paypal&#x2e;com&#x2f;MERCHANTPAYMENTWEB&#x2d;640&#x2d;20130622&#x2d;1/Checkout/css/ie.css"><![endif]-->
<link rel="stylesheet" type="text/css" href="https://www.sandbox.paypal.com/css/sandbox.css"><style type="text/css" id="antiClickjack">body{display:none !important;}</style><script type="text/javascript">
                if (self === top) {
                    var antiClickjack = document.getElementById("antiClickjack");
                    antiClickjack.parentNode.removeChild(antiClickjack);
                } else {
                    top.location = self.location;
                }
            </script><script type="text/javascript" src="https://www.sandbox.paypal.com/MERCHANTPAYMENTWEB-640-20130622-1/js/lib/min/global.js"></script><script type="text/javascript">PAYPAL.util.lazyLoadRoot = 'https\x3a\x2f\x2fwww\x2esandbox\x2epaypal\x2ecom\x2fMERCHANTPAYMENTWEB\x2d640\x2d20130622\x2d1';</script><link rel="shortcut icon" href="https://www.sandbox.paypal.com/en_US/i/icon/pp_favicon_x.ico"><link rel="apple-touch-icon" href="https://www.sandbox.paypal.com/en_US/i/pui/apple-touch-icon.png"></head><body class="xptSandbox"><noscript><style type="text/css">body{display:block !important;}</style><p class="nonjsAlert">PayPal requires JavaScript for many of its features. To check out, please <a target="blank" href="https://www.sandbox.paypal.com/us/webapps/mpp/preview/how-to-turn-on-javascript?locale.x=en_US">turn on Javascript in your internet browser</a>.</p></noscript><div class="" id="stdpage"><div id="header"><h1 class="confidential">Benchmark&#x20;iPhone&#x27;s&#x20;Test&#x20;Store</h1></div><hr><div id="content"><div id="headline"><h1 class="accessAid">Choose a way to pay</h1>
</div><div id="messageBox"></div><div id="main"><div class="layout1"><iframe class="hide" id="yui-history-iframe" src="https://www.sandbox.paypal.com/en_US/i/scr/scr_grayDotRepeatBg_3x1.gif"></iframe><input type="hidden" id="yui-history-field" name="yui-history-field" value=""><form id="historyForm" method="get" class="noAnimation" action="https://www.sandbox.paypal.com/us/cgi-bin/merchantpaymentweb"><input type="hidden" name="cmd" value="_flow"><input id="historyDispatch" type="hidden" name="dispatch" value="50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b081988da7a3c03e3ee25661350b6a36dba24a"><input id="historySession" type="hidden" name="SESSION"><input type="submit" id="historySubmit" name="historySubmit" value="" class="hide parentSubmit noAnimation"><input name="auth" type="hidden" value="ARlB87oxQ9J5V1AHb1z0XwiBtbOHOHDRWmiu&#x2e;ySH5Pdx06UHFSnnO&#x2e;ZzwT93TLFLx"><input name="form_charset" type="hidden" value="UTF&#x2d;8"></form><div class="accessAid" id="swapPanel"></div><div class="accessAid" id="babySlider"></div><form method="post" id="parentForm" name="login_form" action="https://www.sandbox.paypal.com/us/cgi-bin/merchantpaymentweb?dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b081988da7a3c03e3ee25661350b6a36dba24a" class=""><input type="hidden" name="cmd" value="_flow"><input type="hidden" id="myAllTextSubmitID" name="myAllTextSubmitID" value=""><input type="hidden" id="miniPager" name="miniPager" value=""><div class="layout2f"><div class="col first"><div class="rounded defaultStyles"><div class="top outer"></div><div class="body outer clearfix"><div class="rounded child"><div class="top inner"></div><div class="body clearfix" id="miniCartContent"><div id="miniCart" class=""><h3>Your&#x20;order&#x20;summary</h3><div class="small head wrap">Descriptions<span class="amount">Amount</span></div><ol class="small wrap items "><li class="seller1"><ul><li id="multiitem1" class="itmdet"><ul class="item1"><li class="dark"><span class="name"><a class="autoTooltip" href="#name0" title="Test&#x20;Product" id="showname0">Test&#x20;Product</a></span><span class="amount">&#x24;2&#x2e;50</span></li><li class="secondary"><span>Item price: &#x24;2&#x2e;50</span></li><li class="secondary">Quantity: 1</li></ul><ul></ul></li></ul></li></ol><div class="wrap items totals item1"><ul><li class="small heavy">Item total <span class="amount">&#x24;2&#x2e;50</span></li></ul></div><div class="small wrap items totals item1"><ul><li class="heavy highlight finalTotal"><span class="grandTotal amount highlight">Total &#x24;2&#x2e;50 AUD</span></li></ul></div><div><div></div><div></div></div></div></div><div class="bottom inner"></div></div></div><div class="bottom outer"></div></div></div><div class="col last"><div class="accessAid" id="panelMask"><div class="top"><div> </div></div><div class="body clearfix"><div><div id="progressMeter"><img border="0" src="https://www.sandbox.paypal.com/en_US/i/icon/icon_animated_prog_dkgy_42wx42h.gif" alt="Loading.."><span class="panelMaskMsg" id="defaultMsg">Loading ...</span><span class="hide panelMaskMsg" id="updateCtry">Updating country</span><span class="panelMaskMsg hide" id="loginMsg">Authenticating your information</span><span class="panelMaskMsg hide" id="loginUpdateMsg">Logging you in</span><span class="hide panelMaskMsg" id="authMsg">Authenticating your information.</span><span class="hide panelMaskMsg" id="authUpdateMsg">Securing your information.</span><span class="hide panelMaskMsg" id="reviewMsg">Updating your information ...</span><span class="hide panelMaskMsg" id="shippingMsg">Updating your information ...</span><span class="hide panelMaskMsg" id="cartMsg">Updating order total ...</span><span class="hide panelMaskMsg" id="processPayment"></span></div></div></div><div class="bottom"><div> </div></div></div><div id="sliderWrapper"><div id="parentSlider"><fieldset id="sliders"><legend class="accessAid">Login</legend><input type="hidden" id="currentSession" name="currentSession" value="hIeXpvxuBcpEkVcO6ac1zxQzgDbkoJ0yBpSa7hB9FsbaJEDJs3mrB2YWy10"><input type="hidden" id="pageState" name="pageState" value="login"><input type="hidden" id="currentDispatch" name="currentDispatch" value="50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b081988da7a3c03e3ee25661350b6a36dba24a"><noscript><input type="hidden" id="flag_non_js" name="flag_non_js" value="true"></noscript><div id="loginModule"><div id="hdrContainer" class="subhdr"><h2>Choose a way to pay</h2></div><div class="panel active" id="method-paypal"><div class="top"></div><div class="body clearfix"><div id="secureCheckout" class="lockLogo"><span class="spriteLogo paypallock" title="PayPal"></span></div><span class="downarrow"></span><div class="subhead">Pay with my PayPal account<span class="help">Log in to your account to complete the purchase</span></div><input type="hidden" name="email_recovery" value="false"><input type="hidden" name="password_recovery" value="false"><div id="loginBox"><p class="group"><label for="login_email"><span class="labelText">Email</span></label><span class="field"><input type="text" id="login_email" class="confidential large" name="login_email" value="venkatnskns&#x40;gmail&#x2e;com"></span></p><p class="group"><label for="login_password"><span class="labelText">PayPal password</span></label><span class="field"><input autocomplete="off" type="password" id="login_password" name="login_password" value="" class="restricted large"></span></p><p class="buttons"><input type="submit" id="submitLogin" name="login.x" value="Log In" class="button primary default parentSubmit"><p><a target="_blank" href="https://www.sandbox.paypal.com/us/cgi-bin/merchantpaymentweb?cmd=_account-recovery&from=PayPal">Forgot your email address or password?</a></p></p></div><input type="hidden" id="pageSession" name="SESSION" value="OdkkP9CI6mk&#x2d;sjRgiWGSF62n&#x2d;GgAqPqVtZrCPVXBG2V1uX6NmTvvMBEx2&#x5f;e"><input type="hidden" id="pageDispatch" name="dispatch" value="50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b081988da7a3c03e3ee25661350b6a36dba24a"><input type="hidden" id="CONTEXT_CGI_VAR" name="CONTEXT" value="wtgSziM4C5x0SI&#x2d;9CmKcv2vkSeTLK5P&#x5f;g6HqzC&#x5f;&#x5f;YTYkcqziFNcB84p79Ja"></div><div class="bottom"></div></div><div id="method-cc" class="panel scTrack:xpt&#x2f;Checkout&#x2f;ec&#x2f;Login&#x3a;&#x3a;&#x5f;express&#x2d;checkout:ClickBilling"><span class="rightarrow"></span><div class="subhead"><span class="buttonAsLink"><input type="submit" value="Don't have a PayPal account?" id="minipageSubmitBtn" name="new_user_button.x" class="parentSubmit noMask noAnimation"></span><p class="small secondary">(Optional) Join PayPal for faster future checkout</p></div><input type="hidden" name="cmd" value="_flow"><input type="hidden" name="id" value=""><input type="hidden" name="close_external_flow" value="false"><input type="hidden" name="external_close_account_payment_flow" value="payment_flow"></div></div></fieldset><div class="layout1"><p class="small secondary return"><span class="buttonAsLink"><input type="submit" value="Cancel and return to Benchmark&#x20;iPhone&#x27;s&#x20;Test&#x20;Store." name="cancel_return" class="action"></span></p></div></div><script type="text/javascript">
                                                                    YUD.setStyle('parentSlider', 'margin-left', '-560px');
                                                                </script></div></div></div><input name="auth" type="hidden" value="ARlB87oxQ9J5V1AHb1z0XwiBtbOHOHDRWmiu&#x2e;ySH5Pdx06UHFSnnO&#x2e;ZzwT93TLFLx"><input name="form_charset" type="hidden" value="UTF&#x2d;8"></form></div></div></div><input type="hidden" id="XoCountryCode" name="" value="US"><div id="prefooter"></div><div id="footer"><div id="opinionlab"><a href="javascript:PP_O_LC();">Site Feedback</a> <img src="https://www.sandbox.paypal.com/en_US/i/scr/sm_333_oo.gif" border="0" alt="Site Feedback"></div>
<!-- OnlineOpinionF3cS v3.0-->
<script type="text/javascript">
            var feedback_link='Site Feedback'; var _ht=escape(document.location.href);
                                                                var _hr=document.referrer;custom_var=escape('ukDrJAYX6XpzjZWCm13fDfZSMweU30\x252bmKW\x252bO7bgiwIlt8cKrcoR32LdDR4kzkZZIuUQ690k\x252bI7U\x253d\x5f13f84f881b6')+'|';custom_var+='Unknown|xpt\x2fCheckout\x2fec\x2fLogin\x3a\x3a\x5fexpress\x2dcheckout|US|en_US|Unknown|79933151TE8175237';// Paypal Custom URL class
            var PayPalURL = function(pagename) {
                this.language_country_code = "en_US";
                this.dd = "US";
                this.nn = "00";this.pagename = escape(pagename.replace(/\s|\//g, "_"));
                this.to_str = function() {

                return "https://"+this.dd+".paypal.com/"+this.language_country_code+"/"+this.nn+"/"+this.pagename+".page"
                }
                }
                var paypal_url = new PayPalURL("xpt\x2fCheckout\x2fec\x2fLogin\x3a\x3a\x5fexpress\x2dcheckout");
            // Below gives you the ability to change the other properties after the object is created
            //paypal_url.dd="ES";
            //paypal_url.nn="01";

        _ht = paypal_url.to_str();
        var _ht_temp=_ht;
        var _hr_temp=_hr;
        var baseurl="https://www\x2esandbox\x2epaypal\x2ecom\x2fus/cgi-bin/webscr?cmd=_handle-sf-redirect";var custom_var_temp=custom_var;</script><p>PayPal. The safer, easier way to pay. For more information, read our <a target="_blank" href="https://cms.paypal.com/us/cgi-bin/marketingweb?cmd=_render-content&content_ID=ua/UserAgreement_popup&locale.x=en_US" title="Opens in new window" onClick="PAYPAL.core.openWindow(event, {width: 640, height:500});">User Agreement</a> and <a target="_blank" href="https://cms.paypal.com/us/cgi-bin/marketingweb?cmd=_render-content&content_ID=ua/Privacy_popup&locale.x=en_US" title="Opens in new window" onClick="PAYPAL.core.openWindow(event, {width: 640, height:500});">Privacy Policy</a>.</p></div><div id="footerSandbox"><div id="sandboxFooter"><div class="nav-footer"></div><div id="testsite"><h1>Test Site</h1></div></div></div></div><script type="text/javascript" src="https://www.sandbox.paypal.com/MERCHANTPAYMENTWEB-640-20130622-1/Checkout/js/min/widgets.js"></script><script type="text/javascript">var mcSequenceDuration = "200";</script><script type="text/javascript" src="https://www.sandbox.paypal.com/MERCHANTPAYMENTWEB-640-20130622-1/Checkout/js/min/checkout.js"></script><script type="text/javascript" src="https://www.sandbox.paypal.com/MERCHANTPAYMENTWEB-640-20130622-1/Checkout/js/login.js"></script><script type="text/javascript" src="https://www.sandbox.paypal.com/MERCHANTPAYMENTWEB-640-20130622-1/js/tns/fso_ngxo.js"></script><script type="text/javascript">PAYPAL.tns.loginflow = 'xpt\x2fCheckout\x2fec\x2fLogin';PAYPAL.tns.flashLocation = 'https\x3a\x2f\x2fwww\x2esandbox\x2epaypal\x2ecom/en_US/m/mid.swf';</script>
<!-- SiteCatalyst Code
Copyright 1997-2005 Omniture, Inc.
More info available at http://www.omniture.com -->
<script type="text/javascript" src="https://www.sandbox.paypal.com/MERCHANTPAYMENTWEB-640-20130622-1/js/site_catalyst/pp_jscode_paypalsandboxdev.js"></script>
<script type="text/javascript">
s.prop1="xpt\x2fCheckout\x2fec\x2fLogin";
s.prop20="1372325446";
s.prop35="out";
s.prop40="9bf35c68eb041";
s.prop50="en_US";
s.prop64="b114448342636";
s.eVar28="tnc\x2d9\x2decg\x2dcntl2";
s.eVar31="xpt\x2fCheckout\x2fec\x2fLogin\x3a\x3a\x5fexpress\x2dcheckout";
s.eVar50="ukDrJAYX6XpzjZWCm13fDfZSMweU30\x252bmKW\x252bO7bgiwIlt8cKrcoR32LdDR4kzkZZIuUQ690k\x252bI7U\x253d\x5f13f84f881b6";
s.pageName="xpt\x2fCheckout\x2fec\x2fLogin\x3a\x3a\x5fexpress\x2dcheckout";
s.prop56="yes";
s.prop21="EC\x2d87714847AX7819342";
s.prop5="79933151TE8175237";
</script>
<script type="text/javascript"><!--
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
function scOnload(){var s_code=s.t();if(s_code)document.write(s_code);}
if(window.addEventListener){
window.addEventListener('load',scOnload,false);
}else if(window.attachEvent){
window.attachEvent('onload', scOnload);
};
if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')
//-->
</script><noscript><img
src="//paypal.112.2O7.net/b/ss/paypalsandboxdev/1/H.6--NS/0?pageName=NonJavaScript"
height="1" width="1" border="0" alt="" /></noscript>
<!--/DO NOT REMOVE/-->

<!-- End SiteCatalyst Code -->
</body></html>

我们没有对代码进行任何更改(包括应用程序和服务器)。我们有三个应用程序,比如使用相同的沙箱帐户,但使用三个不同的服务器。在所有三个应用程序中它现在不工作。我们不知道究竟是什么问题。我们过去两天一直在google和paypal网站上搜索,但没有解决方案。

请提出您的想法。现在对我们来说真的很有帮助。

提前致谢。

注意:

在我的PHP代码(主要部分)

   if( $ack == "SUCCESS" ) {
            $token = urldecode($resArray["TOKEN"]);

            //Store the order information the DB and get the last inserted id
            $lastInsertOrderId = storeOrder($token,$comments,$transcation);

            //Store the order items array in the database
            storeOrderItems( $_POST["productArray"],  $lastInsertOrderId);


            //   echo urldecode($resArray["TOKEN"]);
                /* XML Response */
                //$ResponseXML ="<Main><Token><![CDATA[" .$token. "]]></Token></Main>";
                /* JSON Response */
                $ResponseXML ='{"Token":"' .$token. '"}';

               echo $ResponseXML;
                   //If I command the following 4 lines I can get the token but I can't proceed the transaction.
               Redirect to paypal.com here
               $token = urldecode($resArray["TOKEN"]);
               $payPalURL = PAYPAL_URL.$token;
               header("Location: ".$payPalURL);
                  }

在上面的PHP代码中,如果我命令最后4行,我可以获得Paypal令牌,但在加载沙箱登录页面时,它说下面的错误。

“此交易无效。请返回收件人的网站,使用常规结帐流程完成交易。”

请分享您的想法。

谢谢....

0 个答案:

没有答案