Skip to content

Commit

Permalink
Merge pull request #90 from No-Country-simulation/feat/SectionCartShop
Browse files Browse the repository at this point in the history
fix: agregando detalles
  • Loading branch information
Moya30 authored Dec 19, 2024
2 parents 0fb0f7a + 4061ffa commit 9a522b4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions client/src/features/cart/components/Paypal/Paid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="flex items-center justify-center">
<PayPalScriptProvider
Expand All @@ -14,6 +16,19 @@ export const Paid = () => {
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
},
},
],
});
}}
/>
</PayPalScriptProvider>
</div>
Expand Down

0 comments on commit 9a522b4

Please sign in to comment.