承接 quellabs/canvas-payments 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

quellabs/canvas-payments

最新稳定版本:1.0.3

Composer 安装命令:

composer require quellabs/canvas-payments

包简介

Payment router for the Canvas PHP framework. Discovers and routes payment operations to installed provider packages.

README 文档

README

Payment router for the Canvas framework. Discovers installed payment provider packages automatically via composer metadata and routes payment operations to the correct provider.

Installation

composer require quellabs/canvas-payments

How it works

PaymentRouter scans installed packages for composer metadata declaring a provider class under the payments discovery key. Any package that declares one and implements PaymentProviderInterface is registered automatically — no manual configuration required.

The provider class must implement a static getMetadata() method returning a modules array. Each entry becomes a routable module identifier.

"extra": {
    "discover": {
        "canvas": {
            "controller": "Quellabs\\Payments\\Mollie\\MollieController"
        },
        "payments": {
            "provider": "Quellabs\\Payments\\Mollie\\Driver",
            "config": "config/mollie.php"
        }
    }
}

At runtime, PaymentRouter uses the paymentModule field on the request to route calls to the correct provider.

Configuration

After composer install, the package publishes a default config file to config/mollie.php via a post-autoload-dump script. Edit this file to set your API key, webhook URL, redirect URL, and cancel URL.

Usage

Inject PaymentRouter via Canvas DI:

use Quellabs\Payments\PaymentRouter;
use Quellabs\Payments\Contracts\PaymentRequest;
use Quellabs\Payments\Contracts\RefundRequest;

class CheckoutService {
    public function __construct(private PaymentRouter $router) {}

    public function pay(): string {
        $response = $this->router->initiate(new PaymentRequest(
            paymentModule: 'mollie_ideal',
            amount:        999,   // in minor units — €9.99
            currency:      'EUR',
            description:   'Order #12345',
        ));

        if (!$response->success) {
            throw new \RuntimeException($response->errorMessage);
        }

        return $response->redirectUrl;
    }
}

Available methods

Method Description
initiate(PaymentRequest) Start a payment session, returns redirect URL and transaction ID
refund(RefundRequest) Issue a refund for a completed payment
exchange(string $transactionId) Fetch current payment state (call from webhook handler)
getRefunds(string $transactionId) Returns all refunds for a given transaction
getPaymentOptions(string $module) Fetch available issuers or options for a payment module
getRegisteredModules() Returns all discovered module identifiers

Requirements

  • PHP 8.2+
  • Quellabs Canvas framework

License

MIT

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固