Skip to content

Commit

Permalink
Merge branch 'mollie:master' into users/vm/NTR-fix-line-items
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackScorp authored Jun 27, 2024
2 parents 3288d61 + 3307aa4 commit 77a9b54
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function addProduct(RequestDataBag $data, SalesChannelContext $context):
*/
public function createPaymentSession(RequestDataBag $data, SalesChannelContext $context): StoreApiResponse
{
$validationURL = $data->getAlnum('validationUrl');
$validationURL = $data->get('validationUrl');

if (empty($validationURL)) {
throw new \Exception('Please provide a validation url!');
Expand Down
6 changes: 0 additions & 6 deletions src/Resources/config/services/handlers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@
<tag name="shopware.payment.method.async"/>
</service>

<!-- GiroPay PaymentHandler -->
<service id="Kiener\MolliePayments\Handler\Method\GiroPayPayment" class="Kiener\MolliePayments\Handler\Method\GiroPayPayment">
<argument type="service" id="mollie_payments.logger"/>
<argument type="service" id="service_container"/>
<tag name="shopware.payment.method.async"/>
</service>

<!-- iDeal PaymentHandler -->
<service id="Kiener\MolliePayments\Handler\Method\iDealPayment" class="Kiener\MolliePayments\Handler\Method\iDealPayment">
Expand Down
1 change: 0 additions & 1 deletion src/Service/PaymentMethodService.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ public function getPaymentHandlers(): array
CreditCardPayment::class,
EpsPayment::class,
GiftCardPayment::class,
GiroPayPayment::class,
iDealPayment::class,
KbcPayment::class,
KlarnaPayLaterPayment::class,
Expand Down
11 changes: 10 additions & 1 deletion src/Service/ShippingMethodService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Shopware\Core\Checkout\Shipping\ShippingMethodEntity;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsAnyFilter;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Symfony\Component\HttpFoundation\Request;

Expand Down Expand Up @@ -61,6 +63,13 @@ public function getActiveShippingMethods(SalesChannelContext $salesChannelContex
$request = new Request();
$request->query->set('onlyAvailable', '1');

return $this->shippingMethodRoute->load($request, $salesChannelContext, new Criteria())->getShippingMethods();
$criteria = (new Criteria())
->addFilter(new EqualsFilter('active', true))
->addFilter(new EqualsFilter('salesChannels.id', $salesChannelContext->getSalesChannel()->getId()))
->addFilter(new EqualsAnyFilter('availabilityRuleId', $salesChannelContext->getRuleIds()))
->addAssociation('prices')
->addAssociation('salesChannels');

return $this->shippingMethodRoute->load($request, $salesChannelContext, $criteria)->getShippingMethods();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ context("Checkout Failure Tests", () => {

// select giro pay and mark it as "paid"
mollieSandbox.initSandboxCookie();
molliePaymentList.selectGiropay();
molliePaymentList.selectiDEAL();
molliePaymentStatus.selectPaid();

cy.url().should('include', '/checkout/finish');
Expand Down Expand Up @@ -102,7 +102,7 @@ context("Checkout Failure Tests", () => {

// select giro pay and mark it as "paid"
mollieSandbox.initSandboxCookie();
molliePaymentList.selectGiropay();
molliePaymentList.selectiDEAL();
molliePaymentStatus.selectPaid();

cy.url().should('include', '/checkout/finish');
Expand Down Expand Up @@ -173,7 +173,7 @@ context("Checkout Failure Tests", () => {
}


paymentAction.switchPaymentMethod('Giropay');
paymentAction.switchPaymentMethod('iDEAL');

checkout.placeOrderOnEdit();

Expand Down Expand Up @@ -206,7 +206,7 @@ context("Checkout Failure Tests", () => {
cy.contains('We received your order, but the payment was aborted');
}

paymentAction.switchPaymentMethod('Giropay');
paymentAction.switchPaymentMethod('iDEAL');

checkout.placeOrderOnEdit();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const payments = [
{caseId: 'C4118', key: 'ideal', name: 'iDEAL', sanity: false},
{caseId: 'C4116', key: 'sofort', name: 'SOFORT', sanity: false},
{caseId: 'C4120', key: 'eps', name: 'eps', sanity: false},
{caseId: 'C4122', key: 'giropay', name: 'Giropay', sanity: false},
{caseId: 'C4123', key: 'mistercash', name: 'Bancontact', sanity: false},
{caseId: 'C4125', key: 'przelewy24', name: 'Przelewy24', sanity: false},
{caseId: 'C4126', key: 'kbc', name: 'KBC', sanity: false},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ function assertAvailablePaymentMethods() {
cy.contains('eps').should('exist');
cy.contains('Bancontact').should('exist');
cy.contains('Belfius').should('exist');
cy.contains('Giropay').should('exist');
cy.contains('PayPal').should('exist');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ export default class PaymentAction {
this.openPaymentsModal();
this.selectPaymentMethod(paymentName);

// we have to select an iDEAL issuer now (required)
if (paymentName === 'iDEAL') {
this.selectIDealIssuer('bunq');
}

if (paymentName === 'POS Terminal') {
this.selectPosTerminal();
Expand Down
1 change: 0 additions & 1 deletion tests/PHPUnit/Service/PaymentMethodServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public function testSupportedMethods(): void
CreditCardPayment::class,
EpsPayment::class,
GiftCardPayment::class,
GiroPayPayment::class,
iDealPayment::class,
KbcPayment::class,
KlarnaPayLaterPayment::class,
Expand Down

0 comments on commit 77a9b54

Please sign in to comment.