genome/merchant

Genome merchant client libraries

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/genome/merchant

0.0.4 2025-11-25 08:03 UTC

This package is not auto-updated.

Last update: 2025-12-09 09:39:47 UTC


README

PHP CI

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.