Integrations

Accept crypto payments on WordPress

For a plain WordPress site — a membership, a course, a digital download, a donation page — a small shortcode is enough: it creates a CryBit invoice server-side and shows the payment button or the embedded widget.

A payment shortcode

PHP (mu-plugin)

add_shortcode('crybit_pay', function ($atts) {
    $atts = shortcode_atts(['amount' => '10', 'currency' => 'USD', 'label' => 'Pay with crypto'], $atts);
    $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) $atts['amount'],
        'currency' => $atts['currency'],
        'order_id' => 'WP-' . wp_generate_password(8, false),
    ])]);
    $inv = json_decode(wp_remote_retrieve_body($resp), true);
    return '<a class="crybit-btn" href="' . esc_url($inv['callback_url']) . '">' . esc_html($atts['label']) . '</a>';
});
// использование: [crybit_pay amount="25" currency="USD" label="Оплатить курс"]

Confirming access after payment

For memberships or downloads, generate order_id per user/product, and in the webhook handler grant a role, add to a group, or email the download link once payment.paid arrives for that order_id.

Embedded widget instead of a redirect

Render the widget in a page template with confirmation: {"type":"embedded"} to keep the visitor on your site — see the widget guide for the JavaScript.

FAQ

Do I need a plugin from the WordPress directory?

No — the shortcode above is a few dozen lines in a must-use plugin, and it uses the same public API as every other CryBit integration.

Other platforms

Obter uma chave de API