checkout-payments

Checkout and Payments

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "checkout-payments" with this command: npx skills add santiagoxor/pintureria-digital/santiagoxor-pintureria-digital-checkout-payments

Checkout and Payments

Quick Start

When working with checkout:

  • Validate cart data before creating order

  • Validate shipping address

  • Create order in database

  • Integrate with MercadoPago

  • Handle payment webhooks

  • Update order status

Key Files

  • src/app/checkout/

  • Checkout pages

  • src/components/Checkout/

  • Checkout components

  • src/lib/integrations/mercadopago/

  • MercadoPago integration

  • src/lib/business/orders/

  • Order logic

  • src/hooks/useCheckout.ts

  • Checkout hook

Common Patterns

Create Order

import { createOrder } from '@/lib/business/orders/order-service'; import { createPayment } from '@/lib/integrations/mercadopago';

export async function POST(request: NextRequest) { const { items, shippingAddress, paymentMethod } = await request.json();

const order = await createOrder({ items, shippingAddress, status: 'pending_payment', });

const payment = await createPayment({ transaction_amount: order.total, description: Orden #${order.id}, payer: { email: order.customer_email, }, });

await updateOrder(order.id, { payment_id: payment.id, payment_status: 'pending', });

return NextResponse.json({ order, payment }); }

Validate Address

import { validateAddress } from '@/lib/business/logistics/address-validation';

const validation = await validateAddress({ street: 'Av. Corrientes 1234', city: 'Buenos Aires', postalCode: 'C1043AAX', country: 'AR', });

if (!validation.isValid) { return { errors: validation.errors }; }

MercadoPago Wallet

import { initMercadoPago, Wallet } from '@mercadopago/sdk-react';

function CheckoutPayment() { const [paymentData, setPaymentData] = useState(null);

useEffect(() => { initMercadoPago('YOUR_PUBLIC_KEY'); }, []);

return ( <Wallet initialization={{ preferenceId: paymentData?.preference_id }} onSubmit={onSubmit} /> ); }

Order States

  • pending_payment

  • Waiting for payment

  • paid

  • Paid

  • processing

  • Processing

  • shipped

  • Shipped

  • delivered

  • Delivered

  • cancelled

  • Cancelled

  • refunded

  • Refunded

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

authentication

No summary provided by upstream source.

Repository SourceNeeds Review
General

postgres-best-practices

No summary provided by upstream source.

Repository SourceNeeds Review
General

error-handling

No summary provided by upstream source.

Repository SourceNeeds Review
General

git-commit-push

No summary provided by upstream source.

Repository SourceNeeds Review