Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Oxialink PHP SDK

Official PHP client for the Oxialink crypto payment gateway. Create invoices, verify webhooks, send withdrawals. No dependencies beyond curl.

Install

composer require oxialink/oxialink-php

Or drop src/ into your project and require the two files.

Create an invoice

use Oxialink\OxialinkClient;

$oxialink = new OxialinkClient('API_KEY', 'API_SECRET');

$invoice = $oxialink->createInvoice([
    'amount' => 10,                 // in fiat_currency, or in the coin with amount_type => 'crypto'
    'fiat_currency' => 'USD',
    'coin' => 'USDT_TON',
    'external_id' => 'order-1234',  // echoed back in every webhook
    'callback_url' => 'https://your-site.com/webhook.php',
]);

header('Location: ' . $invoice['url']); // hosted checkout with QR + live confirmations

Verify a webhook

use Oxialink\Webhook;

$delivery = Webhook::verifyCurrentRequest('WEBHOOK_SECRET'); // throws on bad signature

if ($delivery['event'] === 'payment.completed') {
    markOrderPaid($delivery['data']['external_id'], $delivery['data']['tx_hash']);
}

Events: payment.completed, payment.underpaid, payment.uncredited, invoice.expired, withdrawal.completed.

Also available

getInvoice($code), getBalance($coin), createWithdrawal($coin, $amount, $to), validateAddress($coin, $address), createTelegramInvoiceButton([...]).

Full API reference: https://oxialink.com/api-docs

About

Official PHP SDK for the Oxialink crypto payment gateway. Create invoices, verify signed webhooks, send withdrawals. No dependencies.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages