Files
odoo_source/addons/payment_demo/controllers/main.py
T
Victor Feyens e648489401 [MOV] payment_test: rename to payment_demo
The name "Payment Acquirer Test" of the acquirer bundled with the module
`payment_test` is confusing. It is actually the only acquirer that
doesn't connect to a test API, and its purpose is not to make test
transactions but to showcase the integration of other apps (Accounting,
Sales, eCommerce, Subscriptions) with demo payments.

Hence, the module is renamed to `payment_demo` along with its data and
technical keys to better make the distinction between acquirers' test
environment and demo payments.

task-2853481

closes odoo/odoo#99397

Related: odoo/upgrade#3846
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-09-05 20:13:02 +02:00

18 lines
578 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http
from odoo.http import request
class PaymentDemoController(http.Controller):
_simulation_url = '/payment/demo/simulate_payment'
@http.route(_simulation_url, type='json', auth='public')
def demo_simulate_payment(self, **data):
""" Simulate the response of a payment request.
:param dict data: The simulated notification data.
:return: None
"""
request.env['payment.transaction'].sudo()._handle_notification_data('demo', data)