gpt4 book ai didi

php - Paypal 交易详情页面中未显示送货地址

转载 作者:太空宇宙 更新时间:2023-11-03 16:18:34 27 4
gpt4 key购买 nike

我无法在“交易详情”页面中获取客户的送货地址。它显示以下消息。

'我们没有记录送货地址'

该问题主要发生在用户使用 PaypalPro(直接支付)选项时。

谁能帮我解决这个问题。

注意:

这是我对应于 DoDirectPayment 请求的代码。

ProAuthorizeRequest 类扩展了 AbstractRequest{ protected $action = '授权';

public function getData()
{
$data = $this->getBaseData('DoDirectPayment');

$this->validate('amount', 'card');
$this->getCard()->validate();

$data['PAYMENTACTION'] = $this->action;
$data['AMT'] = $this->getAmount();
$data['CURRENCYCODE'] = $this->getCurrency();
$data['INVNUM'] = $this->getTransactionId();
$data['DESC'] = $this->getDescription();

// add credit card details
$data['ACCT'] = $this->getCard()->getNumber();
$data['CREDITCARDTYPE'] = $this->getCard()->getBrand();
$data['EXPDATE'] = $this->getCard()->getExpiryMonth().$this->getCard()->getExpiryYear();
$data['STARTDATE'] = $this->getCard()->getStartMonth().$this->getCard()->getStartYear();
$data['CVV2'] = $this->getCard()->getCvv();
$data['ISSUENUMBER'] = $this->getCard()->getIssueNumber();
$data['IPADDRESS'] = $this->getClientIp();
$data['FIRSTNAME'] = $this->getCard()->getFirstName();
$data['LASTNAME'] = $this->getCard()->getLastName();
$data['EMAIL'] = $this->getCard()->getEmail();
$data['STREET'] = $this->getCard()->getAddress1();
$data['STREET2'] = $this->getCard()->getAddress2();
$data['CITY'] = $this->getCard()->getCity();
$data['STATE'] = $this->getCard()->getState();
$data['ZIP'] = $this->getCard()->getPostcode();
$data['COUNTRYCODE'] = strtoupper($this->getCard()->getCountry());

return $data;
}

最佳答案

对于 DoDirectPayment,您还需要包含 SHIPTO 变量:

public function getData()
{
$data = $this->getBaseData('DoDirectPayment');

$this->validate('amount', 'card');
$this->getCard()->validate();

$data['PAYMENTACTION'] = $this->action;
$data['AMT'] = $this->getAmount();
$data['CURRENCYCODE'] = $this->getCurrency();
$data['INVNUM'] = $this->getTransactionId();
$data['DESC'] = $this->getDescription();

// add credit card details
$data['ACCT'] = $this->getCard()->getNumber();
$data['CREDITCARDTYPE'] = $this->getCard()->getBrand();
$data['EXPDATE'] = $this->getCard()->getExpiryMonth().$this->getCard()->getExpiryYear();
$data['STARTDATE'] = $this->getCard()->getStartMonth().$this->getCard()->getStartYear();
$data['CVV2'] = $this->getCard()->getCvv();
$data['ISSUENUMBER'] = $this->getCard()->getIssueNumber();
$data['IPADDRESS'] = $this->getClientIp();
$data['FIRSTNAME'] = $this->getCard()->getFirstName();
$data['LASTNAME'] = $this->getCard()->getLastName();
$data['EMAIL'] = $this->getCard()->getEmail();
$data['STREET'] = $this->getCard()->getAddress1();
$data['STREET2'] = $this->getCard()->getAddress2();
$data['CITY'] = $this->getCard()->getCity();
$data['STATE'] = $this->getCard()->getState();
$data['ZIP'] = $this->getCard()->getPostcode();
$data['COUNTRYCODE'] = strtoupper($this->getCard()->getCountry());
//shipping information as you want displayed on transaction details. name is a single field.
$data['SHIPTONAME'] = $this->getCard()->getFirstName() . " " . $this->getCard()->getLastName();
$data['SHIPTOSTREET'] = $this->getCard()->getAddress1();
$data['SHIPTOSTREET2'] = $this->getCard()->getAddress2();
$data['SHIPTOCITY'] = $this->getCard()->getCity();
$data['SHIPTOSTATE'] = $this->getCard()->getState();
$data['SHIPTOZIP'] = $this->getCard()->getPostcode();
$data['SHIPTOCOUNTRYCODE'] = strtoupper($this->getCard()->getCountry());

return $data;
}

关于php - Paypal 交易详情页面中未显示送货地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23396211/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com