2015-06-10 75 views
0

從沙箱切換到現場時,我收到以下錯誤paypal.please幫助我如何解決此錯誤。從沙箱切換到貝寶live

Array 
(
    [TIMESTAMP] => 2015-06-10T01:59:03Z 
    [CORRELATIONID] => 4ce24a1abd742 
    [ACK] => Failure 
    [VERSION] => 85.0 
    [BUILD] => 16770825 
    [L_ERRORCODE0] => 10501 
    [L_SHORTMESSAGE0] => Invalid Configuration 
    [L_LONGMESSAGE0] => This transaction cannot be processed due to an invalid merchant configuration. 
    [L_SEVERITYCODE0] => Error 
    [AMT] => 555.00 
    [CURRENCYCODE] => USD 
) 

控制器:

<?php if (! defined('BASEPATH')) exit('No direct script access allowed'); 

class Checkout extends CI_Controller { 


public function direct_payment() { 

$item = $this->session->userdata['item_data']['item']; 

$price = $this->session->userdata['item_data']['price']; 

$quantity = $this->session->userdata['item_data']['quantity']; 

$card_type = $this->input->post('card_type'); 

$card_fname = $this->input->post('card_fname'); 

$card_lname = $this->input->post('card_lname'); 

$creditcard_number = $this->input->post('creditcard_number'); 

$crd_month=$this->input->post('crd_month'); 

$crd_year=$this->input->post('crd_year'); 

$security_code=$this->input->post('security_code'); 

//$order_id = $this->payment_model->save_order(); 

$respounse = $this->payment_model->do_direct_payment($card_type,$card_fname,$card_lname,$creditcard_number,$crd_month,$crd_year,$security_code); 

echo '<pre>'; 

print_r($respounse); 

exit; 

if($respounse['ACK'] == 'SuccessWithWarning' or $respounse['ACK']== 'Success' or $respounse['ACK']== 'Pending') { 

    //$this->db->update('orders', array('order_status'=>'New', 'transaction_id'=>$respounse['TRANSACTIONID'], 'payment_type' =>'Credit Card', 

    //'payment_status' =>$respounse['ACK'],'payment_recevied'=>$respounse['AMT'], 'payment_symbol'=>$respounse['CURRENCYCODE']), array('id'=> $order_id)); 

    //$this->cart->destroy(); 

    //$this->session->set_userdata(array(

    //'last_id'=> $order_id,'transaction'=>$respounse['TRANSACTIONID'])); 

    $this->session->set_flashdata("succes","Your Order is succesfully placed."); 

    redirect("contents/credit"); 

    } else { 

    //$this->db->update('orders', array('order_status'=>'Failed', 'payment_type' =>'Credit Card', 

    //'payment_status' =>$respounse['ACK']), array('id'=> $order_id)); 

    $this->session->set_flashdata("error","Error occur in your payment transacion."); 

    redirect("contents/credit");   

    } 

    } 

} 

型號:

class payment_model extends CI_Model { 

function do_direct_payment($card_type,$card_fname,$card_lname,$creditcard_number,$crd_month,$crd_year,$security_code) { 

    $sandbox = TRUE; 
    // Set PayPal API version and credentials. 

    $api_version = '85.0'; 

    $api_endpoint = ($sandbox == 0)? 'https://api-3t.sandbox.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp'; 

    $api_username = ($sandbox == 0) ? '------' : '-------'; 

    $api_password = ($sandbox == 0) ? '-------' : '------'; 

    $api_signature = ($sandbox == 0) ? '--------' : '-------'; 

    $request_params = array (
     'METHOD' => 'DoDirectPayment', 
     'USER' => $api_username, 
     'PWD' => $api_password, 
     'SIGNATURE' => $api_signature, 
     'VERSION' => $api_version, 
     'PAYMENTACTION' => 'Sale',     
     'IPADDRESS' => $_SERVER['REMOTE_ADDR'], 
     'CREDITCARDTYPE' => $card_type, 
     'ACCT' => $creditcard_number,      
     'EXPDATE' => $crd_month.$crd_year,   
     'CVV2' => $security_code, 
     'FIRSTNAME' => 'ibad', 
     'LASTNAME' => 'anjum', 
     'STREET' => '11 gg', 
     'CITY' => 'peshawar', 
     'STATE' => 'state',      
     'COUNTRYCODE' => 'PK', 
     'ZIP' => '10200', 
     'EMAIL' => '-----', 
     'AMT' => 555, 
     'CURRENCYCODE' => 'USD', 
     'DESC' => 'Testing Payments Pro' 
    ); 

    // Loop through $request_params array to generate the NVP string. 

    $nvp_string = ''; 

    foreach($request_params as $var=>$val) 
    { 
     $nvp_string .= '&'.$var.'='.urlencode($val);  
    } 

    // Send NVP string to PayPal and store response 
    $curl = curl_init(); 
    curl_setopt($curl, CURLOPT_VERBOSE, 1); 
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); 
    curl_setopt($curl, CURLOPT_TIMEOUT, 30); 
    curl_setopt($curl, CURLOPT_URL, $api_endpoint); 
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($curl, CURLOPT_POSTFIELDS, $nvp_string); 

    $result = curl_exec($curl); 
    //print_r($result); 

    return $result_array = $this->NVPToArray($result); 
} 

public function NVPToArray($NVPString) { 
    $proArray = array(); 
    while(strlen($NVPString)) { 
     // name 
     $keypos= strpos($NVPString,'='); 
     $keyval = substr($NVPString,0,$keypos); 
     // value 
     $valuepos = strpos($NVPString,'&') ? strpos($NVPString,'&'): strlen($NVPString); 
     $valval = substr($NVPString,$keypos+1,$valuepos-$keypos-1); 
     // decoding the respose 
     $proArray[$keyval] = urldecode($valval); 
     $NVPString = substr($NVPString,$valuepos+1,strlen($NVPString)); 
    } 
    return $proArray; 
} 

} 

回答

2

按照該文檔,則錯誤代碼10501當計費協議被禁用或inactive.You應該發生在您的帳戶中啓用您的PayPal付款專業版。 您可以嘗試執行以下操作:

  • 打開您的developer.paypal.com帳戶。

  • 打開應用程序訪問您的帳戶。

  • 單擊您要升級到付款專業版的帳戶。

  • 單擊配置文件在對話框中查找Upgrade to Pro選項。

0

如果它在您的沙盒上工作,在我看來是一個帳戶問題。

對於帳戶問題,我建議與PayPal聯繫(底部的http://www.paypal.com),他們會得到合適的團隊來支持您。

即使後來他們發現它是技術性的,他們會要求商家的技術服務支持。但是,我認爲這是賬戶問題。他們會引導你完成必要的過程。