Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function sendPaypalPayouts({
const data = await response.json();

if (!response.ok) {
console.error("Error creating PayPal batch payout", data);
console.error("[PayPal] Error creating PayPal batch payout", data);

await log({
message: `Error creating PayPal batch payout. Invoice ID: ${invoiceId}. Error: ${JSON.stringify(
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/(ee)/api/paypal/webhook/payout-status-changed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export async function payoutStatusChanged(event: any) {

if (!payout) {
console.log(
`Payout not found for invoice ${invoiceId} and partner ${paypalEmail}`,
`[PayPal] Payout not found for invoice ${invoiceId} and partner ${paypalEmail}`,
);
return;
}

if (body.event_type === "PAYMENT.PAYOUTS-ITEM.SUCCEEDED") {
if (payout.status === "completed") {
console.log(
`Payout already completed for invoice ${invoiceId} and partner ${paypalEmail}`,
`[PayPal] Payout already completed for invoice ${invoiceId} and partner ${paypalEmail}`,
);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/(ee)/api/paypal/webhook/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const POST = async (req: Request) => {
return new Response("Unsupported event, skipping...");
}

console.info(`Paypal webhook received: ${body.event_type}`, body);
console.info(`[Paypal] Webhook received: ${body.event_type}`, body);

try {
switch (body.event_type) {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/(ee)/api/paypal/webhook/verify-signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export async function verifySignature({
const certUrl = headers.get("paypal-cert-url");

if (!transmissionId || !transmissionSig || !timeStamp || !certUrl) {
console.error("Missing required headers for signature verification");
console.error("[PayPal] Missing required headers for signature verification");
return false;
}

const certPem = await downloadAndCache(certUrl);

if (!certPem) {
console.error("Failed to download or cache PayPal certificate");
console.error("[PayPal] Failed to download or cache PayPal certificate");
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/paypal/create-paypal-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function createPaypalToken() {
const data = await response.json();

if (!response.ok) {
console.error("Failed to create PayPal token.", data);
console.error("[PayPal] Failed to create PayPal token.", data);
throw new Error("Failed to create PayPal token.");
}

Expand Down