首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SetExpressCheckout接口调用失败

SetExpressCheckout接口调用失败
EN

Stack Overflow用户
提问于 2014-01-24 14:20:55
回答 1查看 2.9K关注 0票数 1

嗨,有没有人能帮我写代码?我在处理我的网页时遇到这个错误:

SetExpressCheckout接口调用失败。详细错误信息:安全头不是validShort错误信息:安全errorError代码:10002错误严重度代码: Error

下面是我的代码;

代码语言:javascript
复制
/********************************************

PayPal API Module



Defines all the global variables and the wrapper functions 



********************************************/

class Paypalrequest{









/* An express checkout transaction starts with a token, that

   identifies to PayPal your transaction

   In this example, when the script sees a token, the script

   knows that the buyer has already authorized payment through

   paypal.  If no token was found, the action is to send the buyer

   to PayPal to first authorize payment

   */



/*   

'-------------------------------------------------------------------------------------------------------------------------------------------

' Purpose:  Prepares the parameters for the SetExpressCheckout API Call.

' Inputs:  

'       paymentAmount:      Total value of the shopping cart

'       currencyCodeType:   Currency code value the PayPal API

'       paymentType:        paymentType has to be one of the following values: Sale or Order or Authorization

'       returnURL:          the page where buyers return to after they are done with the payment review on PayPal

'       cancelURL:          the page where buyers return to when they cancel the payment review on PayPal

'--------------------------------------------------------------------------------------------------------------------------------------------   

*/





var $PROXY_HOST = '127.0.0.1';

var $PROXY_PORT = '808';



var  $SandboxFlag = false;



//'------------------------------------

//' PayPal API Credentials

//' Replace <API_USERNAME> with your API Username

//' Replace <API_PASSWORD> with your API Password

//' Replace <API_SIGNATURE> with your Signature

//'------------------------------------

/* var  $API_UserName="USERNAMER HERE";

var $API_Password="PASSWORD HERE";

var $API_Signature="SIGNATURE HERE";*/

 var  $API_UserName="USERNAME HERE";

var $API_Password="PASSWORD HERE";

var $API_Signature="SIGNATURE HERE"; 








// BN Code  is only applicable for partners

var  $sBNCode = "PP-ECWizard";





/*  

' Define the PayPal Redirect URLs.  

'   This is the URL that the buyer is first sent to do authorize payment with their paypal account

'   change the URL depending if you are testing on the sandbox or the live PayPal site

'

' For the sandbox, the URL is       https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=

' For the live site, the URL is        https://www.paypal.com/webscr&cmd=_express-checkout&token=

*/



var $USE_PROXY = false;

var $version="64";

var $API_Endpoint;

var $PAYPAL_URL;

    public function __construct(){

$this->PROXY_HOST = '127.0.0.1';

$this->PROXY_PORT = '808';



$this->SandboxFlag = false;

/* $this->API_UserName="USERNAME HERE";

$this->API_Password="PASSWORD HERE";

$this->API_Signature="SIGNATURE HERE"; */

 $this->API_UserName="USERNAME HERE";

$this->API_Password="PASSWORD HERE";

$this->API_Signature="SIGNATURE HERE";






// BN Code  is only applicable for partners

$this->sBNCode = "PP-ECWizard";



if ($this->SandboxFlag == true) 

{

    $this->API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";

    $this->PAYPAL_URL ="https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";

}

else

{

    $this->API_Endpoint = "https://api-3t.paypal.com/nvp";

    $this->PAYPAL_URL = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";

}



$this->USE_PROXY = false;

$this->version="64";



if (session_id() == "") 

    session_start();





       }





public function CallShortcutExpressCheckout( $paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL,$packageName) 

{
EN

回答 1

Stack Overflow用户

发布于 2016-01-21 10:32:06

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21325789

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档