From d9b93a34704ff3044806d42471b7af1ab8d79560 Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Mon, 11 Mar 2024 17:13:48 +0000 Subject: [PATCH] Added default value for postal_code --- src/pages/api/paypal/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/api/paypal/index.ts b/src/pages/api/paypal/index.ts index 0f57adef..2875de4f 100644 --- a/src/pages/api/paypal/index.ts +++ b/src/pages/api/paypal/index.ts @@ -61,7 +61,15 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { paypal: { email_address: req.session.user.email || "", address: { - postal_code: "1234", + address_line_1: "", + address_line_2: "", + admin_area_1: "", + admin_area_2: "", + // added default values as requsted by the client, using the default values recommended + // the paypal engineer, otherwise we would have to create something that would detect the location + // of the user and generate a valid postal code for that location... + country_code: "US", + postal_code: "94107", }, experience_context: { payment_method_preference: "IMMEDIATE_PAYMENT_REQUIRED",