payum/omnipay-v3-bridge
Composer 安装命令:
composer require payum/omnipay-v3-bridge
包简介
This bridge allows you to use omnipay gateways but in payum like way.
README 文档
README
Omnipay created by Adrian Macneil. The lib provides unified api for 25+ gateway gateways. Plus, it simple, has unified, consistent API and fully covered with tests. This bridge allows you to use omnipay gateways but in payum like way.
Why should you use this bridge?
Here's an example from omnipay's repository:
<?php use Omnipay\Omnipay; $gateway = Omnipay::create('Stripe'); $gateway->setApiKey('abc123'); $formData = ['number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2016', 'cvv' => '123']; $response = $gateway->purchase(['amount' => '10.00', 'currency' => 'USD', 'card' => $formData])->send(); if ($response->isSuccessful()) { // payment was successful: update database print_r($response); } elseif ($response->isRedirect()) { // redirect to offsite payment gateway $response->redirect(); } else { // payment failed: display message to customer echo $response->getMessage(); }
and this is same code but done with the bridge:
<?php use Payum\Core\PayumBuilder; use Payum\Core\Request\Capture; use Payum\Core\Request\GetHumanStatus; use Payum\Core\Model\ArrayObject; $payum = (new PayumBuilder()) ->addDefaultStorages() ->addGateway('stripe', ['factory' => 'omnipay_stripe', 'apiKey' => 'abc123']) ->getPayum() ; $card = ['number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2016', 'cvv' => '123']; $payment = new ArrayObject(['amount' => '10.00', 'currency' => 'USD', 'card' => $card]); if ($reply = $payum->getGateway('stripe')->execute(new Capture($payment), true)) { // convert reply to http response } $payum->getGateway('stripe')->execute($status = new GetHumanStatus($payment)); if ($status->isCaptured()) { // success }
Well more or less same amount of code but with the bridge you get more out of the box:
- Return\Cancel urls are generated just of the box. The urls are unique and do not expose any sensitive information.
- If you do not pass credit card, Payum asks a user for it, showing the page with the form.
- You can use Payum's packages for Symfony,Laravel,Silex,Zend,Yii with the bridge.
- Storages. Your payment is already stored on the filesystem. We advice not to use this storage in prod.
- The payment model contains all the information we were able to get from omnipay. Just use it.
- Payum abstracts workflow. It knows when Omnipay's
purchaseorpurchaseCompletemethods should be used. - Credit card details are protected from accidental storing on your side.
- Using the builder you can overwrite any part you want, or add a Payum extension.
Resources
Developed by Forma-Pro
Forma-Pro is a full stack development company which interests also spread to open source development. Being a team of strong professionals we have an aim an ability to help community by developing cutting edge solutions in the areas of e-commerce, docker & microservice oriented architecture where we have accumulated a huge many-years experience. Our main specialization is Symfony framework based solution, but we are always looking to the technologies that allow us to do our job the best way. We are committed to creating solutions that revolutionize the way how things are developed in aspects of architecture & scalability.
If you have any questions and inquires about our open source development, this product particularly or any other matter feel free to contact at opensource@forma-pro.com
License
OmnipayBridge is released under the MIT License.
payum/omnipay-v3-bridge 适用场景与选型建议
payum/omnipay-v3-bridge 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 87.36k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2017 年 09 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「omnipay」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 payum/omnipay-v3-bridge 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 payum/omnipay-v3-bridge 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 payum/omnipay-v3-bridge 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Payyo Gateway for the Omnipay payment processing library
Yandex.Kassa driver for Omnipay payment processing library
Some pre-defined rules for validation in Omnipay payment processing library.
BluePay gateway for the Omnipay payment processing library
Paymentech Orbital driver for the Omnipay payment processing library
MobilPay driver for the Omnipay PHP payment processing library
统计信息
- 总下载量: 87.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 11
- 依赖项目数: 4
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-01