wc-payment-tokens

Create and validate WooCommerce saved payment tokens for credit cards and eCheck.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents payment security mistakes by guiding how to correctly create, validate, and use WooCommerce saved payment tokens without exposing or trusting raw card data.

Core Features & Use Cases

  • Secure token creation & validation: Create WC_Payment_Token records (including WC_Payment_Token_CC / WC_Payment_Token_ECheck) only after your provider returns a reusable provider token, and validate required token fields (gateway id, user ownership, last4/expiry/card type).
  • Correct token retrieval & default handling: Read customer tokens, fetch default tokens, and retrieve order-attached tokens via WooCommerce APIs (including HPOS-safe patterns).
  • Safe checkout & lifecycle operations: Validate posted saved-token selections at checkout (nonce + ownership + gateway id), then attach tokens to orders; support delete/default endpoints and map provider tokenization/gateway support requirements.

Quick Start

Ask the AI to help you implement an Add payment method and saved-card charge flow that validates token ownership and gateway id using the WooCommerce token APIs.

Frequently Asked Questions about wc-payment-tokens

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

FAQPage Schema
How do I safely charge saved WooCommerce payment tokens at checkout?

To charge saved WooCommerce payment tokens, validate the posted saved-token selection at checkout by verifying the nonce, user ownership, and gateway ID, then attach the validated token to the order using HPOS-safe order token access patterns.

What is the correct way to create WooCommerce payment tokens for saved credit cards?

Creating WooCommerce payment tokens requires instantiating subclasses like WC_Payment_Token_CC or WC_Payment_Token_ECheck only after your provider returns a reusable provider token, ensuring you store provider tokens only and validate required fields like last4, expiry, and card type.

How does My Account saved payment method management work in WooCommerce?

WooCommerce My Account saved payment method management involves securely adding, deleting, and setting default tokens, requiring strict user ownership and nonce checks to prevent unauthorized modification of saved payment tokens.

Can I retrieve order-attached WooCommerce payment tokens with HPOS enabled?

Yes, retrieve order-attached WooCommerce payment tokens with HPOS enabled by using HPOS-safe order token access APIs to fetch default tokens and read customer tokens without relying on deprecated post meta functions.

Why does checkout validation fail when using saved WooCommerce payment tokens?

Checkout validation fails for saved WooCommerce payment tokens when gateway ID filtering is incorrect, the nonce check fails, or user ownership validation does not match the customer attached to the token.

Do I need a provider token to store WooCommerce saved card data?

Yes, you need a provider token to store WooCommerce saved card data because the system enforces provider-token-only storage, meaning raw card data is never exposed or trusted directly within the WC_Payment_Tokens implementation.