2010-10-11 21 views
6

Ödeme entegrasyonu için PayPal'ın DoDirectPayment API'sini kullanıyorum. Aşağıdakine benzer bir hata mesajı alıyorum. PayPal "Güvenlik başlığı geçerli değil" hatası. Bununla ne yapmalı?


İşte
Security error: 
Error no: 10002 
Error message: Security header is not valid 

benim kodudur

,
$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); 

bu problemden bana yardım edin.

Teşekkürler.

cevap

0

çok dikkatli API bitiş noktası ve sürümünü kontrol edin:

https://www.x.com/message/156280#156280

+5

3/12/12 –

+0

bağlantısı site –

+2

deneyin kaldırıldı Kırık Bağlantı: https://developer.paypal.com/webapps/developer/docs/classic/api/endpoints/ –

0

Benim sorun oluşmadan Yanlış olma API kimlik bilgileri. Doğru sanal api kullanıcı adı, şifre ve api anahtarını girdikten sonra bile hala aynı hatayı aldım. Test hesaplarımı yeniden oluşturdum, tekrar uygulamamda girdim, sunucuyu yeniden başlattım ve işe yaradı. paypal security header issue

0

Eğer Endpoint api.sandbox.paypal.com değişmelidir, benim üzerinde çalıştı Önce sendbox hesabınıza giriş ve sekmede kontrol edin: İşte

benzer bir konuda görüşmeye x.com bir bağlantı var Uygulama

0

user2230647 haklıdır. Sen sandbox modunda test etmek istediğiniz durumda tüm şu parametreler için sanal alan bilgilere ihtiyaç duyarlar:

'api_endpoint' => 'https://api-3t.sandbox.paypal.com/nvp', 
'api_username' => 'example_api1.email.com', 
'api_password' => 'your_password', 
'api_signature' => 'your_signature', 
İlgili konular