Integrations
WooCommerce plugin
Install, settings, what the plugin does, refunds and troubleshooting.
"Pay with ANM" next to your existing methods. WordPress is an API client only: it never touches an Animica RPC node, never counts confirmations, never handles reorgs and never holds a spending key.
Install #
- Plugins → Add New → Upload Plugin, choose
animica-pay-for-woocommerce.zip, install, Activate. - WooCommerce → Settings → Payments → Animica Pay.
- Set Mode to
Test. - Paste your Publishable API key (
apk_test_…) and Secret API key (ask_test_…). - Paste the Webhook signing secret, and register the webhook URL shown on that screen at pay.animica.dev.
- Enter your Merchant ANM address (
anim1…). It is validated the same way the API validates it, so a0x1002address is rejected here too. - Set Checkout expiration (default 10 minutes) and Order status after confirmed payment (default
processing). - Tick Enable, save, and place a test order.
The webhook URL your site exposes is:
https://your-shop.example/wp-json/animica-pay/v1/webhook
Settings reference #
| Setting | Notes |
|---|---|
| Enable/Disable | Off by default. |
| Title | Shown at checkout. Default "Pay with ANM". |
| Description | Shown under the title. |
| Mode | Test or Live. Test never moves real ANM. |
| Publishable key | apk_…. Safe in the page. |
| Secret key | ask_…. Stored in WordPress options; server-side only. |
| Webhook signing secret | Used to verify inbound events. |
| Merchant ANM address | Validated as bech32m ML-DSA-65. |
| Checkout expiration | 2–60 minutes, default 10. |
| Order status after confirmation | processing (default) or completed. |
What the plugin does at checkout #
On process_payment it creates the intent with the order id as the idempotency key, so a retried checkout can never create two intents for one order:
<?php
$out = self::request( 'POST', '/api/v1/payment-intents', $body, 'woo_order_' . $order_id );
then redirects the shopper to checkout_url. Two integrations ship, because one is not enough for broad compatibility: the classic WC_Payment_Gateway (where WooCommerce still routes payment) and Checkout Block support via registerPaymentMethod() plus a server-side AbstractPaymentMethodType.
What it does on the webhook #
Verify the signature, then guard the side effect:
<?php
if ( ! $order->is_paid() ) { // retries are normal; this is the guard
$order->payment_complete( $transaction_hash );
}
It also writes the accounting onto the order so you can reconcile without leaving WordPress: gross, fee (2%), merchant amount, transaction hash and confirmations — the same numbers the dashboard shows.
Refunds #
The normal Refund button works, including partial refunds. Remember that a refund is a new ANM transaction, not a reversal, and that the 2% protocol fee is not returned. See Refunds.
Troubleshooting #
| Symptom | Cause |
|---|---|
| "Pay with ANM" missing at checkout | Not enabled, or no secret key set. |
| Order stays pending after payment | Webhook not reaching your site, secret mismatch, or the 0.1.0 signature gap above. |
401 in the log | Wrong key, revoked key, or a test key against live data. |
| Address rejected on save | Not bech32m anim1…, or a 0x1002 SPHINCS+ address, which cannot spend. |
| Two intents for one order | An idempotency key was not sent. The plugin always sends one; a custom fork may not. |