The "fees" or "extra fees" or "customer fees" feature was meant to make customers pay for the processing fee charged by the payment provider they choose to make their payment. The fee was also displayed on the payment form to deter customers and encourage them to choose another, cheaper, payment provider. In practice, it didn't hold up because: 1. the provider's API must allow sending the fee as a separate amount, and PayPal was the only supported provider to do it; 2. charging extra fees is highly discouraged by providers, and forbidden in Europe; 3. the final fee amount depends on the customer, country, payment method, risk profile... rendering charging the actual fees amount infeasible; 4. most of the time, only one payment provider is enabled at a time, thus alienating customers who would have no other choice than paying the fee; task-3358581 closes odoo/odoo#132104 Related: odoo/documentation#5517 Related: odoo/upgrade#5053 Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
54 lines
1.8 KiB
Python
54 lines
1.8 KiB
Python
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo.addons.payment.tests.common import PaymentCommon
|
|
|
|
|
|
class PaypalCommon(PaymentCommon):
|
|
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
super().setUpClass()
|
|
|
|
cls.paypal = cls._prepare_provider('paypal', update_values={
|
|
'paypal_email_account': 'dummy@test.mail.com',
|
|
})
|
|
|
|
# Override default values
|
|
cls.provider = cls.paypal
|
|
cls.currency = cls.currency_euro
|
|
|
|
cls.notification_data = {
|
|
'PayerID': '59XDVNACRAZZK',
|
|
'address_city': 'Scranton',
|
|
'address_country_code': 'US',
|
|
'address_name': 'Mitchell Admin',
|
|
'address_state': 'Pennsylvania',
|
|
'address_street': '215 Vine St',
|
|
'address_zip': '18503',
|
|
'first_name': 'Norbert',
|
|
'handling_amount': '0.00',
|
|
'item_name': 'YourCompany: Test Transaction',
|
|
'item_number': cls.reference,
|
|
'last_name': 'Buyer',
|
|
'mc_currency': 'USD',
|
|
'mc_fee': '2.00',
|
|
'mc_gross': '50.00',
|
|
'notify_version': 'UNVERSIONED',
|
|
'payer_email': 'test-buyer@mail.odoo.com',
|
|
'payer_id': '59XDVNACRAZZK',
|
|
'payer_status': 'VERIFIED',
|
|
'payment_date': '2022-01-19T08:38:06Z',
|
|
'payment_fee': '2.00',
|
|
'payment_gross': '50.00',
|
|
'payment_status': 'Completed',
|
|
'payment_type': 'instant',
|
|
'protection_eligibility': 'ELIGIBLE',
|
|
'quantity': '1',
|
|
'receiver_id': 'BEQE89VH6257B',
|
|
'residence_country': 'US',
|
|
'shipping': '0.00',
|
|
'txn_id': '1H89255869624041K',
|
|
'txn_type': 'web_accept',
|
|
'verify_sign': 'dummy',
|
|
}
|