router.post("/createTrans", (req, res, next) => {
const paypal = require('@paypal/checkout-server-sdk');
const payPalClient = require("../config/paypalServer");
module.exports = async function handleRequest(req, res) {
const request = new paypal.orders.OrdersCreateRequest();
request.prefer("return=representation");
request.requestBody({
intent: 'CAPTURE',
purchase_units: [{
amount: {
currency_code: 'USD',
value: "100.00"
}
}]
});
let order;
try {