Lyra Collect for Sylius 是一款開源插件,可將基於 Sylius 的電子商務網站連結到 Lyra Network 開發的 Lyra Collect 安全支付網關。
使用以下命令需要帶有 Composer 的插件:
composer require lyranetwork/sylius-lyranetwork-plugin dev-lyra
在位於[sylius-root]/config/
的bundles.php檔案中新增以下行:
LyranetworkLyraLyranetworkLyraPlugin::class => ['all' => true],
在位於[sylius-root]/config/
的routes.yaml檔案中新增Lyra 路由:
sylius_lyra:資源:“@LyranetworkLyraPlugin/Resources/config/routing.yaml”
在位於[sylius-root]/config/packages
的 _ sylius.yaml檔案中加入 Lyra 回呼:
winzou_state_machine: sylius_ payment:callbacks: after:custom_action: on: ["process", "authorize", "complete"] do: ["@lyranetworklyra.order_service", "sendConfirmationEmail"] args: [mail"
在位於[sylius-root]/config
的services.yaml檔案中新增 Lyra 服務:
services: [...] lyranetworklyra.order_service: class: LyranetworkLyraServiceOrderService public: true
使用以下命令轉儲自動載入快取:
composer dump-autoload
小心
新增覆蓋模板。如果您已經覆蓋了以下文件之一,則需要將其與我們的合併。您將在 LyranetworkLyra/Resources/views/bundles/ 目錄中找到它們。
SyliusAdminBundlePaymentMethod_form.html.twig SyliusAdminBundleOrderShow_payment.html.twig SyliusShopBundleCheckoutSelectPayment_choice.html.twig SyliusUiBundleFormtheme.html.twig
如果沒有,只需使用以下命令複製它們:
cp -R vendor/lyranetwork/sylius-lyranetwork-plugin/LyranetworkLyra/Resources/views/bundles/* templates/bundles/
使用以下命令清空快取:
php bin/console cache:clear
該外掛程式現在應該出現在您可以建立的付款方式清單中。
將模組解壓縮到 Sylius 根資料夾中。
在檔案[sylius-root]/composer.json
中的 autoload psr-4 中新增以下行:
"LyranetworkLyra": "LyranetworkLyra/src/"
在位於[sylius-root]/config/
的bundles.php檔案中新增以下行:
LyranetworkLyraLyranetworkLyraPlugin::class => ['all' => true],
在位於[sylius-root]/config/
的routes.yaml檔案中新增Lyra 路由:
sylius_lyra:資源:“@LyranetworkLyraPlugin/Resources/config/routing.yaml”
在位於[sylius-root]/config/packages
的 _ sylius.yaml檔案中加入 Lyra 回呼:
winzou_state_machine: sylius_ payment:callbacks: after:custom_action: on: ["process", "authorize", "complete"] do: ["@lyranetworklyra.order_service", "sendConfirmationEmail"] args: [mail"
在位於[sylius-root]/config
的services.yaml檔案中新增 Lyra 服務:
services: [...] lyranetworklyra.order_service: class: LyranetworkLyraServiceOrderService public: true
使用以下命令轉儲自動載入快取:
composer dump-autoload
小心
新增覆蓋模板。如果您已經覆蓋了以下文件之一,則需要將其與我們的合併。您將在 LyranetworkLyra/Resources/views/bundles/ 目錄中找到它們。
SyliusAdminBundlePaymentMethod_form.html.twig SyliusAdminBundleOrderShow_payment.html.twig SyliusShopBundleCheckoutSelectPayment_choice.html.twig SyliusUiBundleFormtheme.html.twig
如果沒有,只需使用以下命令複製它們:
cp -R LyranetworkLyra/Resources/views/bundles/* templates/bundles/
在 Sylius 根目錄中開啟命令列,然後執行以下命令來提取插件的翻譯:
php bin/console translation:extract en LyranetworkLyraPlugin --dump-messages php bin/console translation:extract fr LyranetworkLyraPlugin --dump-messages php bin/console translation:extract es LyranetworkLyraPlugin --dump-messages php bin/console translation:extract de LyranetworkLyraPlugin --dump-messages php bin/console translation:extract pt LyranetworkLyraPlugin --dump-messages php bin/console translation:extract br LyranetworkLyraPlugin --dump-messages
使用以下命令清空快取:
php bin/console cache:clear
該外掛程式現在應該出現在您可以建立的付款方式清單中。
在Sylius管理介面中:
前往Configuration > Payment methods
。
點擊頁面右上角的Create
按鈕以顯示可用的付款方式清單。
選擇Payment by Lyra Collect
進行新增和設定。
現在您可以輸入您的 Lyra Collect 憑證並設定您的付款方式。
不要忘記為您的付款方式提供一個代碼,在底部的語言部分中設定名稱,然後點擊Create
按鈕進行儲存。
composer remove lyranetwork/sylius-lyranetwork-plugin
刪除 Sylius 根資料夾中的 LyranetworkLyra 資料夾
刪除檔案sylius/composer.json
中 autoload psr-4 中的行:
"LyranetworkLyra": "LyranetworkLyra/src/"
刪除位於[sylius-root]/config/
的bundles.php檔案中的下列行:
LyranetworkLyraLyranetworkLyraPlugin::class => ['all' => true],
刪除位於[sylius-root]/config/
的paths.yaml檔案中的 Lyra 路由
sylius_lyra:資源:“@LyranetworkLyraPlugin/Resources/config/routing.yaml”
刪除位於[sylius-root]/config/packages
中的 _ sylius.yaml檔案中的 Lyra 回呼:
winzou_state_machine: sylius_ payment:callbacks: after:custom_action: on: ["process", "authorize", "complete"] do: ["@lyranetworklyra.order_service", "sendConfirmationEmail"] args: [mail"
刪除位於[sylius-root]/config
的services.yaml檔案中的 Lyra 服務:
services: [...] lyranetworklyra.order_service: class: LyranetworkLyraServiceOrderService public: true
刪除或取消合併templates/bundles/
中所有新增的範本文件
SyliusAdminBundlePaymentMethod_form.html.twig SyliusAdminBundleOrderShow_payment.html.twig SyliusShopBundleCheckoutSelectPayment_choice.html.twig SyliusUiBundleFormtheme.html.twig
在Sylius根目錄中開啟命令列,然後執行以下命令:
composer dump-autoload php bin/console cache:clear
本發行版中包含的每個 Lyra Collect 支付模組來源檔案均根據 MIT 授權 (MIT) 獲得許可。
請參閱 LICENSE.txt 以取得 MIT 授權的全文。您也可以透過萬維網存取此 URL:https://opensource.org/licenses/mit-license.html。