承接 romansh/omnipay-creem 相关项目开发

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

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

romansh/omnipay-creem

Composer 安装命令:

composer require romansh/omnipay-creem

包简介

Creem driver for Omnipay payment processing library

README 文档

README

Creem.io gateway driver for the Omnipay payment processing library.

Installation

composer require romansh/omnipay-creem

Features

  • Hosted Checkout — redirect customers to Creem-hosted payment page
  • Webhook verification — HMAC SHA-256 signature validation
  • Customer Portal — generate self-service billing URLs
  • Subscription lifecycle — handle active, trialing, canceled, expired, and renewed events

Gateway Parameters

Parameter Description Default
apiKey Your Creem API key ''
testMode Enable sandbox/test mode true
webhookSecret Secret for verifying webhook signatures ''
productId Default Creem Product ID ''

Usage

Initialize the gateway

use Omnipay\Omnipay;

$gateway = Omnipay::create('Creem');
$gateway->setApiKey('your_api_key');
$gateway->setTestMode(true);

Create a checkout (purchase)

$response = $gateway->purchase([
    'productId'     => 'prod_xxxxxxxxx',   // Creem product ID
    'transactionId' => 'ORDER-12345',       // your unique order/request ID
    'returnUrl'     => 'https://your-site.com/return',
    'card' => [
        'email' => 'customer@example.com',
        'name'  => 'John Doe',
    ],
    'description' => 'Premium plan',
])->send();

if ($response->isRedirect()) {
    $response->redirect(); // send the customer to Creem checkout

    // — or get the URL to use in your own redirect / JS —
    // $checkoutUrl = $response->getRedirectUrl();
    // $checkoutId  = $response->getTransactionReference();
} else {
    echo 'Error: ' . $response->getMessage();
}

Handle a webhook (completePurchase)

completePurchase() reads the incoming HTTP request body and validates the creem-signature header automatically — no parameters are needed.

$gateway->setWebhookSecret('your_webhook_secret');

$response = $gateway->completePurchase()->send();

switch ($response->getEventType()) {
    case 'checkout.completed':
        $orderId  = $response->getTransactionId();   // your request_id
        $customer = $response->getCustomer();         // ['id' => …, 'email' => …]
        $product  = $response->getProduct();          // ['id' => …, 'name' => …]
        // mark order as paid …
        break;

    case 'subscription.active':
    case 'subscription.renewed':
        // grant / extend access
        break;

    case 'subscription.trialing':
        // grant trial access
        break;

    case 'subscription.canceled':
    case 'subscription.expired':
        // revoke access
        break;

    case 'refund.created':
        // process refund
        break;
}

http_response_code(200);
echo json_encode(['status' => 'ok']);

Customer Portal

$response = $gateway->customerPortal([
    'customerId' => 'cust_xxxxxxxxx',
])->send();

if ($response->isSuccessful()) {
    $portalUrl = $response->getPortalUrl();
    header("Location: {$portalUrl}");
}

Full examples

See examples/usage.php for a complete standalone script and a Laravel controller example.

License

MIT

romansh/omnipay-creem 适用场景与选型建议

romansh/omnipay-creem 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 02 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-26