diff --git a/app/code/community/Pay/Payment/Model/Paymentmethod/Klarna.php b/app/code/community/Pay/Payment/Model/Paymentmethod/Klarna.php index 934e630..985a611 100644 --- a/app/code/community/Pay/Payment/Model/Paymentmethod/Klarna.php +++ b/app/code/community/Pay/Payment/Model/Paymentmethod/Klarna.php @@ -29,5 +29,31 @@ protected static function getFirstname($address){ return $address->getFirstname(); } + /** + * Firstname lastname and country must be equal + * + * @param Mage_Sales_Model_Quote $quote + * @return bool + */ + protected static function addressEqual(Mage_Sales_Model_Quote $quote) + { + $billingAddress = $quote->getBillingAddress(); + $shippingAddress = $quote->getShippingAddress(); + + + if (strtolower($billingAddress->getFirstname()) !== strtolower($shippingAddress->getFirstname())) { + return false; + } + + if (strtolower($billingAddress->getLastname()) !== strtolower($shippingAddress->getLastname())) { + return false; + } + + if (strtolower($billingAddress->getCountryId()) !== strtolower($shippingAddress->getCountryId())) { + return false; + } + + return true; + } } \ No newline at end of file diff --git a/app/code/community/Pay/Payment/etc/config.xml b/app/code/community/Pay/Payment/etc/config.xml index 6cbb920..cf51d51 100644 --- a/app/code/community/Pay/Payment/etc/config.xml +++ b/app/code/community/Pay/Payment/etc/config.xml @@ -2,7 +2,7 @@ - 3.12.9 + 3.12.10