Magento 1.4 paypal漏洞

Magento 1.4 paypal漏洞,magento,paypal,Magento,Paypal,我尝试在我的magento 1.4中运行paypal支付,但工作流存在严重问题。在我选择paypal并发送到paypal帐户后,您通常会自动返回magento商店以完成订单,但在我的情况下,magento告诉您地址字段存在问题。paypal没有将地址正确发送回magento: Error: Please check shipping address information. Please enter last name. 这是一个已知的bug还是有补丁或解决方法 请帮忙! thnx.如果能找到

我尝试在我的magento 1.4中运行paypal支付,但工作流存在严重问题。在我选择paypal并发送到paypal帐户后,您通常会自动返回magento商店以完成订单,但在我的情况下,magento告诉您地址字段存在问题。paypal没有将地址正确发送回magento:

Error: Please check shipping address information. Please enter last name.
这是一个已知的bug还是有补丁或解决方法

请帮忙!
thnx.

如果能找到解决方案,我也会遇到同样的问题

---更新---


我终于明白了这一次发生了什么。我安装了定制的发货管理模块,它覆盖了验证订单的地址控制器。我更新了覆盖的模块,以反映我使用的Magento版本,并且它工作正常。。没问题。希望这对某人有所帮助。

错误似乎出现在/app/code/core/Mage/Paypal/Model/Api/Nvp.php中。看起来变量映射得不好。因为我在这个文件中找不到具体的错误,所以我在/app/code/core/Mage/Paypal/Model/Express/Checkout.php中做了一些肮脏的变通

1.4.2中,只需用以下代码替换方法returnFromPaypal()

public function returnFromPaypal($token)
{
    $this->_getApi();
    $this->_api->setToken($token)
        ->callGetExpressCheckoutDetails();

    // import billing address
    $billingAddress = $this->_quote->getBillingAddress();
    $exportedBillingAddress = $this->_api->getExportedBillingAddress();

    // import shipping address
    $exportedShippingAddress = $this->_api->getExportedShippingAddress();
    if (!$this->_quote->getIsVirtual()) {
        $shippingAddress = $this->_quote->getShippingAddress();
        if ($shippingAddress) {
            if ($exportedShippingAddress) {
                foreach ($exportedShippingAddress->getExportedKeys() as $key) {
                    if('firstname' == $key || 'lastname' == $key){
                        continue;
                    } // if
                    $shippingAddress->setDataUsingMethod($key, $exportedShippingAddress->getData($key));
                    $billingAddress->setDataUsingMethod($key, $exportedShippingAddress->getData($key));
                }

                // Correct First- and Lastnames
                list($_firstname, $_lastname) = explode(' ', $exportedShippingAddress->getData('firstname'));

                $shippingAddress->setDataUsingMethod('firstname', $_firstname);
                $billingAddress->setDataUsingMethod('firstname', $_firstname);

                $shippingAddress->setDataUsingMethod('lastname', $_lastname);
                $billingAddress->setDataUsingMethod('lastname', $_lastname);

                $shippingAddress->setCollectShippingRates(true);
            }

            // import shipping method
            $code = '';
            if ($this->_api->getShippingRateCode()) {
                if ($code = $this->_matchShippingMethodCode($shippingAddress, $this->_api->getShippingRateCode())) {
                     // possible bug of double collecting rates :-/
                    $shippingAddress->setShippingMethod($code)->setCollectShippingRates(true);
                }
            }
            $this->_quote->getPayment()->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD, $code);
        }
    }
    $this->_ignoreAddressValidation();

    // import payment info
    $payment = $this->_quote->getPayment();
    $payment->setMethod($this->_methodType);
    Mage::getSingleton('paypal/info')->importToPayment($this->_api, $payment);
    $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_ID, $this->_api->getPayerId())
        ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_TOKEN, $token)
    ;
    $this->_quote->collectTotals()->save();
}
修改后的代码将整个帐单地址替换为发货地址,并将$firstname中给出的名称压入$firstname和$lastname


不干净,但工作正常。:-)

这里有什么新的吗?嘿,各位,你们只是不使用paypal,还是只有我下载了有问题的版本?也许我得把商店的系统换成能正常工作的…你试过新的安装吗?你的地址有什么不正常的地方吗?另外,您可以使用日志记录查看返回的地址吗?不幸的是,我无法检查这些内容。但我发现其他一些人也有同样的问题:在Magento 1.6.2上也适用于我