-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #815 from mollie/release/2.41.0
Release/2.41.0
- Loading branch information
Showing
55 changed files
with
685 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/* | ||
* Copyright Magmodules.eu. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Mollie\Payment\Api\Webapi; | ||
|
||
interface ResetCartInterface | ||
{ | ||
/** | ||
* @param string $hash | ||
* @return void | ||
*/ | ||
public function byHash(string $hash): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/* | ||
* Copyright Magmodules.eu. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Mollie\Payment\Model\Methods; | ||
|
||
class Payconiq extends \Mollie\Payment\Model\Mollie | ||
{ | ||
|
||
/** | ||
* Payment method code | ||
* | ||
* @var string | ||
*/ | ||
const CODE = 'mollie_methods_payconiq'; | ||
} |
55 changes: 55 additions & 0 deletions
55
Observer/SalesModelServiceQuoteSubmitSuccess/SetCheckoutUrlForPaymentLink.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/* | ||
* Copyright Magmodules.eu. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Mollie\Payment\Observer\SalesModelServiceQuoteSubmitSuccess; | ||
|
||
use Magento\Framework\Event\Observer; | ||
use Magento\Framework\Event\ObserverInterface; | ||
use Magento\Sales\Api\Data\OrderInterface; | ||
use Magento\Sales\Api\OrderPaymentRepositoryInterface; | ||
use Magento\Sales\Model\Order\PaymentAdapterInterface; | ||
use Mollie\Payment\Model\Methods\Paymentlink; | ||
use Mollie\Payment\Service\Magento\PaymentLinkUrl; | ||
|
||
class SetCheckoutUrlForPaymentLink implements ObserverInterface | ||
{ | ||
/** | ||
* @var PaymentLinkUrl | ||
*/ | ||
private $paymentLinkUrl; | ||
/** | ||
* @var OrderPaymentRepositoryInterface | ||
*/ | ||
private $orderPaymentRepository; | ||
|
||
public function __construct( | ||
PaymentLinkUrl $paymentLinkUrl, | ||
OrderPaymentRepositoryInterface $orderPaymentRepository | ||
) { | ||
$this->paymentLinkUrl = $paymentLinkUrl; | ||
$this->orderPaymentRepository = $orderPaymentRepository; | ||
} | ||
|
||
public function execute(Observer $observer) | ||
{ | ||
/** @var OrderInterface $order */ | ||
$order = $observer->getEvent()->getData('order'); | ||
|
||
$payment = $order->getPayment(); | ||
if ($payment->getMethod() != Paymentlink::CODE) { | ||
return; | ||
} | ||
|
||
$payment->setAdditionalInformation( | ||
'checkout_url', | ||
$this->paymentLinkUrl->execute((int)$order->getEntityId()) | ||
); | ||
|
||
$this->orderPaymentRepository->save($payment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright Magmodules.eu. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
import CheckoutPaymentPage from "Pages/frontend/CheckoutPaymentPage"; | ||
import VisitCheckoutPaymentCompositeAction from "CompositeActions/VisitCheckoutPaymentCompositeAction"; | ||
import MollieHostedPaymentPage from "Pages/mollie/MollieHostedPaymentPage"; | ||
import CheckoutSuccessPage from "Pages/frontend/CheckoutSuccessPage"; | ||
import OrdersPage from "Pages/backend/OrdersPage"; | ||
import CartPage from "Pages/frontend/CartPage"; | ||
|
||
const checkoutPaymentPage = new CheckoutPaymentPage(); | ||
const visitCheckoutPayment = new VisitCheckoutPaymentCompositeAction(); | ||
const mollieHostedPaymentPage = new MollieHostedPaymentPage(); | ||
const checkoutSuccessPage = new CheckoutSuccessPage(); | ||
const ordersPage = new OrdersPage(); | ||
const cartPage = new CartPage(); | ||
|
||
if (Cypress.env('mollie_available_methods').includes('payconiq')) { | ||
describe('Check that payconiq behaves as expected', () => { | ||
[ | ||
{status: 'paid', orderStatus: 'Processing', title: 'C3706886: Validate the submission of an order with Payconiq as payment method and payment mark as "Paid" '}, | ||
{status: 'failed', orderStatus: 'Canceled', title: 'C3706887: Validate the submission of an order with Payconiq as payment method and payment mark as "Failed"'}, | ||
{status: 'expired', orderStatus: 'Canceled', title: 'C3706888: Validate the submission of an order with Payconiq as payment method and payment mark as "Expired" '}, | ||
{status: 'canceled', orderStatus: 'Canceled', title: 'C3706889: Validate the submission of an order with Payconiq as payment method and payment mark as "Canceled" '}, | ||
].forEach((testCase) => { | ||
it(testCase.title, () => { | ||
visitCheckoutPayment.visit('BE'); | ||
|
||
cy.intercept('mollie/checkout/redirect/paymentToken/*').as('mollieRedirect'); | ||
|
||
checkoutPaymentPage.selectPaymentMethod('Payconiq'); | ||
checkoutPaymentPage.placeOrder(); | ||
|
||
mollieHostedPaymentPage.selectStatus(testCase.status); | ||
|
||
if (testCase.status === 'paid') { | ||
checkoutSuccessPage.assertThatOrderSuccessPageIsShown(); | ||
} | ||
|
||
if (testCase.status === 'canceled') { | ||
cartPage.assertCartPageIsShown(); | ||
} | ||
|
||
cy.backendLogin(); | ||
|
||
cy.get('@order-id').then((orderId) => { | ||
ordersPage.openOrderById(orderId); | ||
}); | ||
|
||
if (testCase.status === 'expired') { | ||
ordersPage.callFetchStatus(); | ||
} | ||
|
||
ordersPage.assertOrderStatusIs(testCase.orderStatus); | ||
}); | ||
}); | ||
}) | ||
} |
15 changes: 15 additions & 0 deletions
15
Test/End-2-end/cypress/fixtures/belgian-shipping-address.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": { | ||
"username": "[email protected]", | ||
"firstname": "Anna", | ||
"company": "Acme Firma BVBA", | ||
"lastname": "Schmidt", | ||
"street[0]": "Voorbeeldstraat 1", | ||
"city": "Brussel", | ||
"postcode": "1000", | ||
"telephone": "+32 2 XXXXXXX" | ||
}, | ||
"select": { | ||
"country_id": "BE" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.