paygent-core

Centralize Paygent payment gateway shared logic for WooCommerce API requests.

Updated Sep 22, 2024
One-click install
npx skills add https://github.com/WordPressBugBounty/plugins-woocommerce-for-japan --skill paygent-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: paygent-core
Source: https://github.com/WordPressBugBounty/plugins-woocommerce-for-japan/tree/main/woocommerce-for-japan/.claude/skills/paygent-core
Command: npx skills add https://github.com/WordPressBugBounty/plugins-woocommerce-for-japan --skill paygent-core

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Paygent決済の各ゲートウェイ実装で毎回発生する共通処理(認証情報管理、送受信パラメータ組み立て、SJIS変換、ハッシュチェック、エラー処理、注文IDマッピング、Webhook受信、テスト/本番切替)を標準化して、実装の重複と事故を減らします。

Core Features & Use Cases

  • API共通コア: PaygentB2BModuleを用いた電文送受信、結果判定、共通レスポンス処理を一元化します(例: send_paygent_request 呼び出しに集約)。
  • 認証・ハッシュチェック: WordPress optionsから merchant_id/connect_id/connect_password を切替し、必要に応じて hc(SHA-256)を生成・付与します。
  • 注文IDマッピング & Webhook: trading_id の決定ロジックや _paygent_order_id 参照、Webhook受信エンドポイント(/wp-json/paygent/v1/check)向けの共通処理を提供します。
  • 技術要件の統制: Paygent通信の文字コード(Shift_JIS)変換方針とデバッグログ方針を前提化します。
  • 返金/取消の共通化: 全決済手段で共通となる返金・取消の2ステップ構成(情報照会→ステータス確認→取消/返金)に沿った処理枠組みを整理します。

Quick Start

Use the paygent-core skill to design and implement the shared Paygent request workflow (authentication, SJIS conversion, hash check, telegram_kind handling, trading_id mapping, and webhook authorization) for WooCommerce gateways like WC_Gateway_Paygent_Request.

Frequently Asked Questions about paygent-core

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

FAQPage Schema
How do I handle SJIS encoding conversion for Paygent API requests in WooCommerce?

Paygent API requests require SJIS-win/Windows-31J encoding conversion to handle Shift_JIS character codes. This core standardizes parameter construction and encoding transformations to prevent data corruption during WooCommerce gateway transmission.

What is the best way to centralize Paygent payment gateway authentication and hash checking?

Centralizing Paygent authentication involves managing merchant_id, connect_id, and connect_password from WordPress options, then generating and appending an SHA-256 hash (hc) for request verification. This approach eliminates duplicate credential management across multiple gateways.

How does webhook reception work for Paygent payment notifications in WooCommerce?

Paygent webhook reception processes incoming notifications at the /wp-json/paygent/v1/check endpoint, handling trading_id mapping and _paygent_order_id references. The system applies common authorization and hash verification logic to validate incoming payment status updates across telegram_kind payment methods.

Does this Paygent integration support refund and cancel flows across different payment methods?

Yes, Paygent refund and cancel flows use a standardized two-step structure across all payment methods: information inquiry followed by status confirmation, then executing the cancel or refund action. This shared processing framework works across various telegram_kind payment types in WooCommerce.

Can I use PaygentB2BModule with WooCommerce 9.0 and WordPress 6.7?

Yes, PaygentB2BModule integration is fully compatible with WooCommerce 9.0+ and WordPress 6.7+ environments. The core logic enforces these version constraints while managing Paygent request and response parameter construction, encoding conversions, and debug handling.

Why do my Paygent API requests fail hash verification across multiple gateways?

Paygent hash verification failures often stem from inconsistent SHA-256 hash generation or incorrect parameter ordering during request construction. Centralizing the hc hash attachment and standardizing authentication setup prevents these mismatches across different gateway implementations.