From 4061ffa495308df8e30e7973c7ae1b1abe347063 Mon Sep 17 00:00:00 2001 From: Moya30 Date: Thu, 19 Dec 2024 08:09:20 -0500 Subject: [PATCH] fix: agregando detalles --- .../src/features/cart/components/Paypal/Paid.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/src/features/cart/components/Paypal/Paid.tsx b/client/src/features/cart/components/Paypal/Paid.tsx index 4a04fb5..d67153d 100644 --- a/client/src/features/cart/components/Paypal/Paid.tsx +++ b/client/src/features/cart/components/Paypal/Paid.tsx @@ -2,6 +2,8 @@ import { PayPalButtons, PayPalScriptProvider } from '@paypal/react-paypal-js'; export const Paid = () => { const clientId: string = process.env.NEXT_PUBLIC_CLIENT_ID!; + const price = '19.99'; // En formato string con dos decimales + const currency = 'USD'; // Código de moneda, e.g., USD, EUR, etc. return (
{ color: 'blue', label: 'paypal', }} + createOrder={(data, actions) => { + return actions.order.create({ + intent: 'CAPTURE', // Captura inmediata del pago + purchase_units: [ + { + amount: { + currency_code: currency, // Código de moneda requerido + value: price, // Precio estático + }, + }, + ], + }); + }} />