Added RAAS api and tracking

Improvements on paypal UI
This commit is contained in:
Joao Ramos
2024-03-05 14:37:02 +00:00
parent 4114971244
commit a86ed9f76c
6 changed files with 301 additions and 130 deletions

View File

@@ -0,0 +1,20 @@
import { useEffect, useState } from "react";
import axios from "axios";
export const usePaypalTracking = () => {
const [trackingId, setTrackingId] = useState<string>();
useEffect(() => {
axios
.put<{ ok: boolean; trackingId: string }>("/api/paypal/raas")
.then((response) => {
if (response.data.ok) {
setTrackingId(response.data.trackingId);
}
})
.catch((error) => {
console.error(error);
});
}, []);
return trackingId;
};