Paypal API付款专业交易未显示送货详情

时间:2013-09-06 15:06:23

标签: api paypal paypal-adaptive-payments

所以Paypal收到我们的付款,没有问题。只是支付详细信息和Paypal发送/提供的收据电子邮件不包括送货信息。用户名地址等。

我们正试图模仿旧Joomla系统正在使用的旧销售流程编码。 Paypal的这些电子邮件收据确实包含了客户的送货详情。

我们不知道旧编码在做什么我们没做什么。我们发送各种客户字段和运输详细信息字段,但没有出现运输详细信息。我们正在使用Do DirectPayments方法。也许我们需要使用另一种方法?也许你是我们没有发送的东西。

同样,交易详细信息用于显示用户的运送详细信息,现在他们没有。

任何帮助表示赞赏。我粘贴下面的代码:

function DoPayment()
{
        global $api_username,$api_password,$api_signature,$api_version,$api_endpoint;

        $expdate = $_POST['exp_month'] . $_POST['exp_year'];
        // Store request params in an array
        $request_params = array(
             'METHOD' => 'DoDirectPayment', 
             'USER' => $api_username, 
             'PWD' => $api_password, 
             'SIGNATURE' => $api_signature, 
             'VERSION' => $api_version, 
             'PAYMENTACTION' => 'Sale',                     
             'IPADDRESS' => $_SERVER['REMOTE_ADDR'],
             'CREDITCARDTYPE' => $_POST['card_type'], 
             'ACCT' => $_POST['card_number'],                       
             'EXPDATE' => $expdate,             
             'CVV2' => $_POST['cvv2'], 
             'CARDHOLDERNAME' => $_POST['cardholder_firstname'], 
             'STREET' => $_POST['card_street'], 
             'STREET2' => $_POST['card_street2'], 
             'CITY' => $_POST['card_city'], 
             'STATE' => $_POST['card_state'],                   
             'COUNTRYCODE' => $_POST['card_country'], 
             'ZIP' => $_POST['card_zip'], 
             'AMT' => $_POST['amount'], 
             'CURRENCYCODE' => 'USD', 
             'EMAIL' => $_POST['email'], 
             'PHONE' => $_POST['phone'], 
             'DESC' => $_POST['comments'],
             'SHIPTONAME' => $_POST['cardholder_firstname'],
             'SHIPTOSTREET' => $_POST['card_street'],
             'SHIPTOSTREET2' => $_POST['card_street2'],
             'SHIPTOCITY' => $_POST['card_city'],
             'SHIPTOSTATE' => $_POST['card_state'],
             'SHIPTOPHONENUM' => $_POST['phone']
        );

        // 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);
        //echo //$result.'<br /><br />';
        curl_close($curl);

        return $result;
}

function DoPayment() { global $api_username,$api_password,$api_signature,$api_version,$api_endpoint; $expdate = $_POST['exp_month'] . $_POST['exp_year']; // Store request params in an array $request_params = array( 'METHOD' => 'DoDirectPayment', 'USER' => $api_username, 'PWD' => $api_password, 'SIGNATURE' => $api_signature, 'VERSION' => $api_version, 'PAYMENTACTION' => 'Sale', 'IPADDRESS' => $_SERVER['REMOTE_ADDR'], 'CREDITCARDTYPE' => $_POST['card_type'], 'ACCT' => $_POST['card_number'], 'EXPDATE' => $expdate, 'CVV2' => $_POST['cvv2'], 'CARDHOLDERNAME' => $_POST['cardholder_firstname'], 'STREET' => $_POST['card_street'], 'STREET2' => $_POST['card_street2'], 'CITY' => $_POST['card_city'], 'STATE' => $_POST['card_state'], 'COUNTRYCODE' => $_POST['card_country'], 'ZIP' => $_POST['card_zip'], 'AMT' => $_POST['amount'], 'CURRENCYCODE' => 'USD', 'EMAIL' => $_POST['email'], 'PHONE' => $_POST['phone'], 'DESC' => $_POST['comments'], 'SHIPTONAME' => $_POST['cardholder_firstname'], 'SHIPTOSTREET' => $_POST['card_street'], 'SHIPTOSTREET2' => $_POST['card_street2'], 'SHIPTOCITY' => $_POST['card_city'], 'SHIPTOSTATE' => $_POST['card_state'], 'SHIPTOPHONENUM' => $_POST['phone'] ); // 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); //echo //$result.'<br /><br />'; curl_close($curl); return $result; }

1 个答案:

答案 0 :(得分:0)

好的,所以看起来上面的工作和运输细节实际上是因为我使用航运参数,所以即时关闭。