Tôi đang sử dụng API DoDirectPayment của PayPal để tích hợp thanh toán. Tôi nhận được một thông báo lỗi như dưới đây.Lỗi "Tiêu đề bảo mật không hợp lệ". Phải làm gì với điều này?
Security error:
Error no: 10002
Error message: Security header is not valid
Đây là mã của tôi,
$environment = 'sandbox';
// Set up your API credentials, PayPal end point, and API version.
$API_UserName = urlencode('xxxxxxxx');
$API_Password = urlencode('xxxxxxxx');
$API_Signature = urlencode('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
$API_Endpoint = "https://api-3t.paypal.com/nvp";
if("sandbox" === $environment || "beta-sandbox" === $environment) {
$API_Endpoint = "https://api-3t.$environment.paypal.com/nvp";
}
$version = urlencode('51.0');
// setting the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
// Set the curl parameters.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
// Set the API operation, version, and API signature in the request.
$nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_";
// Set the request as a POST FIELD for curl.
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
// Get response from the server.
$httpResponse = curl_exec($ch);
Xin hãy giúp tôi ra khỏi vấn đề này.
Cảm ơn.
vỡ liên kết 3/12/12 –
liên kết đã bị xóa khỏi trang web –
Hãy thử: https://developer.paypal.com/webapps/developer/docs/classic/api/endpoints/ –