PHP example for generate payment links:
$this->apiKey = $apiKey;
$this->secretKey = $secretKey;
}
/**
* @param array $queryParams
*
* @return string
*/
public function generatePaymentLink(array $queryParams): string
{
$queryParams = array_merge(
['merchant' => $this->merchantId],
$queryParams,
['apikey' => $this->apiKey]
);$queryString = http_build_query($queryParams, null, '&', PHP_QUERY_RFC3986);
$apiseal = hash_hmac(self::DIGEST_ALGORITHM, $queryString, $this->secretKey);
return self::ENDPOINT . $queryString . '&apiseal=' . $apiseal;
}
}$queryParams = [
'fiat_amount' => 100,
'fiat_currency' => 'USD',
'saveaddress' => 1,
'to' => 'muxy2TuEVmSDhYJ5naEAcYDfiV6bajhLcX',
'track_id' => '1234567890',
'user_email' => '[email protected]',
];$merchantId = 'dXxL5g35BeZ';
$apiKey = 'TEUbtrJ8hu2W1N3u4jwcXN5rA6ngssqq';
$secret = 'YfG0BZ8isHZ6w2iNEa6VqzTLdqdLVEKl';$paxfulMerchant = new PaxfulMerchant($merchantId, $apiKey, $secret);
$paymentLink = $paxfulMerchant->generatePaymentLink($queryParams);
echo $paymentLink;