mollie/laravel-mollie 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mollie/laravel-mollie

Composer 安装命令:

composer require mollie/laravel-mollie

包简介

Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite

README 文档

README

Mollie for Laravel

create new payment

Laravel-Mollie incorporates the Mollie API and Mollie Connect into your Laravel project.

Accepting iDEAL, Apple Pay, Bancontact/Mister Cash, SOFORT Banking, Creditcard, SEPA Bank transfer, SEPA Direct debit, PayPal, Belfius Direct Net, KBC/CBC, paysafecard, ING Home'Pay, Giftcards, Giropay, EPS and Przelewy24 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.****

Looking for a complete recurring billing solution? Take a look at Laravel Cashier for Mollie instead.

Build Status Latest Stable Version Total Downloads

Requirements

  • 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.
  • Up-to-date OpenSSL (or other SSL/TLS toolkit)
  • PHP >= 8.2
  • Laravel >= 11.0
  • Laravel Socialite >= 5.0 (if you intend on using Mollie Connect)

Upgrading from v3.x?

To support the enhanced Mollie API v3, some breaking changes were introduced. Make sure to follow the instructions in the upgrade guide.

Fresh install? Continue with the installation guide below.

Installation

Add Laravel-Mollie to your composer file via the composer require command:

composer require mollie/laravel-mollie

Or add it to composer.json manually:

"require": {
    "mollie/laravel-mollie": "^4.0"
}

Laravel-Mollie's service providers will be automatically registered using Laravel's auto-discovery feature.

Configuration

You'll only need to add the MOLLIE_KEY variable to your .env file.

MOLLIE_KEY=test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Example usage

Here you can see an example of just how simple this package is to use.

A payment using the Mollie API

use Mollie\Api\Http\Data\Money;
use Mollie\Laravel\Facades\Mollie;
use Mollie\Api\Http\Requests\GetPaymentRequest;
use Mollie\Api\Http\Requests\CreatePaymentRequest;

public function preparePayment()
{
    $request = new CreatePaymentRequest(
        description: 'Order #12345',
        amount: new Money('EUR', '10.00'),
        redirectUrl: route('order.success'),
        webhookUrl: route('webhooks.mollie'),
        metadata: [
            "order_id" => "12345",
            "customer_info" => [
                "name" => "John Doe",
                "email" => "john@example.com"
            ]
        ]
    );

    Mollie::send($request);

    // redirect customer to Mollie checkout page
    return redirect($payment->getCheckoutUrl(), 303);
}

/**
 * After the customer has completed the transaction,
 * you can fetch, check and process the payment.
 * This logic typically goes into the controller handling the inbound webhook request.
 * See the webhook docs in /docs and on mollie.com for more information.
 */
public function handleWebhookNotification(Request $request) {
    $paymentId = $request->input('id');

    $payment = Mollie::send(new GetPaymentRequest($paymentId));

    if ($payment->isPaid())
    {
        echo 'Payment received.';
        // Do your thing ...
    }
}

Other examples

Want to help us make our Laravel module even better?

Want to help us make our Laravel module even better? We take pull requests, sure. But how would you like to contribute to a technology oriented organization? Mollie is hiring developers and system engineers. Check out our vacancies or get in touch.

License

The MIT License. Copyright (c) 2024, Mollie B.V.

Support

Contact: www.mollie.cominfo@mollie.com

mollie/laravel-mollie 适用场景与选型建议

mollie/laravel-mollie 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.47M 次下载、GitHub Stars 达 363, 最近一次更新时间为 2016 年 05 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「api」 「payment」 「payments」 「service」 「gateway」 「paypal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 mollie/laravel-mollie 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mollie/laravel-mollie 我们能提供哪些服务?
定制开发 / 二次开发

基于 mollie/laravel-mollie 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 4.47M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 365
  • 点击次数: 43
  • 依赖项目数: 34
  • 推荐数: 0

GitHub 信息

  • Stars: 363
  • Watchers: 40
  • Forks: 64
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-02