所以 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;
}