CoinPayments adapter

Drop-in compatibility adapter for existing shopping-cart plugins.

payzum exposes a form-encoded endpoint at /legacy/api.php. It accepts a command-based protocol with HMAC-SHA-512 request signing — a wire format used by common shopping-cart payment plugins. In most cases, swapping the base URL is enough to migrate an existing integration without any code changes.

This adapter is designed as a drop-in replacement for shopping-cart plugins that use the form-encoded, HMAC-signed protocol. Point your plugin at your payzum host and enter your payzum public/private key pair where the plugin asks for gateway credentials.

Signing requests

Every request body is signed exactly as transmitted: the HMAC header is the lowercase hex output of HMAC-SHA-512(private_key, raw_body_bytes). Do not re-encode the form before signing — the bytes you send must match the bytes you signed.

cmd=create_transaction

Creates an invoice. Equivalent to POST /v1/payment in the REST API.

BODY="version=1&cmd=create_transaction&key=<PUBLIC_KEY>&nonce=$(date +%s%3N)&amount=10.00&currency1=USD&currency2=USDT.TRC20&invoice=ORDER-1234&ipn_url=https%3A%2F%2Fmerchant.example.com%2Fipn"
HMAC=$(printf '%s' "$BODY" | openssl dgst -sha512 -hmac "<PRIVATE_KEY>" | sed 's/^.*= //')
curl -X POST "https://<HOST>/legacy/api.php" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "HMAC: $HMAC" \
  -d "$BODY"

cmd=get_tx_info

Reads a single invoice by its payzum id (txid).

BODY="version=1&cmd=get_tx_info&key=<PUBLIC_KEY>&nonce=$(date +%s%3N)&txid=pzi_..."
HMAC=$(printf '%s' "$BODY" | openssl dgst -sha512 -hmac "<PRIVATE_KEY>" | sed 's/^.*= //')
curl -X POST "https://<HOST>/legacy/api.php" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "HMAC: $HMAC" \
  -d "$BODY"

cmd=rates

Returns the current rate table for supported currencies. No per-transaction parameters.

BODY="version=1&cmd=rates&key=<PUBLIC_KEY>&nonce=$(date +%s%3N)"
HMAC=$(printf '%s' "$BODY" | openssl dgst -sha512 -hmac "<PRIVATE_KEY>" | sed 's/^.*= //')
curl -X POST "https://<HOST>/legacy/api.php" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "HMAC: $HMAC" \
  -d "$BODY"

Limitations

  • The adapter implements the common command surface (create_transaction, get_tx_info, rates). Advanced commands such as mass withdrawals and currency conversion are not yet supported.
  • IPN payloads are delivered using payzum's signed-webhook format. See webhooks.