Skip to content

Commit

Permalink
Merge pull request #159 from magento-mpi/MAGETWO-45325-mb
Browse files Browse the repository at this point in the history
[MPI] Bugfixes merchant beta
  • Loading branch information
dkvashninbay committed Nov 12, 2015
2 parents cd016f7 + 3f10bc9 commit 0f28c43
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/code/Magento/Braintree/Model/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ private function ignoreAddressValidation()
*/
protected function importAddressData($address, $exportedAddress)
{
$address->setStreet([$exportedAddress['streetAddress'], $exportedAddress['extendedAddress']]);
$extendedAddress = isset($exportedAddress['extendedAddress']) ? $exportedAddress['extendedAddress'] : null;
$address->setStreet([$exportedAddress['streetAddress'], $extendedAddress]);
$address->setCity($exportedAddress['locality']);
$address->setRegionCode($exportedAddress['region']);
$address->setCountryId($exportedAddress['countryCodeAlpha2']);
Expand Down
46 changes: 46 additions & 0 deletions app/code/Magento/Braintree/Test/Unit/Model/CheckoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ public function testInitializeQuoteForReview(
$this->model->initializeQuoteForReview($paymentMethodNonce, $details);
}

/**
* @return array
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function initializeQuoteForReviewDataProvider()
{
return [
Expand Down Expand Up @@ -314,6 +318,48 @@ public function initializeQuoteForReviewDataProvider()
'payerLastName' => self::LASTNAME,
]
],
'without_shipping_extended_address' => [
'payment_method_nonce' => 'nonce',
'details' => [
'email' => self::EMAIL,
'firstName' => self::FIRSTNAME,
'lastName' => self::LASTNAME,
'shippingAddress' => [
'streetAddress' => self::SHIPPING_STREET_ADDRESS,
'locality' => self::SHIPPING_LOCALITY,
'region' => self::SHIPPING_REGION,
'countryCodeAlpha2' => self::SHIPPING_COUNTRY_CODE,
'postalCode' => self::SHIPPING_POSTAL_CODE,
],
],
'expected_shipping' => [
'setFirstname' => self::FIRSTNAME,
'setLastname' => self::LASTNAME,
'setEmail' => self::EMAIL,
'setCollectShippingRates' => true,
'setStreet' => [self::SHIPPING_STREET_ADDRESS, null],
'setCity' => self::SHIPPING_LOCALITY,
'setRegionCode' => self::SHIPPING_REGION,
'setCountryId' => self::SHIPPING_COUNTRY_CODE,
'setPostCode' => self::SHIPPING_POSTAL_CODE,
],
'expected_billing' => [
'setFirstname' => self::FIRSTNAME,
'setLastname' => self::LASTNAME,
'setEmail' => self::EMAIL,
'setStreet' => [self::SHIPPING_STREET_ADDRESS, null],
'setCity' => self::SHIPPING_LOCALITY,
'setRegionCode' => self::SHIPPING_REGION,
'setCountryId' => self::SHIPPING_COUNTRY_CODE,
'setPostCode' => self::SHIPPING_POSTAL_CODE,
],
'expected_payment_additional_info' => [
'payment_method_nonce' => 'nonce',
'payerEmail' => self::EMAIL,
'payerFirstName' => self::FIRSTNAME,
'payerLastName' => self::LASTNAME,
]
],
];
}
}

0 comments on commit 0f28c43

Please sign in to comment.