The WordPress / WooCommerce payment gateway for Nomba hosted checkout, HPOS-compatible, with native admin refunds.
integrations/woocommerce/ is a single WordPress plugin exposing two independent gateways, Nomba and Duro; either or both can be enabled. It is HPOS compatible, unit tested (51 tests), and verified against a real WordPress store and the real Nomba sandbox (live card payment and refund). Source: woocommerce/README.md, woocommerce/readme.txt, and woocommerce/includes/.
Upload the plugin zip via Plugins, Add New, Upload Plugin, then activate. (Build it with bash tools/build.sh, which produces dist/nomba-woocommerce.zip.)
Open WooCommerce, Settings, Payments.
Open the Nomba payment method and enter the Account ID, Client ID, and Client secret from the Nomba dashboard (API Keys). Use the parent (business) Account ID; a sub-account ID is rejected at authentication. Test keys work with test mode on.
Enter the Webhook signature key from the dashboard webhook settings. Optionally set a Sub-account ID to deposit payments into a sub-account.
In the Nomba dashboard, set the webhook URL to https://your-store.example/wp-json/nomba/v1/webhook.
Enable the gateway and save.
On a fresh WordPress install with Plain permalinks, /wp-json/... silently returns the homepage with a 200 instead of routing to the REST API, so the webhook endpoint would appear to accept everything. Set Settings, Permalinks to any option other than Plain (for example Post name) before relying on the webhook.
process_payment creates a Nomba checkout order (POST {prefix}/order) and redirects the shopper to data.checkoutLink. The order stores _nomba_order_reference and _nomba_mode.
verify_on_return calls the verify endpoint and completes the order only on paid plus a matching amount.
The webhook (POST /wp-json/nomba/v1/webhook) verifies the nine-field HMAC signature from the nomba-signature header with the nomba-timestamp header, enforces a 300-second replay window, then re-verifies the transaction with the Nomba API (verify_order, GET {prefix}/transaction) before doing anything else. The API response is the source of truth, not the webhook payload. It cross-checks the verified amount and currency, stores _nomba_transaction_id from the verified paymentReference, and completes the order. Re-verification applies to payment_success only; payment_failed marks an unpaid order failed and payment_reversal marks a paid order refunded, both from the signed event without an extra API call.
Refunds run from the WooCommerce order screen through POST {prefix}/refund with the stored transaction id; partial amounts are supported. Refunds use the mode the order was paid in.
Environments
Test mode (default on) targets https://sandbox.nomba.com; live mode targets https://api.nomba.com. Both use the same /v1/checkout prefix; only the host differs. The base URL can be overridden for local testing with the NOMBA_WC_API_BASE constant or the nomba_wc_api_base_url filter, which the local mock server uses.
The Duro gateway
The same plugin ships a second, independent Duro hosted-checkout gateway (class-wc-gateway-duro.php) with saved cards and recovery:
process_payment creates a Duro checkout session (POST /v1/checkout/sessions, amount in kobo, mandatory Idempotency-Key header) and redirects to the hosted checkout URL. The order stores _duro_session_id, _duro_token, _duro_mode.
verify_on_return calls Duro_Client::get_session and completes the order only when the session status is completed plus a matching amount (kobo).
The webhook (POST /wp-json/duro/v1/webhook) verifies the t.rawBody HMAC signature from the duro-signature header, enforces a 300-second replay window, dedupes on duro-event-id, then re-verifies the session with the Duro API before completing on checkout_completed or subscription_payment_success.
No refunds. A one-off Duro checkout (kind: one_time) creates no refundable invoice, so the Duro gateway does not declare refunds support; use the Nomba gateway when a refund is required.
The Duro base host follows the secret-key prefix: sk_test_ targets https://sandbox.useduro.com, sk_live_ targets https://api.useduro.com. Overridable via the DURO_WC_API_BASE constant or the duro_wc_api_base_url filter.
Error states
Failure
Surface
Bad credentials (either gateway)
Admin notice, checkout hidden, log source nomba or duro
Checkout/session create fails
Shopper notice, order note, log
Invalid webhook signature
401, log warning
Stale webhook timestamp
401, log warning
Nomba/Duro API re-verify call fails
502, log error
API reports the payment not yet completed
200 unverified, order untouched
Amount or currency mismatch (verified values)
Order on hold, log error
Refund without transaction id (Nomba only)
Explanatory refund error in admin
Refund rejected by Nomba
Refund error plus order note
Refund attempted on a Duro order
Not offered; Duro has no refund UI
Tests and demo
51 unit tests cover the gateway class (process_payment, return verify, refund) plus the protocol classes (client, signature, webhook), run from the repo root:
docker run --rm -v "$PWD":/repo -w /repo/tools/tests composer:2.7 composer installdocker run --rm -v "$PWD":/repo -w /repo/tools/tests php:8.3-cli vendor/bin/phpunit
A full local checkout, webhook, and refund walkthrough against the mock Nomba server (no credentials) lives in tools/demo/woocommerce/README.md: it stands up WordPress + WooCommerce 9.4.3 in Docker, points the gateway at the mock via NOMBA_WC_API_BASE, and walks six webhook exercises (valid completion, wrong secret, tampered payload, stale timestamp, amount mismatch, reversal) plus an admin refund. Switching to the real sandbox is a documented volume-reset step.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Duro","colors":{"primary":"#3B82F6","light":"#60A5FA","dark":"#2563EB"},"logo":{"light":"https://mintcdn.com/latch-7241ffdc/z0mc5L14iWCUHezA/logo/light.svg?fit=max\u0026auto=format\u0026n=z0mc5L14iWCUHezA\u0026q=85\u0026s=0f4825b3c74998b48cd92889a917ae32","dark":"https://mintcdn.com/latch-7241ffdc/z0mc5L14iWCUHezA/logo/dark.svg?fit=max\u0026auto=format\u0026n=z0mc5L14iWCUHezA\u0026q=85\u0026s=f02c4af3de66792edeb166eb78fea43d"},"favicon":"https://mintcdn.com/latch-7241ffdc/kH-52jALQSi96byV/favicon.svg?fit=max\u0026auto=format\u0026n=kH-52jALQSi96byV\u0026q=85\u0026s=c9da7a7811fb0cc15dc4b3658fcba78e","background":{},"navbar":{"links":[{"href":"https://github.com/treasure567/duro","label":"GitHub"}],"primary":{"type":"button","label":"Dashboard","href":"https://useduro.com"}},"footer":{"socials":{}},"fonts":{"heading":{"family":"Fraunces"},"body":{"family":"Geist"}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"latch-7241ffdc","hasAudioNarration":false,"actualSubdomain":"latch-7241ffdc","customDomains":["docs.useduro.com"],"gitSource":{"type":"github","owner":"treasure567","repo":"duro","deployBranch":"docs","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6ae95b7da9cd2a01522dd53f:success","clientVersion":"0.0.4344","searchFilterCounts":[{"language":"default","tag":"API Reference","count":75},{"language":"default","tag":"Duro","count":30},{"language":"default","tag":"VAS","count":13},{"language":"default","tag":"Webhooks","count":12},{"language":"default","tag":"Customers","count":9},{"language":"default","tag":"Payouts","count":8},{"language":"default","tag":"General","count":7},{"language":"default","tag":"Subscriptions","count":7},{"language":"default","tag":"Quill","count":6},{"language":"default","tag":"Integrations","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"integrations/woocommerce","slug":"/integrations/woocommerce","pageMetadata":{"title":"WooCommerce","sidebarTitle":"WooCommerce","description":"The WordPress / WooCommerce payment gateway for Nomba hosted checkout, HPOS-compatible, with native admin refunds.","mode":"wide","href":"/integrations/woocommerce"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"The WordPress / WooCommerce payment gateway for Nomba hosted checkout, HPOS-compatible, with native admin refunds.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`integrations/woocommerce/`}),` is a single WordPress plugin exposing `,_jsx(_components.strong,{children:`two independent gateways`}),`, Nomba and Duro; either or both can be enabled. It is HPOS compatible, unit tested (51 tests), and verified against a real WordPress store and the real Nomba sandbox (live card payment and refund). Source: `,_jsx(_components.code,{children:`woocommerce/README.md`}),`, `,_jsx(_components.code,{children:`woocommerce/readme.txt`}),`, and `,_jsx(_components.code,{children:`woocommerce/includes/`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`structure`,children:`Structure`}),`\n`,_jsx(CodeBlock,{numberOfLines:`12`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`woocommerce/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` nomba-for-woocommerce.php plugin bootstrap, gateway registration`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` readme.txt WordPress.org manifest, install + FAQ`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` uninstall.php cleanup on delete`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` includes/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` class-wc-gateway-nomba.php WC_Payment_Gateway subclass (Nomba)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` class-nomba-client.php token issue (cached) + order/verify/refund`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` class-nomba-signature.php nine-field HMAC verification, 300s window`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` class-nomba-webhook.php REST webhook handler, re-verifies`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` class-wc-gateway-duro.php second gateway (Duro hosted checkout)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` class-duro-client.php / -signature.php / -webhook.php`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`install`,children:`Install`}),`\n`,_jsxs(_components.p,{children:[`From `,_jsx(_components.code,{children:`readme.txt`}),`:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Upload the plugin zip via `,_jsx(_components.strong,{children:`Plugins, Add New, Upload Plugin`}),`, then activate. (Build it with `,_jsx(_components.code,{children:`bash tools/build.sh`}),`, which produces `,_jsx(_components.code,{children:`dist/nomba-woocommerce.zip`}),`.)`]}),`\n`,_jsxs(_components.li,{children:[`Open `,_jsx(_components.strong,{children:`WooCommerce, Settings, Payments`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Open the `,_jsx(_components.strong,{children:`Nomba`}),` payment method and enter the `,_jsx(_components.strong,{children:`Account ID`}),`, `,_jsx(_components.strong,{children:`Client ID`}),`, and `,_jsx(_components.strong,{children:`Client secret`}),` from the Nomba dashboard (API Keys). Use the parent (business) Account ID; a sub-account ID is rejected at authentication. Test keys work with test mode on.`]}),`\n`,_jsxs(_components.li,{children:[`Enter the `,_jsx(_components.strong,{children:`Webhook signature key`}),` from the dashboard webhook settings. Optionally set a `,_jsx(_components.strong,{children:`Sub-account ID`}),` to deposit payments into a sub-account.`]}),`\n`,_jsxs(_components.li,{children:[`In the Nomba dashboard, set the webhook URL to `,_jsx(_components.code,{children:`https://your-store.example/wp-json/nomba/v1/webhook`}),`.`]}),`\n`,_jsx(_components.li,{children:`Enable the gateway and save.`}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`On a fresh WordPress install with `,_jsx(_components.strong,{children:`Plain`}),` permalinks, `,_jsx(_components.code,{children:`/wp-json/...`}),` silently returns the homepage with a 200 instead of routing to the REST API, so the webhook endpoint would appear to accept everything. Set Settings, Permalinks to any option other than Plain (for example Post name) before relying on the webhook.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`nomba-lifecycle`,children:`Nomba lifecycle`}),`\n`,_jsxs(_components.p,{children:[`The gateway (`,_jsx(_components.code,{children:`class-wc-gateway-nomba.php`}),`) implements the shared `,_jsx(_components.a,{href:`/integrations/architecture`,children:`verification-first lifecycle`}),`:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`process_payment`})}),` creates a Nomba checkout order (`,_jsx(_components.code,{children:`POST {prefix}/order`}),`) and redirects the shopper to `,_jsx(_components.code,{children:`data.checkoutLink`}),`. The order stores `,_jsx(_components.code,{children:`_nomba_order_reference`}),` and `,_jsx(_components.code,{children:`_nomba_mode`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`verify_on_return`})}),` calls the verify endpoint and completes the order `,_jsx(_components.strong,{children:`only`}),` on `,_jsx(_components.code,{children:`paid`}),` plus a matching amount.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`The webhook`}),` (`,_jsx(_components.code,{children:`POST /wp-json/nomba/v1/webhook`}),`) verifies the nine-field HMAC signature from the `,_jsx(_components.code,{children:`nomba-signature`}),` header with the `,_jsx(_components.code,{children:`nomba-timestamp`}),` header, enforces a 300-second replay window, then `,_jsx(_components.strong,{children:`re-verifies`}),` the transaction with the Nomba API (`,_jsx(_components.code,{children:`verify_order`}),`, `,_jsx(_components.code,{children:`GET {prefix}/transaction`}),`) before doing anything else. The API response is the source of truth, not the webhook payload. It cross-checks the verified amount and currency, stores `,_jsx(_components.code,{children:`_nomba_transaction_id`}),` from the verified `,_jsx(_components.code,{children:`paymentReference`}),`, and completes the order. Re-verification applies to `,_jsx(_components.code,{children:`payment_success`}),` only; `,_jsx(_components.code,{children:`payment_failed`}),` marks an unpaid order failed and `,_jsx(_components.code,{children:`payment_reversal`}),` marks a paid order refunded, both from the signed event without an extra API call.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Refunds`}),` run from the WooCommerce order screen through `,_jsx(_components.code,{children:`POST {prefix}/refund`}),` with the stored transaction id; partial amounts are supported. Refunds use the mode the order was paid in.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`environments`,children:`Environments`}),`\n`,_jsxs(_components.p,{children:[`Test mode (default on) targets `,_jsx(_components.code,{children:`https://sandbox.nomba.com`}),`; live mode targets `,_jsx(_components.code,{children:`https://api.nomba.com`}),`. Both use the same `,_jsx(_components.code,{children:`/v1/checkout`}),` prefix; only the host differs. The base URL can be overridden for local testing with the `,_jsx(_components.code,{children:`NOMBA_WC_API_BASE`}),` constant or the `,_jsx(_components.code,{children:`nomba_wc_api_base_url`}),` filter, which the local mock server uses.`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-duro-gateway`,children:`The Duro gateway`}),`\n`,_jsxs(_components.p,{children:[`The same plugin ships a second, independent Duro hosted-checkout gateway (`,_jsx(_components.code,{children:`class-wc-gateway-duro.php`}),`) with saved cards and recovery:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`process_payment`})}),` creates a Duro checkout session (`,_jsx(_components.code,{children:`POST /v1/checkout/sessions`}),`, amount in kobo, mandatory `,_jsx(_components.code,{children:`Idempotency-Key`}),` header) and redirects to the hosted checkout URL. The order stores `,_jsx(_components.code,{children:`_duro_session_id`}),`, `,_jsx(_components.code,{children:`_duro_token`}),`, `,_jsx(_components.code,{children:`_duro_mode`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`verify_on_return`})}),` calls `,_jsx(_components.code,{children:`Duro_Client::get_session`}),` and completes the order only when the session status is `,_jsx(_components.code,{children:`completed`}),` plus a matching amount (kobo).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`The webhook`}),` (`,_jsx(_components.code,{children:`POST /wp-json/duro/v1/webhook`}),`) verifies the `,_jsx(_components.code,{children:`t.rawBody`}),` HMAC signature from the `,_jsx(_components.code,{children:`duro-signature`}),` header, enforces a 300-second replay window, dedupes on `,_jsx(_components.code,{children:`duro-event-id`}),`, then re-verifies the session with the Duro API before completing on `,_jsx(_components.code,{children:`checkout_completed`}),` or `,_jsx(_components.code,{children:`subscription_payment_success`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`No refunds.`}),` A one-off Duro checkout (`,_jsx(_components.code,{children:`kind: one_time`}),`) creates no refundable invoice, so the Duro gateway does not declare `,_jsx(_components.code,{children:`refunds`}),` support; use the Nomba gateway when a refund is required.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The Duro base host follows the secret-key prefix: `,_jsx(_components.code,{children:`sk_test_`}),` targets `,_jsx(_components.code,{children:`https://sandbox.useduro.com`}),`, `,_jsx(_components.code,{children:`sk_live_`}),` targets `,_jsx(_components.code,{children:`https://api.useduro.com`}),`. Overridable via the `,_jsx(_components.code,{children:`DURO_WC_API_BASE`}),` constant or the `,_jsx(_components.code,{children:`duro_wc_api_base_url`}),` filter.`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-states`,children:`Error states`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Failure`}),_jsx(_components.th,{children:`Surface`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Bad credentials (either gateway)`}),_jsxs(_components.td,{children:[`Admin notice, checkout hidden, log source `,_jsx(_components.code,{children:`nomba`}),` or `,_jsx(_components.code,{children:`duro`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Checkout/session create fails`}),_jsx(_components.td,{children:`Shopper notice, order note, log`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Invalid webhook signature`}),_jsx(_components.td,{children:`401, log warning`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Stale webhook timestamp`}),_jsx(_components.td,{children:`401, log warning`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Nomba/Duro API re-verify call fails`}),_jsx(_components.td,{children:`502, log error`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`API reports the payment not yet completed`}),_jsx(_components.td,{children:`200 unverified, order untouched`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Amount or currency mismatch (verified values)`}),_jsx(_components.td,{children:`Order on hold, log error`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Refund without transaction id (Nomba only)`}),_jsx(_components.td,{children:`Explanatory refund error in admin`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Refund rejected by Nomba`}),_jsx(_components.td,{children:`Refund error plus order note`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Refund attempted on a Duro order`}),_jsx(_components.td,{children:`Not offered; Duro has no refund UI`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`tests-and-demo`,children:`Tests and demo`}),`\n`,_jsxs(_components.p,{children:[`51 unit tests cover the gateway class (`,_jsx(_components.code,{children:`process_payment`}),`, return verify, refund) plus the protocol classes (client, signature, webhook), run from the repo root:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`docker`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --rm`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -v`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$PWD`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\":/repo`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -w`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` /repo/tools/tests`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` composer:2.7`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` composer`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`docker`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --rm`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -v`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$PWD`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\":/repo`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -w`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` /repo/tools/tests`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` php:8.3-cli`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` vendor/bin/phpunit`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A full local checkout, webhook, and refund walkthrough against the mock Nomba server (no credentials) lives in `,_jsx(_components.code,{children:`tools/demo/woocommerce/README.md`}),`: it stands up WordPress + WooCommerce 9.4.3 in Docker, points the gateway at the mock via `,_jsx(_components.code,{children:`NOMBA_WC_API_BASE`}),`, and walks six webhook exercises (valid completion, wrong secret, tampered payload, stale timestamp, amount mismatch, reversal) plus an admin refund. Switching to the real sandbox is a documented volume-reset step.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"WooCommerce","sidebarTitle":"WooCommerce","description":"The WordPress / WooCommerce payment gateway for Nomba hosted checkout, HPOS-compatible, with native admin refunds.","mode":"wide","href":"/integrations/woocommerce"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Structure","slug":"structure","depth":2,"children":[]},{"title":"Install","slug":"install","depth":2,"children":[]},{"title":"Nomba lifecycle","slug":"nomba-lifecycle","depth":2,"children":[]},{"title":"Environments","slug":"environments","depth":2,"children":[]},{"title":"The Duro gateway","slug":"the-duro-gateway","depth":2,"children":[]},{"title":"Error states","slug":"error-states","depth":2,"children":[]},{"title":"Tests and demo","slug":"tests-and-demo","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"latch-7241ffdc","siteName":"Duro","title":"WooCommerce - Duro","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-07T09:00:59.002Z","originalFileLocation":"integrations/woocommerce.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"The WordPress / WooCommerce payment gateway for Nomba hosted checkout, HPOS-compatible, with native admin refunds.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Duro\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/latch-7241ffdc/JFkjpfXrUd1xRXIF/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/latch-7241ffdc/JFkjpfXrUd1xRXIF/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/latch-7241ffdc/JFkjpfXrUd1xRXIF/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/latch-7241ffdc/JFkjpfXrUd1xRXIF/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/latch-7241ffdc/JFkjpfXrUd1xRXIF/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/latch-7241ffdc/JFkjpfXrUd1xRXIF/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/latch-7241ffdc/JFkjpfXrUd1xRXIF/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/latch-7241ffdc/JFkjpfXrUd1xRXIF/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/latch-7241ffdc/JFkjpfXrUd1xRXIF/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"WooCommerce - Duro\">\u003cmeta data-mint-head property=\"og:description\" content=\"The WordPress / WooCommerce payment gateway for Nomba hosted checkout, HPOS-compatible, with native admin refunds.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Duro\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.useduro.com/integrations/woocommerce\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://latch-7241ffdc.mintlify.site/_mintlify/api/og/v2?division=Platform+Plugins\u0026amp;title=WooCommerce\u0026amp;description=The+WordPress+%2F+WooCommerce+payment+gateway+for+Nomba+hosted+checkout%2C+HPOS-compatible%2C+with+native+admin+refunds.\u0026amp;theme=8c218a1ed29408e4ac965284\u0026amp;signature=3025a260344bf0e4ca9d22cfcd1da4cc30ae574c22c7f5187e55bea9c4c0d10f\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"WooCommerce - Duro\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The WordPress / WooCommerce payment gateway for Nomba hosted checkout, HPOS-compatible, with native admin refunds.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://latch-7241ffdc.mintlify.site/_mintlify/api/og/v2?division=Platform+Plugins\u0026amp;title=WooCommerce\u0026amp;description=The+WordPress+%2F+WooCommerce+payment+gateway+for+Nomba+hosted+checkout%2C+HPOS-compatible%2C+with+native+admin+refunds.\u0026amp;theme=8c218a1ed29408e4ac965284\u0026amp;signature=3025a260344bf0e4ca9d22cfcd1da4cc30ae574c22c7f5187e55bea9c4c0d10f\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/latch-7241ffdc/JFkjpfXrUd1xRXIF/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Duro\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3B82F6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.useduro.com/integrations/woocommerce\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/integrations/woocommerce.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.useduro.com/#organization\",\"name\":\"Duro\",\"url\":\"https://docs.useduro.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/latch-7241ffdc/z0mc5L14iWCUHezA/logo/light.svg?fit=max\u0026auto=format\u0026n=z0mc5L14iWCUHezA\u0026q=85\u0026s=0f4825b3c74998b48cd92889a917ae32\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.useduro.com#website\",\"name\":\"Duro\",\"url\":\"https://docs.useduro.com\",\"publisher\":{\"@id\":\"https://docs.useduro.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.useduro.com/integrations/woocommerce#webpage\",\"url\":\"https://docs.useduro.com/integrations/woocommerce\",\"name\":\"WooCommerce\",\"description\":\"The WordPress / WooCommerce payment gateway for Nomba hosted checkout, HPOS-compatible, with native admin refunds.\",\"dateModified\":\"2026-07-07T09:00:59.002Z\",\"isPartOf\":{\"@id\":\"https://docs.useduro.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.useduro.com/integrations/woocommerce#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.useduro.com/integrations/woocommerce#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Duro\",\"item\":\"https://docs.useduro.com\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WooCommerce\",\"item\":\"https://docs.useduro.com/integrations/woocommerce\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.useduro.com/integrations/woocommerce#article\",\"headline\":\"WooCommerce\",\"name\":\"WooCommerce\",\"description\":\"The WordPress / WooCommerce payment gateway for Nomba hosted checkout, HPOS-compatible, with native admin refunds.\",\"url\":\"https://docs.useduro.com/integrations/woocommerce\",\"mainEntityOfPage\":{\"@id\":\"https://docs.useduro.com/integrations/woocommerce#webpage\"},\"dateModified\":\"2026-07-07T09:00:59.002Z\",\"publisher\":{\"@id\":\"https://docs.useduro.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.useduro.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Duro\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Duro\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/integrations/woocommerce.md","siteName":"Duro","nav":{"global":null,"tabs":[{"tab":"Duro","pages":[{"title":"Duro","href":"/introduction"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"tab":"Webhooks","pages":[{"title":"Webhooks","href":"/webhooks/delivery"}]},{"tab":"Quill","pages":[{"title":"Quill","href":"/quill/introduction"}]},{"tab":"Integrations","groups":[{"group":"Overview","pages":[{"title":"E-commerce Integrations","sidebarTitle":"Introduction","mode":"wide","href":"/integrations/introduction"},{"title":"Shared Architecture","sidebarTitle":"Shared Architecture","description":"The verification-first lifecycle, the nine-field webhook signature, the Nomba API surface, and the local tooling every plugin shares.","mode":"wide","href":"/integrations/architecture"}]},{"group":"Platform Plugins","pages":[{"title":"WooCommerce","sidebarTitle":"WooCommerce","mode":"wide","href":"/integrations/woocommerce"},{"title":"PrestaShop","sidebarTitle":"PrestaShop","description":"The PrestaShop 1.7 / 8.x payment module for Nomba hosted checkout, with a custom held-payment order state and an admin refund panel.","mode":"wide","href":"/integrations/prestashop"},{"title":"Joomla / VirtueMart","sidebarTitle":"Joomla / VirtueMart","mode":"wide","href":"/integrations/joomla"}]}]},{"tab":"MCP","pages":[{"title":"MCP","href":"/platform/mcp"}]}]},"basePath":"","title":"WooCommerce - Duro","deploymentId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","buildId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","dynamics":[],"chunks":[]}