[REF] payment_payumoney: migrate PayU money to the new payment API
See the merge commit for more details. task-2333039
This commit is contained in:
committed by
Antoine Vandevenne (anv)
parent
ffee5a914b
commit
b14ce986ce
@@ -1,10 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import models
|
||||
from . import controllers
|
||||
from odoo.addons.payment.models.payment_acquirer import create_missing_journal_for_acquirers
|
||||
from odoo.addons.payment import reset_payment_provider
|
||||
from . import models
|
||||
|
||||
from odoo.addons.payment import reset_payment_acquirer
|
||||
from odoo.addons.payment.models.payment_acquirer import create_missing_journals # post-init hook
|
||||
|
||||
|
||||
def uninstall_hook(cr, registry):
|
||||
reset_payment_provider(cr, registry, 'payumoney')
|
||||
reset_payment_acquirer(cr, registry, 'payumoney')
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
{
|
||||
'name': 'PayuMoney Payment Acquirer',
|
||||
'version': '2.0',
|
||||
'category': 'Accounting/Payment Acquirers',
|
||||
'sequence': 375,
|
||||
'summary': 'Payment Acquirer: PayuMoney Implementation',
|
||||
'description': """
|
||||
PayuMoney Payment Acquirer for India.
|
||||
PayuMoney Payment Acquirer for India.
|
||||
|
||||
PayUmoney payment gateway supports only INR currency.
|
||||
""",
|
||||
PayUmoney payment gateway supports only INR currency.
|
||||
""",
|
||||
'depends': ['payment'],
|
||||
'data': [
|
||||
'views/payment_views.xml',
|
||||
@@ -18,6 +18,6 @@
|
||||
'data/payment_acquirer_data.xml',
|
||||
],
|
||||
'application': True,
|
||||
'post_init_hook': 'create_missing_journal_for_acquirers',
|
||||
'post_init_hook': 'create_missing_journals',
|
||||
'uninstall_hook': 'uninstall_hook',
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import main
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import logging
|
||||
import pprint
|
||||
|
||||
import werkzeug
|
||||
|
||||
from odoo import http
|
||||
@@ -11,12 +11,11 @@ from odoo.http import request
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PayuMoneyController(http.Controller):
|
||||
@http.route(['/payment/payumoney/return', '/payment/payumoney/cancel', '/payment/payumoney/error'], type='http', auth='public', csrf=False)
|
||||
def payu_return(self, **post):
|
||||
""" PayUmoney."""
|
||||
_logger.info(
|
||||
'PayUmoney: entering form_feedback with post data %s', pprint.pformat(post))
|
||||
if post:
|
||||
request.env['payment.transaction'].sudo().form_feedback(post, 'payumoney')
|
||||
return werkzeug.utils.redirect('/payment/process')
|
||||
class PayUMoneyController(http.Controller):
|
||||
_return_url = '/payment/payumoney/return'
|
||||
|
||||
@http.route(_return_url, type='http', auth='public', methods=['GET', 'POST'], csrf=False)
|
||||
def payumoney_return(self, **data):
|
||||
_logger.info("entering handle_feedback_data with data:\n%s", pprint.pformat(data))
|
||||
request.env['payment.transaction'].sudo()._handle_feedback_data('payumoney', data)
|
||||
return werkzeug.utils.redirect('/payment/status')
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record id="payment.payment_acquirer_payu" model="payment.acquirer">
|
||||
<field name="name">PayUmoney</field>
|
||||
<field name="image_128" type="base64" file="payment_payumoney/static/src/img/payumoney_icon.png"/>
|
||||
<field name="provider">payumoney</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="view_template_id" ref="payumoney_form"/>
|
||||
</record>
|
||||
</data>
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="payment.payment_acquirer_payumoney" model="payment.acquirer">
|
||||
<field name="provider">payumoney</field>
|
||||
<field name="redirect_form_view_id" ref="redirect_form"/>
|
||||
<field name="support_authorization">False</field>
|
||||
<field name="support_fees_computation">False</field>
|
||||
<field name="support_tokenization">False</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import payment
|
||||
from . import payment_acquirer
|
||||
from . import payment_transaction
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import hashlib
|
||||
|
||||
from werkzeug import urls
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.addons.payment.models.payment_acquirer import ValidationError
|
||||
from odoo.tools.float_utils import float_compare
|
||||
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PaymentAcquirerPayumoney(models.Model):
|
||||
_inherit = 'payment.acquirer'
|
||||
|
||||
provider = fields.Selection(selection_add=[
|
||||
('payumoney', 'PayUmoney')
|
||||
], ondelete={'payumoney': 'set default'})
|
||||
payumoney_merchant_key = fields.Char(string='Merchant Key', required_if_provider='payumoney', groups='base.group_user')
|
||||
payumoney_merchant_salt = fields.Char(string='Merchant Salt', required_if_provider='payumoney', groups='base.group_user')
|
||||
|
||||
def _get_payumoney_urls(self, environment):
|
||||
""" PayUmoney URLs"""
|
||||
if environment == 'prod':
|
||||
return {'payumoney_form_url': 'https://secure.payu.in/_payment'}
|
||||
else:
|
||||
return {'payumoney_form_url': 'https://sandboxsecure.payu.in/_payment'}
|
||||
|
||||
def _payumoney_generate_sign(self, inout, values):
|
||||
""" Generate the shasign for incoming or outgoing communications.
|
||||
:param self: the self browse record. It should have a shakey in shakey out
|
||||
:param string inout: 'in' (odoo contacting payumoney) or 'out' (payumoney
|
||||
contacting odoo).
|
||||
:param dict values: transaction values
|
||||
|
||||
:return string: shasign
|
||||
"""
|
||||
if inout not in ('in', 'out'):
|
||||
raise Exception("Type must be 'in' or 'out'")
|
||||
|
||||
if inout == 'in':
|
||||
keys = "key|txnid|amount|productinfo|firstname|email|udf1|||||||||".split('|')
|
||||
sign = ''.join('%s|' % (values.get(k) or '') for k in keys)
|
||||
sign += self.payumoney_merchant_salt or ''
|
||||
else:
|
||||
keys = "|status||||||||||udf1|email|firstname|productinfo|amount|txnid".split('|')
|
||||
sign = ''.join('%s|' % (values.get(k) or '') for k in keys)
|
||||
sign = self.payumoney_merchant_salt + sign + self.payumoney_merchant_key
|
||||
|
||||
shasign = hashlib.sha512(sign.encode('utf-8')).hexdigest()
|
||||
return shasign
|
||||
|
||||
def payumoney_form_generate_values(self, values):
|
||||
self.ensure_one()
|
||||
base_url = self.get_base_url()
|
||||
payumoney_values = dict(values,
|
||||
key=self.payumoney_merchant_key,
|
||||
txnid=values['reference'],
|
||||
amount=values['amount'],
|
||||
productinfo=values['reference'],
|
||||
firstname=values.get('partner_name'),
|
||||
email=values.get('partner_email'),
|
||||
phone=values.get('partner_phone'),
|
||||
service_provider='payu_paisa',
|
||||
surl=urls.url_join(base_url, '/payment/payumoney/return'),
|
||||
furl=urls.url_join(base_url, '/payment/payumoney/error'),
|
||||
curl=urls.url_join(base_url, '/payment/payumoney/cancel')
|
||||
)
|
||||
|
||||
payumoney_values['udf1'] = payumoney_values.pop('return_url', '/')
|
||||
payumoney_values['hash'] = self._payumoney_generate_sign('in', payumoney_values)
|
||||
return payumoney_values
|
||||
|
||||
def payumoney_get_form_action_url(self):
|
||||
self.ensure_one()
|
||||
environment = 'prod' if self.state == 'enabled' else 'test'
|
||||
return self._get_payumoney_urls(environment)['payumoney_form_url']
|
||||
|
||||
|
||||
class PaymentTransactionPayumoney(models.Model):
|
||||
_inherit = 'payment.transaction'
|
||||
|
||||
@api.model
|
||||
def _payumoney_form_get_tx_from_data(self, data):
|
||||
""" Given a data dict coming from payumoney, verify it and find the related
|
||||
transaction record. """
|
||||
reference = data.get('txnid')
|
||||
pay_id = data.get('mihpayid')
|
||||
shasign = data.get('hash')
|
||||
if not reference or not pay_id or not shasign:
|
||||
raise ValidationError(_('PayUmoney: received data with missing reference (%s) or pay_id (%s) or shasign (%s)') % (reference, pay_id, shasign))
|
||||
|
||||
transaction = self.search([('reference', '=', reference)])
|
||||
|
||||
if not transaction:
|
||||
error_msg = (_('PayUmoney: received data for reference %s; no order found') % (reference))
|
||||
raise ValidationError(error_msg)
|
||||
elif len(transaction) > 1:
|
||||
error_msg = (_('PayUmoney: received data for reference %s; multiple orders found') % (reference))
|
||||
raise ValidationError(error_msg)
|
||||
|
||||
#verify shasign
|
||||
shasign_check = transaction.acquirer_id._payumoney_generate_sign('out', data)
|
||||
if shasign_check.upper() != shasign.upper():
|
||||
raise ValidationError(_('PayUmoney: invalid shasign, received %s, computed %s, for data %s') % (shasign, shasign_check, data))
|
||||
return transaction
|
||||
|
||||
def _payumoney_form_get_invalid_parameters(self, data):
|
||||
invalid_parameters = []
|
||||
|
||||
if self.acquirer_reference and data.get('mihpayid') != self.acquirer_reference:
|
||||
invalid_parameters.append(
|
||||
('Transaction Id', data.get('mihpayid'), self.acquirer_reference))
|
||||
#check what is buyed
|
||||
if float_compare(float(data.get('amount', '0.0')), self.amount, 2) != 0:
|
||||
invalid_parameters.append(
|
||||
('Amount', data.get('amount'), '%.2f' % self.amount))
|
||||
|
||||
return invalid_parameters
|
||||
|
||||
def _payumoney_form_validate(self, data):
|
||||
status = data.get('status')
|
||||
result = self.write({
|
||||
'acquirer_reference': data.get('payuMoneyId'),
|
||||
'date': fields.Datetime.now(),
|
||||
})
|
||||
if status == 'success':
|
||||
self._set_transaction_done()
|
||||
elif status != 'pending':
|
||||
self._set_transaction_cancel()
|
||||
else:
|
||||
self._set_transaction_pending()
|
||||
return result
|
||||
@@ -0,0 +1,51 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import hashlib
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class PaymentAcquirer(models.Model):
|
||||
_inherit = 'payment.acquirer'
|
||||
|
||||
provider = fields.Selection(
|
||||
selection_add=[('payumoney', "PayUmoney")], ondelete={'payumoney': 'set default'})
|
||||
payumoney_merchant_key = fields.Char(
|
||||
string="Merchant Key", help="The key solely used to identify the account with PayU money",
|
||||
required_if_provider='payumoney')
|
||||
payumoney_merchant_salt = fields.Char(
|
||||
string="Merchant Salt", required_if_provider='payumoney', groups='base.group_system')
|
||||
|
||||
@api.model
|
||||
def _get_compatible_acquirers(self, *args, currency_id=None, **kwargs):
|
||||
""" Override of payment to unlist PayUmoney acquirers when the currency is not INR. """
|
||||
acquirers = super()._get_compatible_acquirers(*args, currency_id=currency_id, **kwargs)
|
||||
|
||||
currency = self.env['res.currency'].browse(currency_id).exists()
|
||||
if currency and currency.name != 'INR':
|
||||
acquirers = acquirers.filtered(lambda a: a.provider != 'payumoney')
|
||||
|
||||
return acquirers
|
||||
|
||||
def _payumoney_generate_sign(self, values, incoming=True):
|
||||
""" Generate the shasign for incoming or outgoing communications.
|
||||
|
||||
:param dict values: The values used to generate the signature
|
||||
:param bool incoming: Whether the signature must be generated for an incoming (PayUmoney to
|
||||
Odoo) or outgoing (Odoo to PayUMoney) communication.
|
||||
:return: The shasign
|
||||
:rtype: str
|
||||
"""
|
||||
sign_values = {
|
||||
**values,
|
||||
'key': self.payumoney_merchant_key,
|
||||
'salt': self.payumoney_merchant_salt,
|
||||
}
|
||||
if incoming:
|
||||
keys = 'salt|status||||||udf5|udf4|udf3|udf2|udf1|email|firstname|productinfo|amount|' \
|
||||
'txnid|key'
|
||||
sign = '|'.join(f'{sign_values.get(k) or ""}' for k in keys.split('|'))
|
||||
else: # outgoing
|
||||
keys = 'key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||salt'
|
||||
sign = '|'.join(f'{sign_values.get(k) or ""}' for k in keys.split('|'))
|
||||
return hashlib.sha512(sign.encode('utf-8')).hexdigest()
|
||||
@@ -0,0 +1,114 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from werkzeug import urls
|
||||
|
||||
from odoo import _, api, models
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
from odoo.addons.payment import utils as payment_utils
|
||||
from odoo.addons.payment_payumoney.controllers.main import PayUMoneyController
|
||||
|
||||
|
||||
class PaymentTransaction(models.Model):
|
||||
_inherit = 'payment.transaction'
|
||||
|
||||
def _get_specific_rendering_values(self, processing_values):
|
||||
""" Override of payment to return Payumoney-specific rendering values.
|
||||
|
||||
Note: self.ensure_one() from `_get_processing_values`
|
||||
|
||||
:param dict processing_values: The generic and specific processing values of the transaction
|
||||
:return: The dict of acquirer-specific processing values
|
||||
:rtype: dict
|
||||
"""
|
||||
res = super()._get_specific_rendering_values(processing_values)
|
||||
if self.provider != 'payumoney':
|
||||
return res
|
||||
|
||||
first_name, last_name = payment_utils.split_partner_name(self.partner_id.name)
|
||||
api_url = 'https://secure.payu.in/_payment' if self.acquirer_id.state == 'enabled' \
|
||||
else 'https://sandboxsecure.payu.in/_payment'
|
||||
payumoney_values = {
|
||||
'key': self.acquirer_id.payumoney_merchant_key,
|
||||
'txnid': self.reference,
|
||||
'amount': self.amount,
|
||||
'productinfo': self.reference,
|
||||
'firstname': first_name,
|
||||
'lastname': last_name,
|
||||
'email': self.partner_email,
|
||||
'phone': self.partner_phone,
|
||||
'return_url': urls.url_join(self.get_base_url(), PayUMoneyController._return_url),
|
||||
'api_url': api_url,
|
||||
}
|
||||
payumoney_values['hash'] = self.acquirer_id._payumoney_generate_sign(
|
||||
payumoney_values, incoming=False,
|
||||
)
|
||||
return payumoney_values
|
||||
|
||||
@api.model
|
||||
def _get_tx_from_feedback_data(self, provider, data):
|
||||
""" Override of payment to find the transaction based on Payumoney data.
|
||||
|
||||
:param str provider: The provider of the acquirer that handled the transaction
|
||||
:param dict data: The feedback data sent by the provider
|
||||
:return: The transaction if found
|
||||
:rtype: recordset of `payment.transaction`
|
||||
:raise: ValidationError if inconsistent data were received
|
||||
:raise: ValidationError if the data match no transaction
|
||||
:raise: ValidationError if the signature can not be verified
|
||||
"""
|
||||
tx = super()._get_tx_from_feedback_data(provider, data)
|
||||
if provider != 'payumoney':
|
||||
return tx
|
||||
|
||||
reference = data.get('txnid')
|
||||
shasign = data.get('hash')
|
||||
if not reference or not shasign:
|
||||
raise ValidationError(
|
||||
"PayUmoney: " + _(
|
||||
"Received data with missing reference (%(ref)s) or shasign (%(sign)s)",
|
||||
ref=reference, sign=shasign,
|
||||
)
|
||||
)
|
||||
|
||||
tx = self.search([('reference', '=', reference), ('provider', '=', 'payumoney')])
|
||||
if not tx:
|
||||
raise ValidationError(
|
||||
"PayUmoney: " + _("No transaction found matching reference %s.", reference)
|
||||
)
|
||||
|
||||
# Verify shasign
|
||||
shasign_check = tx.acquirer_id._payumoney_generate_sign(data, incoming=True)
|
||||
if shasign_check != shasign:
|
||||
raise ValidationError(
|
||||
"PayUmoney: " + _(
|
||||
"Invalid shasign: received %(sign)s, computed %(computed)s.",
|
||||
sign=shasign, computed=shasign_check
|
||||
)
|
||||
)
|
||||
|
||||
return tx
|
||||
|
||||
def _process_feedback_data(self, data):
|
||||
""" Override of payment to process the transaction based on Payumoney data.
|
||||
|
||||
Note: self.ensure_one()
|
||||
|
||||
:param dict data: The feedback data sent by the provider
|
||||
:return: None
|
||||
"""
|
||||
super()._process_feedback_data(data)
|
||||
if self.provider != 'payumoney':
|
||||
return
|
||||
|
||||
status = data.get('status')
|
||||
self.acquirer_reference = data.get('payuMoneyId')
|
||||
|
||||
if status == 'success':
|
||||
self._set_done()
|
||||
else: # 'failure'
|
||||
# See https://www.payumoney.com/pdf/PayUMoney-Technical-Integration-Document.pdf
|
||||
error_code = data.get('Error')
|
||||
self._set_error(
|
||||
"PayUmoney: " + _("The payment encountered an error with code %s", error_code)
|
||||
)
|
||||
@@ -0,0 +1,4 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import common
|
||||
from . import test_payumoney
|
||||
@@ -0,0 +1,18 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo.addons.payment.tests.common import PaymentCommon
|
||||
|
||||
|
||||
class PayumoneyCommon(PaymentCommon):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
|
||||
cls.payumoney = cls._prepare_acquirer('payumoney', update_values={
|
||||
'payumoney_merchant_key': 'dummy',
|
||||
'payumoney_merchant_salt': 'dummy',
|
||||
})
|
||||
|
||||
# Override default values
|
||||
cls.acquirer = cls.payumoney
|
||||
cls.currency = cls._prepare_currency('INR')
|
||||
@@ -0,0 +1,56 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo.tests import tagged
|
||||
from odoo.tools import mute_logger
|
||||
|
||||
from .common import PayumoneyCommon
|
||||
from ..controllers.main import PayUMoneyController
|
||||
from odoo.addons.payment import utils as payment_utils
|
||||
|
||||
|
||||
@tagged('post_install', '-at_install')
|
||||
class PayumoneyTest(PayumoneyCommon):
|
||||
|
||||
def test_compatible_acquirers(self):
|
||||
acquirers = self.env['payment.acquirer']._get_compatible_acquirers(
|
||||
partner_id=self.partner.id,
|
||||
company_id=self.company.id,
|
||||
currency_id=self.currency.id,
|
||||
)
|
||||
self.assertIn(self.payumoney, acquirers)
|
||||
|
||||
acquirers = self.env['payment.acquirer']._get_compatible_acquirers(
|
||||
partner_id=self.partner.id,
|
||||
company_id=self.company.id,
|
||||
currency_id=self.currency_euro.id,
|
||||
)
|
||||
self.assertNotIn(self.payumoney, acquirers)
|
||||
|
||||
def test_redirect_form_values(self):
|
||||
tx = self.create_transaction(flow='redirect')
|
||||
with mute_logger('odoo.addons.payment.models.payment_transaction'):
|
||||
processing_values = tx._get_processing_values()
|
||||
|
||||
form_info = self._extract_values_from_html_form(processing_values['redirect_form_html'])
|
||||
first_name, last_name = payment_utils.split_partner_name(self.partner.name)
|
||||
return_url = self._build_url(PayUMoneyController._return_url)
|
||||
expected_values = {
|
||||
'key': self.payumoney.payumoney_merchant_key,
|
||||
'txnid': self.reference,
|
||||
'amount': str(self.amount),
|
||||
'productinfo': self.reference,
|
||||
'firstname': first_name,
|
||||
'lastname': last_name,
|
||||
'email': self.partner.email,
|
||||
'phone': self.partner.phone,
|
||||
'surl': return_url,
|
||||
'furl': return_url,
|
||||
'service_provider': 'payu_paisa',
|
||||
}
|
||||
expected_values['hash'] = self.payumoney._payumoney_generate_sign(
|
||||
expected_values, incoming=False,
|
||||
)
|
||||
self.assertEqual(form_info['action'],
|
||||
'https://sandboxsecure.payu.in/_payment')
|
||||
self.assertDictEqual(form_info['inputs'], expected_values,
|
||||
"PayUMoney: invalid inputs specified in the redirect form.")
|
||||
@@ -1,19 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="payumoney_form">
|
||||
<input type="hidden" name="data_set" t-att-data-action-url="tx_url" data-remove-me=""/>
|
||||
<input type="hidden" name="key" t-att-value='key' />
|
||||
<input type="hidden" name="txnid" t-att-value='txnid' />
|
||||
<input type="hidden" name="amount" t-att-value='amount' />
|
||||
<input type="hidden" name="productinfo" t-att-value='productinfo' />
|
||||
<input type="hidden" name="firstname" t-att-value='firstname' />
|
||||
<input type="hidden" name="email" t-att-value='email' />
|
||||
<input type="hidden" name="phone" t-att-value='phone'/>
|
||||
<input type="hidden" name="service_provider" t-att-value='service_provider' />
|
||||
<input type="hidden" name="hash" t-att-value='hash' />
|
||||
<input type="hidden" name="surl" t-att-value='surl' />
|
||||
<input type="hidden" name="furl" t-att-value='furl' />
|
||||
<input type="hidden" name="curl" t-att-value='curl' />
|
||||
<input type="hidden" name="udf1" t-att-value='udf1'/>
|
||||
|
||||
<template id="redirect_form">
|
||||
<form t-att-action="api_url" method="post">
|
||||
<input type="hidden" name="key" t-att-value="key"/>
|
||||
<input type="hidden" name="txnid" t-att-value="txnid"/>
|
||||
<input type="hidden" name="amount" t-att-value="amount"/>
|
||||
<input type="hidden" name="productinfo" t-att-value="productinfo"/>
|
||||
<input type="hidden" name="firstname" t-att-value="firstname"/>
|
||||
<input type="hidden" name="lastname" t-att-value="lastname"/>
|
||||
<input type="hidden" name="email" t-att-value="email"/>
|
||||
<input type="hidden" name="phone" t-att-value="phone"/>
|
||||
<input type="hidden" name="surl" t-att-value="return_url"/>
|
||||
<input type="hidden" name="furl" t-att-value="return_url"/>
|
||||
<input type="hidden" name="service_provider" value="payu_paisa"/>
|
||||
<input type="hidden" name="hash" t-att-value="hash"/>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="payment_acquirer_form_payumoney" model="ir.ui.view">
|
||||
<field name="name">payment.acquirer.form.inherit</field>
|
||||
|
||||
<record id="payment_acquirer_form" model="ir.ui.view">
|
||||
<field name="name">PayUMoney Acquirer Form</field>
|
||||
<field name="model">payment.acquirer</field>
|
||||
<field name="inherit_id" ref="payment.acquirer_form"/>
|
||||
<field name="inherit_id" ref="payment.payment_acquirer_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr='//group[@name="acquirer"]' position='inside'>
|
||||
<group attrs="{'invisible': [('provider', '!=', 'payumoney')]}">
|
||||
@@ -13,4 +14,5 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user