PIX Validation Expert

Enforce email identity alignment between login email and PIX key email.

Updated Oct 18, 2025
One-click install
npx skills add https://github.com/Lucasdoreac/mutuapix-workspace --skill pix-validation-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: PIX Validation Expert
Source: https://github.com/Lucasdoreac/mutuapix-workspace/tree/main/.claude/skills/pix-validation
Command: npx skills add https://github.com/Lucasdoreac/mutuapix-workspace --skill pix-validation-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill prevents payment failures and user confusion by enforcing a critical business rule: the user's login email must match their PIX key email for payment processing. It identifies missing backend validation and provides solutions.

Core Features & Use Cases

  • Email Matching Enforcement: Ensures the PIX key email is identical to the user's login email for email type PIX keys.
  • Missing Validation Detection: Highlights where current backend middleware (CheckPixKey.php) lacks this crucial email matching logic.
  • Use Case: When a user attempts to redeem points or make a donation, this skill ensures their PIX email is correctly configured, preventing "Payment failed - email mismatch" errors and reducing support tickets.

Quick Start

Example: Proposed backend validation logic (PHP)

if ($user->pix_key_type === 'email' && $user->pix_key !== $user->email) { return response()->json([ 'success' => false, 'message' => 'A chave PIX email deve ser igual ao email de login da conta.', ], 422); }

Frequently Asked Questions about PIX Validation Expert

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

FAQPage Schema
How do I prevent PIX payment failures due to email mismatches?

PIX payment failures occur when a user's login email doesn't match their PIX key email. Enforce email matching validation in your backend middleware to ensure the PIX key email equals the user's login email before processing redemptions, donations, or PIX operations, eliminating email mismatch errors.

What validation should I add to my PIX backend middleware?

Add checks to verify the PIX key exists, has a valid type, and when type is 'email', matches the user's login email exactly. Return a consistent error message if validation fails, preventing invalid transactions from reaching payment processing.

Can I auto-populate the PIX key during user registration?

Yes. Auto-set the PIX key to the user's login email during registration and provide frontend guidance through warnings when users attempt to change it to a different email, ensuring alignment from account creation.

Where should email validation happen in my payment flow?

Implement validation at route protection and backend middleware layers before payment processing begins. This catches misaligned emails early in redemptions, donations, and MutuaPIX transactions, reducing support tickets and payment failures.

What happens if a PIX key type is something other than email?

Only email-type PIX keys require matching the user's login email. Other PIX key types bypass this validation, allowing flexibility for alternative key formats while maintaining security for email-based transactions.

Why do I need to validate PIX keys on both frontend and backend?

Backend validation enforces the business rule server-side and prevents invalid transactions. Frontend guidance through auto-population and warnings improves user experience by preventing email mismatches before submission, reducing errors and confusion.