speakman/laravel-paymill
最新稳定版本:1.3.2
Composer 安装命令:
composer require speakman/laravel-paymill
包简介
Laravel wrapper for the Paymill API
README 文档
README
Laravel Paymill is a Laravel 5 specific wrapper for the Paymill PHP library.
Please use the 1.0.0 release for Laravel 4
Install
Simply add the following line to your composer.json and run install/update:
"threesquared/laravel-paymill": "~1.3"
Configuration
Publish the package config files to configure your api keys:
php artisan vendor:publish
You will also need to add the service provider and the facade alias to your config/app.php:
'providers' => array( Threesquared\LaravelPaymill\LaravelPaymillServiceProvider::class ) 'aliases' => array( 'Paymill' => Threesquared\LaravelPaymill\Facades\Paymill::class ),
By default the package will use your test keys. In order to use the live Paymill keys you need to set the PAYMILL_ENV enviroment variable.
PAYMILL_ENV=live
Usage
Please see the Paymill API for full documentation on all available entities, actions and methods.
First start with instantiating the Paymill entity you want to work with.
$transaction = Paymill::Transaction();
Available entities are:
Then add in any additional information the request requires with setter methods.
$transaction->setAmount(4200) ->setCurrency('EUR') ->setPayment('pay_2f82a672574647cd911d') ->setDescription('Test Transaction');
Finally chose which action you want to perform.
$transaction->create();
Available actions are:
- create()
- details()
- update()
- all()
- delete()
So an example to create a transaction would be:
try { Paymill::Transaction() ->setAmount(4200) ->setCurrency('EUR') ->setPayment('pay_2f82a672574647cd911d') ->setDescription('Test Transaction') ->create(); } catch(PaymillException $e) { $e->getResponseCode(); $e->getStatusCode(); $e->getErrorMessage(); }
You can set the ID of an entity by passing it as an argument.
Paymill::Client('client_8127a65bf3c84676c918')->details();
Payment create can also take the token as an argument.
Paymill::Payment()->create('098f6bcd4621d373cade4e832627b4f6');
You can also use the $paymill_public_key variable across all blade views.
<script type="text/javascript"> var PAYMILL_PUBLIC_KEY = '{{ $paymill_public_key }}'; </script>
speakman/laravel-paymill 适用场景与选型建议
speakman/laravel-paymill 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 636 次下载、GitHub Stars 达 12, 最近一次更新时间为 2015 年 01 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「payments」 「laravel」 「billing」 「paymill」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 speakman/laravel-paymill 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 speakman/laravel-paymill 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 speakman/laravel-paymill 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dealing with payments through the Egyptian payment gateway PayMob
Librería para la gestión sencilla de pagos mediante TPV Redsys y Paypal
Simple ASCII output of array data
Alfabank REST API integration
Package for view storage in laravel
统计信息
- 总下载量: 636
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-07