petericebear/laravel-mollie
Composer 安装命令:
composer require petericebear/laravel-mollie
包简介
Laravel 5 wrapper for payment provider mollie
README 文档
README
This is a package to integrate Mollie with Laravel 5.x. You can use it to easily manage your configuration, and use the Facade to provide shortcuts to the Mollie Client.
Requirements
To use the Mollie API client, the following things are required:
- Get yourself a free Mollie account. No sign up costs.
- Create a new Website profile to generate API keys (live and test mode) and setup your webhook.
- Now you're ready to use the Mollie API client in test mode.
- In order to accept payments in live mode, payment methods must be activated in your account. Follow a few of steps, and let us handle the rest.
- PHP >= 5.2 although Laravel itself requires a higher PHP version
- PHP cURL extension
- Up-to-date OpenSSL (or other SSL/TLS toolkit)
- SSL v3 disabled. Mollie does not support SSL v3 anymore.
Installation
Via Composer
$ composer require petericebear/laravel-mollie
After updating composer, add the MollieServiceProvider to the providers array in config/app.php
PeterIcebear\Mollie\Providers\MollieServiceProvider::class,
You need to publish the config for this package. A sample configuration is provided. The defaults will be merged with gateway specific configuration.
$ php artisan vendor:publish --provider="PeterIcebear\Mollie\Providers\MollieServiceProvider"
To use the Facade (\Mollie::getMethods() instead of App::make('mollie')->getMethods()), add that to the facades array.
'Mollie' => PeterIcebear\Mollie\Facades\Mollie::class,
Usage of the wrapper
Creating a new payment.
$payment = Mollie::getPayments()->create([ "amount" => 10.00, "description" => "My first API payment", "redirectUrl" => "https://webshop.example.org/order/12345/", ]);
After creation, the payment id is available in the $payment->id property. You should store this id with your order.
Retrieving a payment.
$payment = Mollie::getPayments()->get($payment->id); if ($payment->isPaid()) { echo "Payment received."; }
Fully integrated iDEAL payments
If you want to fully integrate iDEAL payments in your web site, some additional steps are required. First, you need to retrieve the list of issuers (banks) that support iDEAL and have your customer pick the issuer he/she wants to use for the payment.
Retrieve the list of issuers:
$issuers = Mollie::getIssuers()->all();
_$issuers will be a list of Mollie_API_Object_Issuer objects. Use the property $id of this object in the
API call, and the property $name for displaying the issuer to your customer.
Create a payment with the selected issuer:
$payment = Mollie::getPayments()->create(array( "amount" => 10.00, "description" => "My first API payment", "redirectUrl" => "https://webshop.example.org/order/12345/", "method" => Mollie_API_Object_Method::IDEAL, "issuer" => $selected_issuer_id, // e.g. "ideal_INGBNL2A" ));
The links property of the $payment object will contain a string paymentUrl, which is a URL that points directly to the online banking environment of the selected issuer.
Refunding payments
The API also supports refunding payments. Note that there is no confirmation and that all refunds are immediate and definitive. Refunds are only supported for iDEAL, credit card, Bancontact/Mister Cash, SOFORT Banking and bank transfer payments. Other types of payments cannot be refunded through our API at the moment.
$payment = Mollie::getPayments()->get($payment->id); // Refund € 15 of this payment $refund = Mollie::getPayments()->refund($payment, 15.00);
More information
Please use the official documentation of Mollie of one off the following resources:
petericebear/laravel-mollie 适用场景与选型建议
petericebear/laravel-mollie 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.89k 次下载、GitHub Stars 达 12, 最近一次更新时间为 2016 年 03 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「mollie」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 petericebear/laravel-mollie 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 petericebear/laravel-mollie 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 petericebear/laravel-mollie 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
eCurring API client library for PHP.
Multishipping support for the Mollie Payment Module for Magento 2
Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment But
Mollie SMS PHP API Repository. Composer-ready.
The Statamic Butik e-commerce solution will integrate nicely with your personal Statamic site and help to grow your online business.
Associate Mollie payments with Laravel Eloquent models
统计信息
- 总下载量: 1.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-10