wc-payment-gateway

Register and integrate custom WooCommerce payment gateways via WC_Payment_Gateway.

21|1|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/Lonsdale201/wp-agent-skills --skill wc-payment-gateway
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wc-payment-gateway
Source: https://github.com/Lonsdale201/wp-agent-skills/tree/main/woocommerce/wc-payment-gateway
Command: npx skills add https://github.com/Lonsdale201/wp-agent-skills --skill wc-payment-gateway

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Registers a WooCommerce payment gateway integration, clarifying the differences between payment_complete and update_status, ensuring correct order lifecycle, and handling cart clearing after payment.

Core Features & Use Cases

  • Register gateways via woocommerce_payment_gateways and hook into the WC_Payment_Gateway lifecycle.
  • Implement process_payment and process_refund, including proper status handling and transaction recording.
  • Debug and audit gateway integrations to ensure payment completion triggers the correct order flow.

Quick Start

Create a gateway class MyGateway extending WC_Payment_Gateway, configure its id, title, and supports, implement process_payment and optional refunds, and register it via the woocommerce_payment_gateways filter.

Frequently Asked Questions about wc-payment-gateway

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

FAQPage Schema
How do I create a custom WooCommerce payment gateway in PHP?

To create a custom WooCommerce payment gateway, you build a class extending WC_Payment_Gateway, declare its id and title, implement process_payment, and register it via the woocommerce_payment_gateways filter.

What is the difference between payment_complete and update_status in WooCommerce gateways?

The payment_complete method specifically triggers the correct order lifecycle and cart clearing after payment, whereas update_status only changes the order state without ensuring these downstream checkout completion actions execute properly.

How do I handle refunds in a WooCommerce payment gateway extension?

You handle refunds in a WooCommerce payment gateway by implementing the process_refund method within your WC_Payment_Gateway extension, ensuring proper transaction recording and status handling for the returned payment funds.

Does a WooCommerce custom gateway support webhook integration for payment processing?

Yes, a custom WooCommerce gateway supports webhook integration to handle asynchronous payment notifications, linking webhook payloads to process_payment and payment_complete flows for accurate order lifecycle management.

What's the best way to audit a WooCommerce payment gateway integration?

Auditing a WooCommerce payment gateway involves verifying the correct registration via woocommerce_payment_gateways, checking process_payment and process_refund logic, and ensuring payment completion triggers the proper order flow and cart clearing.