Skip to content

Commit

Permalink
Revert "Merge branch 'feature/custom-template-option-for-payment-link…
Browse files Browse the repository at this point in the history
…' into release-week-11"

This reverts commit 052e3ff, reversing
changes made to 7921c60.
  • Loading branch information
michielgerritsen committed Mar 25, 2024
1 parent c68e9ed commit 21cb2e1
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 461 deletions.
4 changes: 1 addition & 3 deletions Block/Info/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ public function getExpiresAt(): ?string

public function getPaymentLink($storeId = null): ?string
{
if (!$this->config->addPaymentLinkMessage($storeId) ||
$this->config->paymentLinkUseCustomEmailTemplate($storeId)
) {
if (!$this->config->addPaymentLinkMessage($storeId)) {
return null;
}

Expand Down
18 changes: 0 additions & 18 deletions Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ class Config
const PAYMENT_PAYMENTLINK_NEW_STATUS = 'payment/mollie_methods_paymentlink/order_status_new';
const PAYMENT_PAYMENTLINK_ADD_MESSAGE = 'payment/mollie_methods_paymentlink/add_message';
const PAYMENT_PAYMENTLINK_MESSAGE = 'payment/mollie_methods_paymentlink/message';
const PAYMENT_PAYMENTLINK_USE_CUSTOM_EMAIL_TEMPLATE = 'payment/mollie_methods_paymentlink/use_custom_email_template';
const PAYMENT_PAYMENTLINK_EMAIL_TEMPLATE = 'payment/mollie_methods_paymentlink/email_template';
const PAYMENT_USE_CUSTOM_PAYMENTLINK_URL = 'payment/mollie_general/use_custom_paymentlink_url';
const PAYMENT_CUSTOM_PAYMENTLINK_URL = 'payment/mollie_general/custom_paymentlink_url';
const PAYMENT_POINTOFSALE_ALLOWED_CUSTOMER_GROUPS = 'payment/mollie_methods_pointofsale/allowed_customer_groups';
Expand Down Expand Up @@ -532,22 +530,6 @@ public function paymentLinkMessage($storeId = null): string
);
}

public function paymentLinkUseCustomEmailTemplate(int $storeId = null): string
{
return $this->getPath(
static::PAYMENT_PAYMENTLINK_USE_CUSTOM_EMAIL_TEMPLATE,
$storeId
);
}

public function paymentLinkEmailTemplate(int $storeId = null): string
{
return $this->getPath(
static::PAYMENT_PAYMENTLINK_EMAIL_TEMPLATE,
$storeId
);
}

public function useCustomPaymentLinkUrl($storeId = null): bool
{
return $this->isSetFlag(static::PAYMENT_USE_CUSTOM_PAYMENTLINK_URL, $storeId);
Expand Down

This file was deleted.

42 changes: 0 additions & 42 deletions Service/Order/Email/PaymentLinkOrderIdentity.php

This file was deleted.

78 changes: 0 additions & 78 deletions Service/Order/PaymentLinkConfirmationEmail.php

This file was deleted.

44 changes: 0 additions & 44 deletions Test/Fakes/Service/Magento/PaymentLinkUrlFake.php

This file was deleted.

50 changes: 0 additions & 50 deletions Test/Integration/Block/Info/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

use Magento\Sales\Model\Order\Payment\Info;
use Mollie\Payment\Block\Info\Base;
use Mollie\Payment\Service\Magento\PaymentLinkUrl;
use Mollie\Payment\Test\Fakes\Service\Magento\PaymentLinkUrlFake;
use Mollie\Payment\Test\Integration\IntegrationTestCase;

class BaseTest extends IntegrationTestCase
Expand Down Expand Up @@ -67,52 +65,4 @@ public function testReturnsTheRemainderAmount()
$instance->setData('info', $info);
$this->assertEquals('100', $instance->getRemainderAmount());
}

/**
* @magentoConfigFixture current_store payment/mollie_methods_paymentlink/add_message 1
* @magentoConfigFixture current_store payment/mollie_methods_paymentlink/use_custom_email_template 0
* @magentoConfigFixture current_store payment/mollie_methods_paymentlink/message "Click <a href="%link%">here</a> to complete your payment"
* @return void
*/
public function testReturnsThePaymentLinkMessageWithLink(): void
{
$paymentLinkFake = $this->objectManager->get(PaymentLinkUrlFake::class);
$paymentLinkFake->setUrl('http://www.example.com/mollie/checkout/paymentlink/order/-999/');
$this->objectManager->addSharedInstance($paymentLinkFake, PaymentLinkUrl::class);

/** @var Info $info */
$info = $this->objectManager->create(Info::class);

/** @var Base $instance */
$instance = $this->objectManager->create(Base::class);
$instance->setData('info', $info);

$result = $instance->getPaymentLink();

$this->assertStringNotContainsString('%link%', $result);
}

/**
* @magentoConfigFixture current_store payment/mollie_methods_paymentlink/add_message 1
* @magentoConfigFixture current_store payment/mollie_methods_paymentlink/use_custom_email_template 1
* @magentoConfigFixture current_store payment/mollie_methods_paymentlink/message "Click <a href="%link%">here</a> to complete your payment"
* @return void
*/
public function testReturnsNothingWhenPaymentLinkMailIsActive(): void
{
$paymentLinkFake = $this->objectManager->get(PaymentLinkUrlFake::class);
$paymentLinkFake->shouldNotBeCalled();
$this->objectManager->addSharedInstance($paymentLinkFake, PaymentLinkUrl::class);

/** @var Info $info */
$info = $this->objectManager->create(Info::class);

/** @var Base $instance */
$instance = $this->objectManager->create(Base::class);
$instance->setData('info', $info);

$result = $instance->getPaymentLink();

$this->assertNull($result);
}
}
Loading

0 comments on commit 21cb2e1

Please sign in to comment.