fix paypal minor issues (#11069)
parent
a130804f18
commit
34c2565c70
|
@ -4,7 +4,6 @@ import z from "zod";
|
|||
import Paypal from "@calcom/app-store/paypal/lib/Paypal";
|
||||
import { findPaymentCredentials } from "@calcom/features/ee/payments/api/paypal-webhook";
|
||||
import { IS_PRODUCTION } from "@calcom/lib/constants";
|
||||
import { getErrorFromUnknown } from "@calcom/lib/errors";
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
@ -78,12 +77,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
}
|
||||
return;
|
||||
} catch (_err) {
|
||||
const err = getErrorFromUnknown(_err);
|
||||
|
||||
res.status(200).send({
|
||||
message: err.message,
|
||||
stack: IS_PRODUCTION ? undefined : err.stack,
|
||||
});
|
||||
res.redirect(`/booking/${req.query.bookingUid}?paypalPaymentStatus=failed`);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ class Paypal {
|
|||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return false;
|
||||
throw error;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -260,6 +260,9 @@ export const updateHandler = async ({ ctx, input }: UpdateOptions) => {
|
|||
const { default_currency } = stripeDataSchema.parse(paymentCredential.key);
|
||||
data.currency = default_currency;
|
||||
}
|
||||
if (paymentCredential?.type === "paypal_payment" && input.metadata?.apps?.paypal?.currency) {
|
||||
data.currency = input.metadata?.apps?.paypal?.currency.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
const connectedLink = await ctx.prisma.hashedLink.findFirst({
|
||||
|
|
Loading…
Reference in New Issue