odoo/odoo#199131

Created by fw-bot
Merged at 68af97d9a7cc5e6d179bd80ea87fbd912959be96

Statuses:

label
odoo-dev:master-18.0-opw-4446219-paypal_pos-roen-418414-fw
head
5186d45604a6dcc56b060b6fbe6aefb21cc61a07
merged
7 months ago by Bugfix, Robin Engels (roen)
odoo/odoo
18.0 #198407
saas-18.1 #199103
saas-18.2 #199121
saas-18.3
saas-18.4
19.0
master #199131

[FW][FIX] payment_paypal: fix payment from PoS

When making a payment from the PoS, the user would always be the Public
User. This would cause the payload sent to paypal to be incorrect and
the payment to fail.
This happens because we are trying to make a payment without any user,
so this can be reproduced in other workflows. Like making a donation

Steps to reproduce:

  • Setup paypal payment provider
  • Create a PoS payment method with the paypal provider
  • Create a PoS order and pay with the paypal payment method
    > Observation: You get an error saying that something is malformed

Alternative steps to reproduce:

  • Make sure you are not connected on Odoo
  • Go to the donation/pay url
  • Fill out the form and make the payment via paypal
    > Observation: You get an error saying that something is malformed

Why the fix:

When using the public user, we cannot provide an email address or a
country code. To fix this we make sure to not send the email address at
all when there is none available. And we send the country code of the
company instead of none.

opw-4446219

Forward-Port-Of: #198407