Wc Payment Gateway

Register a custom WooCommerce payment gateway — extend WC_Payment_Gateway, declare $id / $title / $supports, implement process_payment returning array(result, redirect), optionally process_refund when refunds is in supports, register via the woocommerce_payment_gateways filter. Canonical gotcha: payment_complete vs update_status — payment_complete runs the paid-order state machine (status, transaction id, session flag, payment-complete action), update_status only changes status. Includes the forgotten WC()->cart->empty_cart() call and Store API payment requirements for Checkout Blocks. Use when integrating/reviewing gateways or debugging "payment succeeded but cart didn't clear" / "order stuck in pending". Triggers on WC_Payment_Gateway, woocommerce_payment_gateways, process_payment, process_refund, payment_complete, get_return_url, woocommerce_payment_complete_order_status, woocommerce_store_api_register_payment_requirements.

vikingokft 0e504e9 25.7 KB Updated 0 repo stars

File contents

vikingokft/vikingo-studio-skills/tree/main/woocommerce/wc-payment-gateway commit 0e504e95cd

Frequently asked questions

npx skillmds add vikingokft/wc-payment-gateway