SetExpressCheckout API调用失败

时间:2014-01-24 06:20:55

标签: paypal paypal-ipn payment-gateway

嗨,有人可以帮我处理我的代码吗?我在处理我的网页时遇到此错误:

SetExpressCheckout API调用失败。详细错误消息:安全标头无效短暂错误消息:安全错误错误代码:10002错误严重性代码:错误

这是我的代码;

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

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) 

{

1 个答案:

答案 0 :(得分:0)