bridge-payment-sylius/sylius-payment-plugin
Composer 安装命令:
composer require bridge-payment-sylius/sylius-payment-plugin
包简介
Bridge's Sylius payment plugin by bank wire transfer
README 文档
README
Bridge - Sylius Payment plugin
Bridge is a new instant transfer payment solution that allows you to increase your conversion rates by offering instant, secure and seamless collection of payments from your customers' accounts.
What this module does for you
Integrate Bridge, a secure plug-and-play payment solution, to increase your conversion rates at reduced costs. Enjoy easy reconciliation and low fraud rates.
The Bridge payment solution allows merchants to:
- Offer high payment ceilings:
Increase your conversion rates by allowing top carts to pay large sums instantly.
Take advantage of a low-cost payment solutionBoth cost management and cash flow management are simplified. You can take advantage of a more competitive cost than using a credit card by paying a low percentage only on the transactions made on your site.
- Enjoy instant payments:
Receive funds in your bank account fast
- Benefit from irrevocability of payments:
Payments are irrevocable. In other words, customers cannot cancel or modify their payments.
- Reduce fraud rates and offer secure payment
With instant transfer, at the time of payment, your customer is authenticated directly to their online account. No sensitive data will be entered, which makes it possible to offer a secure payment process with a limited risk of fraud.
To create sandbbox applications please refer to the following link : https://docs.bridgeapi.io/docs/dashboard
Installation
Install the plugin form Bridge packagist with Composer:
composer require bridge-payment-sylius/sylius-payment-plugin
Change your config/bundles.php file to add the line for the plugin :
<?php return [ //.. Bridge\SyliusBridgePlugin\BridgeSyliusPaymentPlugin::class => ['all' => true],
Then create the config file in config/packages/bridge_plugin.yaml :
imports: - { resource: "@BridgeSyliusPaymentPlugin/Resources/config/services.yaml" }
Then import the routes in config/routes/bridge_plugin.yaml :
bridge_plugin_routing: resource: "@BridgeSyliusPaymentPlugin/Resources/config/routes.yaml"
Generate a cypher key (encyption key) using the following linux command :
openssl enc -aes-256-cbc -k secret -P -md sha1
When executing this command, a result like this should be displayed :
user@linux:~$ openssl enc -aes-256-cbc -k secret -P -md sha1
Using -iter or -pbkdf2 would be better.
salt=A1540F931FD70663
key=92206EDA1EF9E2EF2121396B2FCD2F9EA16193B98B03940C109E9CE422B0CC73
iv =BF9DC31C16714F4CAD663090E1B4076F
You should copy the key and add it to the variable BRIDGE_CYPHER_KEY in your .env :
###> Bridge Cypher key BRIDGE_CYPHER_KEY= ###< Bridge Cypher key
Execute the following commands to copy the necessary twig files :
cp vendor/bridge-payment-sylius/sylius-payment-plugin/src/Resources/views/PaymentMethod/_form.html.twig templates/bundles/SyliusAdminBundle/PaymentMethod cp vendor/bridge-payment-sylius/sylius-payment-plugin/src/Resources/views/Checkout/SelectPayment/_payment.html.twig templates/bundles/SyliusShopBundle/Checkout/SelectPayment cp vendor/bridge-payment-sylius/sylius-payment-plugin/src/Resources/views/Order/show.html.twig templates/bundles/SyliusShopBundle/Order
Replace the code in templates/bundles/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig with the following :
{% set isBridgePaymentMethod = method.gatewayConfig.factoryName == 'bridge-payment' %}
<div class="item" {{ sylius_test_html_attribute('payment-item') }}>
<div class="field">
<div class="ui radio checkbox" {{ sylius_test_html_attribute('payment-method-checkbox') }}>
{{ form_widget(form, sylius_test_form_attribute('payment-method-select')| sylius_merge_recursive({'attr': {'data-is-bridge-payment-method': isBridgePaymentMethod ? 1 : 0}})) }}
</div>
</div>
<div class="content">
<a class="header">
{{ form_label(form, null, {'label_attr': {'data-test-payment-method-label': ''}}) }}
{% include '@BridgeSyliusPaymentPlugin/Checkout/SelectPayment/_bridge_logo.html.twig' %}
</a>
{% include '@BridgeSyliusPaymentPlugin/Checkout/SelectPayment/_banks.html.twig' %}
{% if method.description is not null %}
<div class="description">
<p>{{ method.description }}</p>
</div>
{% endif %}
{% if method.gatewayConfig.factoryName == 'sylius.pay_pal' %}
{{ render(controller('Sylius\\PayPalPlugin\\Controller\\PayPalButtonsController:renderPaymentPageButtonsAction', {'orderId': order.id})) }}
{% endif %}
</div>
</div>
Update the entity src/Entity/Payment/Payment.php :
<?php declare(strict_types=1); namespace App\Entity\Payment; use Bridge\SyliusBridgePlugin\Model\Payment\PaymentTrait as BridgePaymentTrait; use Doctrine\ORM\Mapping as ORM; use Sylius\Component\Core\Model\Payment as BasePayment; /** * @ORM\Entity * @ORM\Table(name="sylius_payment") */ class Payment extends BasePayment { use BridgePaymentTrait; }
Update the entity src/Entity/Payment/PaymentMethod :
<?php declare(strict_types=1); namespace App\Entity\Payment; use Bridge\SyliusBridgePlugin\Model\Payment\PaymentMethodTrait as BridgePaymentMethodTrait; use Doctrine\ORM\Mapping as ORM; use Sylius\Component\Core\Model\PaymentMethod as BasePaymentMethod; use Sylius\Component\Payment\Model\PaymentMethodTranslationInterface; /** * @ORM\Entity * @ORM\Table(name="sylius_payment_method") */ class PaymentMethod extends BasePaymentMethod { use BridgePaymentMethodTrait; protected function createTranslation(): PaymentMethodTranslationInterface { return new PaymentMethodTranslation(); } }
Apply migrations to your database :
php bin/console doctrine:migrations:migrate
⚠️ Important:
Starting from version 1.0.0, a specific migration is required to ensure proper functionality of the plugin.
After upgrading, execute the following migration:php bin/console doctrine:migrations:execute Version20250716095124Be sure to back up your database before executing the migration.
Rebuild cache for proper display of all translations:
php bin/console cache:clear php bin/console cache:warmup
For the list of banks, an html Mokup template is in your disposal at :
plugin/SyliusBridgePlugin/src/Resources/views/Mokup/index.html.twig
You can access the Mockup template after executing the following command :
php bin/console assets:install
The path for the Mockup is the following :
/admin/bridge/shop/mockup
bridge-payment-sylius/sylius-payment-plugin 适用场景与选型建议
bridge-payment-sylius/sylius-payment-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.94k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2022 年 11 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「plugin」 「payment」 「Bridge」 「sylius」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bridge-payment-sylius/sylius-payment-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bridge-payment-sylius/sylius-payment-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bridge-payment-sylius/sylius-payment-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
The bundle for easy using json-rpc api on your project
Bundle Symfony DaplosBundle
Plugin for YOURLS. Default tools to use in some laemmi plugins
Allows polling user for event dates and times.
Biblioteca PHP pura para pagamentos SISP/Vinti4 de Cabo Verde.
统计信息
- 总下载量: 2.94k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2022-11-08