-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: master
Are you sure you want to change the base?
Adding subscription functionality to payment plugin version 1.5.5 #1
Conversation
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": [ |
There was a problem hiding this comment.
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; | ||
|
There was a problem hiding this comment.
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.
/** | |
* @RouteScope(scopes={"api"}) | |
*/ | |
class SubscriptionController extends AbstractController | |
{ | |
} |
/** | ||
* @return string | ||
*/ | ||
public function getEntityName(): string |
There was a problem hiding this comment.
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;
}
src/Facade/MolliePaymentFinalize.php
Outdated
@@ -41,11 +40,11 @@ class MolliePaymentFinalize | |||
private $settingsService; | |||
|
|||
public function __construct( | |||
MollieApiFactory $mollieApiFactory, | |||
MollieApiFactory $mollieApiFactory, | |||
TransactionTransitionServiceInterface $transactionTransitionService, |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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 %} |
There was a problem hiding this comment.
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' %} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Not added any association for productId and salesChannel Id. So if it is needed, then please add it.
https://developer.shopware.com/docs/guides/plugins/plugins/framework/data-handling/add-data-associations
/** | ||
* @return string | ||
*/ | ||
public function getEntityClass(): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Not added any association for productId and salesChannel Id. So if it is needed, then please add it.
https://developer.shopware.com/docs/guides/plugins/plugins/framework/data-handling/add-data-associations
@@ -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"/> |
There was a problem hiding this comment.
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
No description provided.