-
Notifications
You must be signed in to change notification settings - Fork 1
1. Installation
arti0090 edited this page Oct 7, 2024
·
13 revisions
The installation process of Sylius Tpay Plugin
is aimed to be simple and require as few steps as possible. Sylius Tpay Plugin
can be installed in an automatic way, with tools like Symfony Flex
or in a traditional way, where you need to do every step by hand.
- Installed and configured Symfony Flex package
- Configured
Sylius Recipes
flex endpoint
composer require commerce-weavers/sylius-tpay-plugin
webpack.config.js
:
+const cwTpayShop = CommerceWeaversSyliusTpay.getWebpackShopConfig(path.resolve(__dirname));
-module.exports = [shopConfig, adminConfig];
+module.exports = [shopConfig, adminConfig, cwTpayShop];
src/Entity/Order/Order.php
:
<?php
// ...
+use CommerceWeavers\SyliusTpayPlugin\Model\OrderLastNewPaymentAwareInterface;
+use CommerceWeavers\SyliusTpayPlugin\Model\OrderLastNewPaymentAwareTrait;
// ...
#[ORM\Entity]
#[ORM\Table(name: 'sylius_order')]
-class Order extends BaseOrder
+class Order extends BaseOrder implements OrderLastNewPaymentAwareInterface
{
+ use OrderLastNewPaymentAwareTrait;
}
bin/console cache:clear
composer require commerce-weavers/sylius-tpay-plugin
routes.yaml
:
commerce_weavers_tpay_webhook:
resource: "@CommerceWeaversSyliusTpayPlugin/config/routes_webhook.php"
commerce_weavers_tpay_shop:
resource: "@CommerceWeaversSyliusTpayPlugin/config/routes_shop.php"
prefix: /{_locale}
requirements:
_locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$
config.yaml
:
imports:
- { resource: "@CommerceWeaversSyliusTpayPlugin/config/config.php" }
For more information about encrypting gateway configs and generating PAYUM_CYPHER_KEY click here
src/Entity/Order/Order.php
:
<?php
// ...
+use CommerceWeavers\SyliusTpayPlugin\Model\OrderLastNewPaymentAwareInterface;
+use CommerceWeavers\SyliusTpayPlugin\Model\OrderLastNewPaymentAwareTrait;
// ...
#[ORM\Entity]
#[ORM\Table(name: 'sylius_order')]
-class Order extends BaseOrder
+class Order extends BaseOrder implements OrderLastNewPaymentAwareInterface
{
+ use OrderLastNewPaymentAwareTrait;
}
webpack.config.js
:
+const CommerceWeaversSyliusTpay = require('./vendor/commerce-weavers/sylius-tpay-plugin/index');
...
+const cwTpayShop = CommerceWeaversSyliusTpay.getWebpackShopConfig(path.resolve(__dirname));
-module.exports = [shopConfig, adminConfig];
+module.exports = [shopConfig, adminConfig, appShopConfig, appAdminConfig, cwTpayShop];
yarn install && yarn build
or
npm install && npm run build
bin/console cache:clear