mollie/mollie-api-php
Composer 安装命令:
composer require mollie/mollie-api-php
包简介
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
关键字:
README 文档
README
Mollie API client for PHP
Accepting iDEAL, Apple Pay, Google Pay, Creditcard, Bancontact, SOFORT Banking, SEPA Bank transfer, SEPA Direct debit, PayPal, Belfius Direct Net, KBC/CBC, paysafecard, ING Home'Pay, Giropay, EPS, Przelewy24, Postepay, In3, Klarna (Pay now, Pay later, Slice it, Pay in 3), Giftcard and Voucher online payments without fixed monthly costs or any punishing registration procedures. Just use the Mollie API to receive payments directly on your website or easily refund transactions to your customers.
Requirements
To use the Mollie API client, the following things are required:
- Get yourself a free Mollie account. No sign up costs.
- Now you're ready to use the Mollie API client in test mode.
- Follow a few steps to enable payment methods in live mode, and let us handle the rest.
- PHP >= 7.4
- cUrl >= 7.19.4
- Up-to-date OpenSSL (or other SSL/TLS toolkit)
For leveraging Mollie Connect (advanced use cases only), we recommend also installing our OAuth2 client.
Installation
Using Composer
The easiest way to install the Mollie API client is by using Composer. You can require it with the following command:
composer require mollie/mollie-api-php
Usage
Initializing the Mollie API client, and setting your API key.
$mollie = new \Mollie\Api\MollieApiClient(); $mollie->setToken("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM");
The setToken method automatically detects whether you're using an API key (test_/live_) or an OAuth access token (access_). You can also use setApiKey() or setAccessToken() directly if you prefer to be explicit.
Find our full documentation online on docs.mollie.com.
Example usage
use Mollie\Api\Http\Data\Money; use Mollie\Api\Http\Requests\CreatePaymentRequest; /** @var Mollie\Api\Resources\Payment $payment */ $payment = $mollie->send(new CreatePaymentRequest( description: 'My first API payment', amount: new Money('EUR', '10.00'), redirectUrl: 'https://webshop.example.org/order/12345/', webhookUrl: 'https://webshop.example.org/mollie-webhook/' ));
Documentation
For an in-depth understanding of our API, please explore the Mollie Developer Portal. Our API documentation is available in English.
For detailed documentation about using this PHP client, see the following guides:
- Endpoint Collections - Learn how to interact with all available API endpoints.
- HTTP Adapters - Information on customizing HTTP communication.
- Idempotency - Best practices and setup for idempotent requests.
- Payments - Comprehensive guide on handling payments.
- Requests - Overview and usage of request objects in the API client.
- Responses - Handling and understanding responses from the API.
- Testing - Guidelines for testing with the Mollie API client.
- Debugging - How to debug API requests and responses safely.
- Webhooks - How to process Webhook requests
These guides provide in-depth explanations and examples for advanced usage of the client.
Recipes
The Mollie API client comes with a variety of recipes to help you understand how to implement various API features. These recipes are a great resource for learning how to integrate Mollie payments into your application.
Here are some of the key recipes included:
-
Payments: Demonstrates how to handle various payment scenarios.
-
Customers: Shows how to manage customers and their payments.
-
Subscriptions and Recurring Payments:
For a full list of recipes, please refer to the recipes directory.
These recipes are designed to help you integrate Mollie into your application. Make sure to use your test API keys when testing the integration.
Upgrading
Please see UPGRADING for details.
Contributing to Our API Client
Would you like to contribute to improving our API client? We welcome pull requests. But, if you're interested in contributing to a technology-focused organization, Mollie is actively recruiting developers and system engineers. Discover our current job openings or reach out.
License
BSD (Berkeley Software Distribution) License. Copyright (c) 2013-2018, Mollie B.V.
Support
Contact: www.mollie.com — info@mollie.com — +31 20 820 20 70
mollie/mollie-api-php 适用场景与选型建议
mollie/mollie-api-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16.2M 次下载、GitHub Stars 达 604, 最近一次更新时间为 2013 年 12 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「payment」 「payments」 「service」 「gateway」 「paypal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mollie/mollie-api-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mollie/mollie-api-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mollie/mollie-api-php 相关的其它包
同方向 / 同关键字的高下载量 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
A PSR-7 compatible library for making CRUD API endpoints
Scanpay module for Magento 2
Official Safaricom Daraja M-Pesa integration for Laravel built on ysg/payment-core.
Официальный PHP SDK для платёжного шлюза Oblodai: приём платежей, выплаты, статические кошельки, вебхуки.
统计信息
- 总下载量: 16.2M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 615
- 点击次数: 52
- 依赖项目数: 65
- 推荐数: 2
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2013-12-04