Skip to content

Commit

Permalink
fix: fixe merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcossIC committed Dec 19, 2024
2 parents 515c400 + 8141c2c commit 7a0c97a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
width: 100%;
max-width: 550px;
height: 100%;
min-height: 535px;
max-height: 535px;
min-height: 550px;
max-height: 550px;
border-radius: 8px;
display: flex;
flex-direction: column;
Expand Down
8 changes: 4 additions & 4 deletions client/src/features/courses/components/CourseCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const CourseCard = ({
{categoria}
</span>

<div className="grow p-4">
<div className="grow px-4 pt-4">
<div className="flex items-center justify-between">
<h3 className="line-clamp-2 max-h-14 min-h-14 text-ellipsis text-lg font-bold text-slate-200">
{title}
Expand Down Expand Up @@ -153,15 +153,15 @@ const CourseCard = ({
) : null}
</div>
{price ? (
<div className="mt-4 flex items-center gap-2">
<div className="mt-4 flex items-center">
<strong className="text-lg font-bold text-slate-200">${price}</strong>
</div>
) : null}
</div>

<div className="mt-auto flex items-center p-4">
<div className="mt-2 flex items-center p-3">
<Button
className="relative z-10 rounded-lg px-4 py-2 text-sm text-white"
className="relative z-10 rounded-lg px-4 text-sm text-white"
onClick={() => {
saveToCart({
courseId,
Expand Down

0 comments on commit 7a0c97a

Please sign in to comment.