paradox-nl/ laravel-mollie
Laravel 对 Mollie API 的包装
0.1.2
2016-04-08 11:36 UTC
Requires
- mollie/mollie-api-php: 1.4.x
This package is not auto-updated.
Last update: 2024-09-20 19:04:13 UTC
README
此软件包允许您在 Laravel 5.X 中使用 Mollie。
安装
要安装此库,请使用以下命令
composer require paradox-nl/laravel-mollie
接下来,注册 ServiceProvider
\ParadoxNL\Mollie\MollieServiceProvider::class
并注册别名(可选)
'Mollie' => \ParadoxNL\Mollie\Facades\Mollie::class,
以发布配置
php artisan vendor:publish
配置现在位于 config/mollie.php。在这里,您可以设置 API 密钥和 webhook URL
原始文档
https://www.mollie.com/en/docs/overview
方法
此软件包提供了一些开箱即用的方法,但如果你希望使用原生方法,可以使用 getClient() 并使用原生 Mollie API 客户端。
创建支付
创建新支付的方法
示例
Mollie::createPayment( time(), 10.00, 'Some description', Mollie_API_Object_Method::IDEAL, ['issuer' => "ideal_INGNL2A"], ['extra' => 'data'] );
返回值
HTTP/1.1 201 Created Content-Type: application/json; charset=utf-8 { "id": "tr_7UhSN1zuXS", "mode": "test", "createdDatetime": "2014-06-05T08:29:39.0Z", "status": "open", "expiryPeriod": "PT15M", "amount": 10.00, "description": "My first payment", "metadata": { "order_id": "12345" }, "locale": "nl", "profileId": "pfl_QkEhN94Ba", "links": { "paymentUrl": "https://www.mollie.com/payscreen/select-method/7UhSN1zuXS", "redirectUrl": "https://webshop.example.org/order/12345/" } }
isPaid
检查订单是否已支付的方法。
Mollie::isPaid(Illuminate\Http\Request $request)
返回值
布尔值
isOpen
检查订单是否开放的方法。
Mollie::isOpen(Illuminate\Http\Request $request)
返回值
布尔值
历史
列出所有交易的列表,可由配置配置分页。
Mollie::history()
返回值
包含过去交易列表的数组。
getClient
返回原生 Mollie API 客户端
Mollie::getClient()->nativeMethod()
返回值
Mollie_API_Client