wc-payment-gateway

Implement WooCommerce payment gateways with correct payment lifecycle handling.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/vikingokft/wp-agent-skills --skill wc-payment-gateway-vikingokft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: wc-payment-gateway
Source: https://github.com/vikingokft/wp-agent-skills/tree/main/woocommerce/wc-payment-gateway
Command: npx skills add https://github.com/vikingokft/wp-agent-skills --skill wc-payment-gateway-vikingokft

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It fixes WooCommerce payment gateway implementations that mark payments incorrectly, leading to orders stuck in pending/on-hold, missing transaction IDs, broken cart clearing, or missing “order is paid” lifecycle events.

Core Features & Use Cases

  • Correct gateway registration: Add a custom gateway class via the woocommerce_payment_gateways filter.
  • Reliable payment handling flow: Use process_payment to return the proper {result, redirect} shape and call payment_complete with a transaction ID for successful synchronous captures.
  • Refund + status state machine guidance: Implement process_refund when refunds are supported and avoid mixing payment_complete with update_status.
  • Checkout Blocks readiness notes: Handle Store API payment requirements appropriately when capability support (via $supports) affects gateway availability.

Quick Start

Instruct the AI: “Review my WooCommerce gateway code and tell me exactly where to use payment_complete vs update_status, whether I’m returning the correct process_payment array shape, and why my cart isn’t empty after a successful charge.”

Frequently Asked Questions about wc-payment-gateway

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why is my WooCommerce order stuck in pending after a successful payment?▼

WooCommerce orders get stuck in pending when gateway code uses update_status instead of payment_complete. Calling payment_complete with the transaction ID ensures the order transitions correctly and triggers the proper lifecycle events to clear the cart.

How do I register a custom WooCommerce payment gateway correctly?▼

Register a custom WooCommerce payment gateway by extending the WC_Payment_Gateway class and adding it via the woocommerce_payment_gateways filter. This ensures proper integration into the checkout flow and order processing lifecycle.

What array shape should process_payment return in WooCommerce?▼

The process_payment method in WooCommerce must return an array containing 'result' and 'redirect' keys. Returning the correct array shape ensures the checkout flow completes properly and redirects the customer after a successful charge.

How do I handle asynchronous payment confirmation via webhooks in WooCommerce?▼

Handle asynchronous WooCommerce payment confirmations by implementing signature-verifying webhook endpoints that call payment_complete with the transaction ID. This ensures paid orders transition correctly even when the initial checkout response is synchronous.

How do I implement refunds in a WooCommerce payment gateway?▼

Implement the process_refund method in your WooCommerce gateway only when 'refunds' is declared in the supports array. This properly integrates the refund state machine without conflicting with payment_complete status transitions.

Does my custom WooCommerce payment gateway work with Checkout Blocks?▼

Custom WooCommerce payment gateways work with Checkout Blocks by handling Store API payment requirements appropriately. The gateway's availability depends on capability support declared in the $supports array for filtering.