Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-9017] Migrate to Adyen Web library V6 #2878

Merged
merged 30 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
02f8ad9
Solving the hidden dependency on Magento_Paypal module
khushboo-singhvi Jan 20, 2025
4a0a599
Merge branch 'main' into ECP-9542
candemiralp Jan 23, 2025
46aa3d8
Solving the Paypal module dependency
khushboo-singhvi Jan 23, 2025
7ec2631
Updating unit test
khushboo-singhvi Jan 23, 2025
cb12688
Updating unit test
khushboo-singhvi Jan 23, 2025
41f13e9
Updating unit test
khushboo-singhvi Jan 23, 2025
26d5d68
Merge branch 'main' into ECP-9542
khushboo-singhvi Feb 4, 2025
ac78954
Merge branch 'main' into ECP-9542
khushboo-singhvi Feb 4, 2025
d2a47a3
[ECP-9605] Replace union return types with single return types
Feb 4, 2025
bffcee7
[ECP-9605] Downgrade Instant Purchase module dependency
Feb 4, 2025
a230cef
Merge pull request #2855 from Adyen/ECP-9542
khushboo-singhvi Feb 4, 2025
8bdaead
Merge branch 'main' into ECP-9605
candemiralp Feb 5, 2025
68b824e
[EPC-9605] Update return type
Feb 5, 2025
6f1c717
[ECP-9605] Update return type
Feb 5, 2025
6c37baa
Merge pull request #2875 from Adyen/ECP-9605
khushboo-singhvi Feb 5, 2025
b33bd6f
chore(release): bump to 9.14.1
khushboo-singhvi Feb 5, 2025
89473aa
Fix error on empty paymentMethodsResponse (#2844)
aschrammel Feb 5, 2025
1508a9c
Merge branch 'main' into promote/main
khushboo-singhvi Feb 5, 2025
08f214c
Merge pull request #2864 from Adyen/promote/main
khushboo-singhvi Feb 5, 2025
952c64a
[EPC-9017] Bump Adyen Web library version to 6.8.0
Feb 7, 2025
09b81b4
[EPC-9017] Remove leftover CSS rules
Feb 7, 2025
97b8389
[EPC-9017] Remove unused imports
Feb 7, 2025
f7ee989
[EPC-9017] Implement generic component
Feb 7, 2025
11e21bd
[EPC-9017] Implement payment components V6
Feb 7, 2025
cfb95b3
[EPC-9017] Remove unnecessary comma
Feb 11, 2025
af7fce1
[EPC-9017] Implement the new component for action container
Feb 11, 2025
8de34f5
[EPC-9017] Implement new checkout for multishipping
Feb 11, 2025
ffcb12c
Merge branch 'develop-10' into ECP-9017
candemiralp Feb 12, 2025
17c9cae
[EPC-9017] Update unit tests
Feb 12, 2025
38cf374
Merge branch 'develop-10' into ECP-9017
candemiralp Feb 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Block/Checkout/Multishipping/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ class Success extends \Magento\Multishipping\Block\Checkout\Success
*/
private $ordersInfo;

/**
* @var
*/
private $billingCountryCode = null;

public function __construct(
Collection $paymentResponseCollection,
Data $adyenHelper,
Expand Down Expand Up @@ -175,6 +180,7 @@ private function setOrderInfo($orderIds)
default:
$this->ordersInfo[$order->getEntityId()]['buttonLabel'] = $this->getCompletePaymentLabel();
}
$this->setBillingCountryCode($order->getBillingAddress()->getCountryId());
}
}
}
Expand Down Expand Up @@ -214,4 +220,14 @@ public function setIsAdyenPayment(bool $isAdyenPayment)
{
$this->isAdyenPayment = $isAdyenPayment;
}

public function setBillingCountryCode(string $countryCode): void
{
$this->billingCountryCode = $countryCode;
}

public function getBillingCountryCode(): ?string
{
return $this->billingCountryCode;
}
}
38 changes: 36 additions & 2 deletions Test/Unit/Block/Checkout/Multishipping/SuccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
namespace Adyen\Payment\Test\Unit\Block\Checkout\Multishipping;

use Adyen\Payment\Block\Checkout\Multishipping\Success;
use Adyen\Payment\Helper\PaymentMethods;
use Adyen\Payment\Test\Unit\AbstractAdyenTestCase;
use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Session\SessionManager;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use Magento\Framework\View\Element\Template\Context;
use Magento\Sales\Api\Data\OrderAddressInterface;
use Magento\Sales\Api\Data\OrderSearchResultInterface;
use Magento\Sales\Api\OrderRepositoryInterface;
use Magento\Sales\Model\Order;

class SuccessTest extends AbstractAdyenTestCase
{
Expand All @@ -29,6 +32,11 @@ class SuccessTest extends AbstractAdyenTestCase
private $orderRepositoryMock;
private $searchCriteriaBuilderMock;
private $orderSearchResultMock;
private $orderMock;
private $paymentMock;
private $paymentMethodHelperMock;

const ORDER_BILLING_ADDRESS_COUNTRY = 'TR';

protected function setUp(): void
{
Expand All @@ -40,8 +48,22 @@ protected function setUp(): void
$this->contextMock = $this->createMock(Context::class);
$this->contextMock->method('getSession')->willReturn($this->sessionMock);

$this->paymentMock = $this->createMock(Order\Payment::class);
$this->paymentMock->method('getMethod')->willReturn('adyen_cc');
$this->paymentMock->method('getAdditionalInformation')->willReturn([
'resultCode' => 'Authorised'
]);

$billingAddressMock = $this->createMock(OrderAddressInterface::class);
$billingAddressMock->method('getCountryId')->willReturn(self::ORDER_BILLING_ADDRESS_COUNTRY);

$this->orderMock = $this->createMock(Order::class);
$this->orderMock->method('getPayment')->willReturn($this->paymentMock);
$this->orderMock->method('getEntityId')->willReturn(1);
$this->orderMock->method('getBillingAddress')->willReturn($billingAddressMock);

$this->orderSearchResultMock = $this->createMock(OrderSearchResultInterface::class);
$this->orderSearchResultMock->method('getItems')->willReturn([]);
$this->orderSearchResultMock->method('getItems')->willReturn([$this->orderMock]);

$this->orderRepositoryMock = $this->createMock(OrderRepositoryInterface::class);
$this->orderRepositoryMock->method('getList')->willReturn($this->orderSearchResultMock);
Expand All @@ -51,6 +73,9 @@ protected function setUp(): void
$this->createMock(SearchCriteriaInterface::class)
);

$this->paymentMethodHelperMock = $this->createMock(PaymentMethods::class);
$this->paymentMethodHelperMock->method('isAdyenPayment')->willReturn(true);

$payments = [
['result_code' => 'Authorised'],
['result_code' => 'IdentifyShopper', 'action' => 'DUMMY_ACTION_OBJECT']
Expand All @@ -61,7 +86,8 @@ protected function setUp(): void
'paymentResponseEntities' => $payments,
'context' => $this->contextMock,
'orderRepository' => $this->orderRepositoryMock,
'searchCriteriaBuilder' => $this->searchCriteriaBuilderMock
'searchCriteriaBuilder' => $this->searchCriteriaBuilderMock,
'paymentMethodsHelper' => $this->paymentMethodHelperMock
]);
}

Expand All @@ -70,4 +96,12 @@ public function testRenderAction()
$result = $this->successBlock->renderAction();
$this->assertTrue($result);
}

public function testBillingCountryCodeSetterGetter()
{
$this->assertEquals(
self::ORDER_BILLING_ADDRESS_COUNTRY,
$this->successBlock->getBillingCountryCode()
);
}
}
Loading
Loading