Advanced Features
Custom Checkout Logic
Modifying invoice metadata
The plugin does not expose a public filter hook for modifying invoice parameters before creation. To add custom metadata, you would need to extend the AbstractGateway class in a custom plugin and override createInvoice().
The plugin does pass a metadata array to every invoice, including:
taxIncluded— cart tax amountorderNumber— WooCommerce order number (may differ from order ID with custom order number plugins)coinsnapDiscount— discount amount if a Bitcoin discount is active- Customer fields (
buyerEmail,buyerName, full address) if Send Customer Data is enabled in settings
Custom order status handling
You can react to Coinsnap-driven status changes using standard WooCommerce hooks:
// Fires when WooCommerce updates an order status
add_action('woocommerce_order_status_changed', function($order_id, $old_status, $new_status) {
if ($new_status === 'completed') {
$invoice_id = get_post_meta($order_id, 'Coinsnap_id', true);
if ($invoice_id) {
// This order was paid via Coinsnap — add your logic here
}
}
}, 10, 3);
Multisite Support
The plugin stores credentials in the global wp_options table using site-level options (get_option / update_option). In a WordPress multisite network, each subsite has its own wp_options table, so each subsite requires its own plugin activation, Store ID, and API key configured independently.
High-volume considerations
The plugin has a built-in idempotency guard: before creating a new invoice, it checks Coinsnap_id post meta for the order and verifies the existing invoice status on the Coinsnap API. If a valid (non-expired) invoice already exists, the customer is redirected to it rather than creating a duplicate.
For high-traffic stores with many concurrent orders, ensure WordPress cron is running reliably (or replaced with a system cron) so that WooCommerce background jobs process correctly alongside webhook delivery.