genome/merchant
最新稳定版本:0.0.4
Composer 安装命令:
composer require genome/merchant
包简介
Genome merchant client libraries
README 文档
README
Genome merchant account client library.
Easy start
Initialize merchant account manager using merchant account identifier and secret.
use Genome\Merchant\MerchantAccountManager; $merchantAccountLogin = "foo"; // Your merchant account login $merchantAccountSecret = "baz"; // Your merchant account password $accountManager = new MerchantAccountManager($merchantAccountLogin, $merchantAccountSecret);
Then obtain hosted payment page manager from merchant account manager by providing hosted payment page api key and secret (they differ from merchant account ones).
$hppApiKey = 'xxx'; $hppApiSecret = 'yyy'; $hppManager = $accountManager->getHostedPaymentPageManager($hppApiKey, $hppApiSecret)
Verify hosted payment page callback signature
try { $hppManager->assertCallbackSignature(getallheaders(), file_get_contents('php://input')); } catch (\Exception e) { // Signature assertion failed }
Or initialize new payment redirect using HostedPayment:
$payment = new HostedPayment( "uniqueOrderId", "userId", "mcc", "eur", 9.99 ); $redirectUrl = $hppManager->generateInitializationRedirectUrl($payment);
The HostedPayment is a mutable object containing payment data, it provides
setters for additional parameters like email, phone, etc.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-24