mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 08:12:09 +02:00
Add 19 payment provider modules needed by the sale module:
payment_adyen, payment_aps, payment_asiapay, payment_authorize,
payment_buckaroo, payment_demo, payment_dpo, payment_flutterwave,
payment_iyzico, payment_mercado_pago, payment_mollie, payment_nuvei,
payment_paymob, payment_paypal, payment_razorpay, payment_redsys,
payment_stripe, payment_worldline, payment_xendit
Add 3 IoT modules needed for point_of_sale:
iot_base, iot_box_image, iot_drivers
Note: Stripe test API keys replaced with placeholders.
🤖 assisted by claude
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
import base64
|
|
import json
|
|
|
|
from odoo.addons.payment.tests.common import PaymentCommon
|
|
|
|
|
|
class RedsysCommon(PaymentCommon):
|
|
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
super().setUpClass()
|
|
cls.redsys = cls._prepare_provider('redsys', update_values={
|
|
'redsys_merchant_code': '99999999',
|
|
'redsys_merchant_terminal': '777',
|
|
'redsys_secret_key': 'a1b2c3d4e5f6g7h8a1b2c3d4e5f6g7h8',
|
|
})
|
|
cls.provider = cls.redsys
|
|
cls.merchant_parameters = {
|
|
'Ds_Order': 'Test Transaction',
|
|
'Ds_Amount': cls.amount * 100, # In minor units
|
|
'Ds_Currency': 978, # EUR
|
|
'Ds_Card_Brand': '1', # VISA
|
|
'Ds_Response': '0000', # Payment accepted
|
|
}
|
|
cls.encoded_merchant_parameter = base64.b64encode(
|
|
json.dumps(cls.merchant_parameters).encode()
|
|
).decode()
|
|
cls.payment_data = {
|
|
'Ds_MerchantParameters': cls.encoded_merchant_parameter,
|
|
'Ds_Signature': 'upzUj96lLgOEUP5lvaj7lz0Se4MXmc5_GoJ32ACqZ3A=',
|
|
}
|