paypal - SetExpressCheckout API 调用失败

标签 paypal paypal-ipn payment-gateway

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

SetExpressCheckout API 调用失败。详细错误消息:安全 header 无效简短错误消息:安全错误错误代码: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) 

{

最佳答案

关于paypal - SetExpressCheckout API 调用失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21325789/

相关文章:

e-commerce - Paypal 自适应支付 API,多个接收者,哪个 apiUsername/apiPassword/apiSignature?

Paypal ssl握手失败

paypal - 为沙盒帐户创建立即购买按钮

paypal - 了解 WadeShuler 的 IPN fork

php - Paypal IPN 返回无效

php - 根据 Woocommerce 中的购物车总额添加或删除支付网关

C# ASP.NET MVC PayPal 找不到程序集

php - 并行支付的 Paypal IPN 问题

java - java电子商务(我的火的洗礼)

c# - 如何通过卡处理付款?