diff --git a/src/components/PayPalPayment.tsx b/src/components/PayPalPayment.tsx index 6324e9d3..f009298b 100644 --- a/src/components/PayPalPayment.tsx +++ b/src/components/PayPalPayment.tsx @@ -55,7 +55,14 @@ export default function PayPalPayment({ trackingId, }) .then((response) => response.data) - .then((data) => data.id); + .then((data) => { + setIsLoading(false); + return data.id; + }) + .catch((err) => { + setIsLoading(false); + return err; + }); }; const onApprove = async (data: OnApproveData, actions: OnApproveActions) => {