送货地址未显示在Paypal交易详细信息页面中

时间:2014-04-30 19:11:45

标签: php paypal expressionengine

我无法在“Transacton详细信息”中获取客户的送货地址。页。 它显示以下信息。

'我们在文件中没有送货地址'

问题主要发生在用户使用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;
}

}

1 个答案:

答案 0 :(得分:2)

对于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;
}