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

Adding subscription functionality to payment plugin version 1.5.5 #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Frank-Magmodules
Copy link
Member

No description provided.

composer.json Outdated
@@ -1,7 +1,7 @@
{
"name": "kiener/mollie-payments-plugin",
"description": "Mollie Payments",
"version": "v1.5.7",
"version": "v1.5.5",
"type": "shopware-platform-plugin",
"license": "MIT",
"authors": [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please upload plugin logo
"extra": {
"plugin-icon": "src/Resources/config/plugin.png",
}

use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
use Kiener\MolliePayments\Service\Subscription\CancelSubscriptionsService;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write Route scope always before class name Ex.

Suggested change
/**
* @RouteScope(scopes={"api"})
*/
class SubscriptionController extends AbstractController
{
}

/**
* @return string
*/
public function getEntityName(): string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you create any definition don't add a direct entity name in the getEntityName function. Please create Const ENTITY_NAME and use that constant as entity name EX.

public const ENTITY_NAME = 'mollie_subscription_to_product';

public function getEntityName(): string
{
return self::ENTITY_NAME;
}

@@ -41,11 +40,11 @@ class MolliePaymentFinalize
private $settingsService;

public function __construct(
MollieApiFactory $mollieApiFactory,
MollieApiFactory $mollieApiFactory,
TransactionTransitionServiceInterface $transactionTransitionService,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have added TransactionTransitionServiceInterface but never used in the file, if you don't use any class defined in constructor then remove it from service


Module.register('mollie-subscriptions', {
type: 'plugin',
name: 'Mollie Subscriptions',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add direct name and title.
Always use snippet because some time in backend its give error if we not use snippet.

Module.register('mollie-subscriptions', {
type: 'plugin',
name: 'Mollie Subscriptions',
title: 'Mollie Subscriptions',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add direct name and title.
Always use snippet because some time in backend its give error if we not use snippet.

@@ -0,0 +1,216 @@
{% block page_account_mollie_subscriptions_item_overview %}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you work on storefront or administration twig files then avoid large page scroll on twig. Always add different code to different files.
My suggestion in one twig file only have 100 line code


{% if productPrice > 0 %}
<div class="mb-2 d-none only-support-apple-pay">
{% include '@MolliePayments/mollie/component/apple-pay-direct-button.twig' %}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t use the include function.
Shopware provides sw_include function. Please use that instead.

/**
* @return string
*/
public function getEntityClass(): string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/**
* @return string
*/
public function getEntityClass(): string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -9,7 +9,7 @@
<service id="Kiener\MolliePayments\Compatibility\Storefront\Route\PaymentMethodRoute\Voucher\HideVoucherPaymentMethodRoute63"
decorates="Shopware\Core\Checkout\Payment\SalesChannel\PaymentMethodRoute">
<argument type="service" id="Kiener\MolliePayments\Compatibility\Storefront\Route\PaymentMethodRoute\Voucher\HideVoucherPaymentMethodRoute63.inner"/>
<argument type="service" id="service_container"/>
<argument type="service" id="Shopware\Core\Checkout\Cart\SalesChannel\CartService"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you decorates core class and you don't want to add parent class argument in your service then you can use parent keyword with decorates EX.

<service id="Kiener\MolliePayments\Compatibility\Storefront\Route\PaymentMethodRoute\Voucher\HideVoucherPaymentMethodRoute63" decorates="Shopware\Core\Checkout\Payment\SalesChannel\PaymentMethodRoute">

<service id="Kiener\MolliePayments\Compatibility\Storefront\Route\PaymentMethodRoute\Voucher\HideVoucherPaymentMethodRoute63" decorates="Shopware\Core\Checkout\Payment\SalesChannel\PaymentMethodRoute" parent="Shopware\Core\Checkout\Payment\SalesChannel\PaymentMethodRoute">

And use class construct like this

public function __construct
(
AbstractFormRoute $formRoute,
EntityRepositoryInterface $eecomSwagCmsExtensionsRepository,
EntityRepositoryInterface $eecomCustomFormSubmitRepository,
EntityRepositoryInterface $formRepository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants