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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 romansh/omnipay-creem 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Payyo Gateway for the Omnipay payment processing library
Библиотека для приема платежей через Альфабанк.
Some pre-defined rules for validation in Omnipay payment processing library.
BluePay gateway for the Omnipay payment processing library
支付宝接口扩展包
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 35
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-26