Added default value for postal_code

This commit is contained in:
Joao Ramos
2024-03-11 17:13:48 +00:00
parent 83e4173750
commit d9b93a3470

View File

@@ -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",