Integrations
Accept crypto payments in WooCommerce
WooCommerce lets any theme or plugin register a payment gateway, so CryBit connects as a normal custom gateway: on checkout it creates an invoice and redirects to the CryBit payment page, then a webhook marks the order paid.
Register the gateway
PHP (mu-plugin or theme functions.php)
add_filter('woocommerce_payment_gateways', function ($gateways) {
$gateways[] = 'WC_CryBit_Gateway';
return $gateways;
});
add_action('plugins_loaded', function () {
class WC_CryBit_Gateway extends WC_Payment_Gateway {
public function __construct() {
$this->id = 'crybit';
$this->title = 'USDT / Crypto (CryBit)';
$this->has_fields = false;
$this->init_settings();
}
public function process_payment($order_id) {
$order = wc_get_order($order_id);
$resp = wp_remote_post('https://api.crybit.net/api/v1/payments', ['headers' => [
'X-Public-Key' => getenv('CRYBIT_PUBLIC_KEY'),
'X-Private-Key' => getenv('CRYBIT_PRIVATE_KEY'),
'Content-Type' => 'application/json',
], 'body' => json_encode([
'amount' => (float) $order->get_total(),
'currency' => $order->get_currency(),
'order_id' => (string) $order_id,
'return_url' => $order->get_checkout_order_received_url(),
])]);
$inv = json_decode(wp_remote_retrieve_body($resp), true);
$order->update_status('pending', 'Ожидает оплату в CryBit');
return ['result' => 'success', 'redirect' => $inv['callback_url']];
}
}
});Mark the order paid
Add a REST endpoint (or a plugin like WP Webhooks) that receives payment.paid, verifies X-CryBit-Signature (see webhooks) and calls $order->payment_complete() with the CryBit txid.
Embedded checkout instead of redirect
Pass {"type":"embedded"} in confirmation and load widget.js on the order-pay page to keep the customer on your domain — see the widget guide.
FAQ
Is there a ready-made plugin in the WordPress.org repository?
Not yet — the gateway class above is the current integration path and takes a few lines in a small must-use plugin.
Does this work with WooCommerce Blocks checkout?
Yes, WC_Payment_Gateway is supported by the Blocks checkout through the standard compatibility layer; a dedicated Blocks integration class is optional and mainly changes the on-page payment icon.
