descubraomundo/omnipay-ebanx
Composer 安装命令:
composer require descubraomundo/omnipay-ebanx
包简介
Ebanx driver for the Omnipay payment processing library
README 文档
README
Ebanx gateway for the Omnipay PHP payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Pagar.Me support for Omnipay.
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
Install
Instal the gateway using require. Require the league/omnipay base package and this gateway.
$ composer require league/omnipay descubraomundo/omnipay-ebanx
Usage
The following gateways are provided by this package:
- Ebanx
For general usage instructions, please see the main Omnipay repository.
Example with Credit Card
// Create a gateway for the Ebanx Gateway // (routes to GatewayFactory::create) $gateway = Omnipay::create('Ebanx'); // Initialise the gateway $gateway->initialize(array( 'integration_key' => 'MyApiKey', )); // Create a credit card object // This card can be used for testing. $card = new CreditCard(array( 'firstName' => 'Example', 'lastName' => 'Customer', //'name' => 'Example Customer', 'birthday' => '1988-02-28', 'gender' => 'M', 'number' => '4242424242424242', 'expiryMonth' => '01', 'expiryYear' => '2020', 'cvv' => '123', 'email' => 'customer@example.com', 'address1' => 'Street name, Street number, Complementary', 'address2' => 'Neighborhood', 'postcode' => '05443100', 'phone' => '19 3242 8855', )); // Do an authorize transaction on the gateway $transaction = $gateway->authorize(array( 'amount' => '10.00', 'paymentMethod' => 'creditcard', 'installments' => 5, 'documentNumber' => '246.375.149-23', // CPF or CNPJ 'notifyUrl' => 'http://application.com/api/', 'card' => $card, // 'cardReference' => 'card_k5sT...', )); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Authorize transaction was successful!\n"; $sale_id = $response->getTransactionReference(); echo "Transaction reference = " . $sale_id . "\n"; }
Example with Boleto
// Create a gateway for the Ebanx Gateway // (routes to GatewayFactory::create) // Create array with customer data $customer = array( 'firstName' => 'Example', 'lastName' => 'Customer',, 'email' => 'customer@example.com', 'address1' => 'Street name, Street number, Complementary', 'address2' => 'Neighborhood', 'postcode' => '05443100', 'phone' => '19 3242 8855', )); // Create a credit card object // The card object is required by default to get all the customer information, even if you want to use boleto payment method. $card = new CreditCard(array( 'firstName' => 'Example', 'lastName' => 'Customer', //'name' => 'Example Customer', 'birthday' => '1988-02-28', 'gender' => 'M', 'number' => '4242424242424242', 'expiryMonth' => '01', 'expiryYear' => '2020', 'cvv' => '123', 'email' => 'customer@example.com', 'address1' => 'Street name, Street number, Complementary', 'address2' => 'Neighborhood', 'city' => 'City', 'state' => 'sp', 'country' => 'BR', 'postcode' => '05443100', 'phone' => '19 3242 8855', )); // Do an authorize transaction on the gateway $transaction = $gateway->authorize(array( 'amount' => '10.00', 'paymentMethod' => 'boleto', 'documentNumber' => '246.375.149-23', // CPF or CNPJ 'notifyUrl' => 'http://application.com/api/', 'card' => $card, )); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Authorize Boleto transaction was successful!\n"; $sale_id = $response->getTransactionReference(); $boleto = $response->getBoleto(); echo "Boleto Url = " . $boleto['boleto_url']; echo "Boleto Barcode = " . $boleto['boleto_barcode']; echo "Boleto Expiration Date = " . $boleto['boleto_expiration_date']; echo "Transaction reference = " . $sale_id . "\n"; }
Test Mode
Ebanx accounts use two different endpoints for the sandbox-mode and live-mode using the same API key.
In case you want to use sandbox-mode just pass the testMode parameter when seting up the gateway:
// Create a gateway for the Ebanx Gateway // (routes to GatewayFactory::create) $gateway = Omnipay::create('Ebanx'); // Initialise the gateway $gateway->initialize(array( 'testMode' => true, 'integration_key' => 'MyApiKey', ));
Data created with sandbox-mode credentials will never hit the credit card networks and will never cost anyone money.
Support
If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.
If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email geeks@descubraomundo.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
descubraomundo/omnipay-ebanx 适用场景与选型建议
descubraomundo/omnipay-ebanx 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 616 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 08 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「omnipay」 「ebanx」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 descubraomundo/omnipay-ebanx 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 descubraomundo/omnipay-ebanx 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 descubraomundo/omnipay-ebanx 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
EBANX PHP library
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
统计信息
- 总下载量: 616
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-08-23