oktayaydogan/payermax-sdk

Maintainers

Package info

github.com/oktayaydogan/payermax-sdk

pkg:composer/oktayaydogan/payermax-sdk

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.0 2025-07-23 20:32 UTC

This package is auto-updated.

Last update: 2026-03-23 22:05:39 UTC


README

Environment Preparation

composer install

Initialize Config

// Build parameters
$merchantConfig = new MerchantConfig();
$merchantConfig->merchantNo         = "your merchant no";
$merchantConfig->appId              = "your merchantAppId";
$merchantConfig->merchantPrivateKey = "your private key";
$merchantConfig->payermaxPublicKey  = "payermax public key";

// ISV merchant extra parameters
$merchantConfig->spMerchantNo      = "xxx";
$merchantConfig->merchantAuthToken = "xxx";

// Apply configuration
PayermaxClient::setConfig($merchantConfig);

Send Request

// Build the business payload
$requestData = '{
  "outTradeNo": "PAM20220109123456111617V3",
  "subject": "hello",
  "totalAmount": "0.99",
  "currency": "TRY",
  "country": "TR",
  "userId": "100000002",
  "goodsDetails": [{
    "goodsId": "60",
    "goodsName": "60 Diamonds",
    "quantity": "1",
    "price": "0.99",
    "goodsCurrency": "TRY",
    "showUrl": "http://domain.com"
  }],
  "language": "tr",
  "reference": "300011",
  "frontCallbackUrl": "https://domain.url",
  "notifyUrl": "https://domain.com"
}';

$json_decodeData = json_decode($requestData, true);

// Send the request and get the response
$resp = PayermaxClient::send('orderAndPay', $json_decodeData);
echo json_encode($resp) . "\n";

Verify Notification

PayermaxClient::verify("payermax request body", "payermax request sign");