diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py
index 1ddca499af7..5c0a9c89eb7 100644
--- a/addons/payment/models/payment_acquirer.py
+++ b/addons/payment/models/payment_acquirer.py
@@ -57,8 +57,8 @@ class PaymentAcquirer(osv.Model):
'company_id': fields.many2one('res.company', 'Company', required=True),
'pre_msg': fields.html('Message', help='Message displayed to explain and help the payment process.'),
'post_msg': fields.html('Thanks Message', help='Message displayed after having done the payment process.'),
- 'process': fields.selection(
- [('static', 'Static'), ('dynamic', 'Dynamic')],
+ 'validation': fields.selection(
+ [('manual', 'Manual'), ('automatic', 'Automatic')],
string='Process Method',
help='Static payments are payments like transfer, that require manual steps.'),
'view_template_id': fields.many2one('ir.ui.view', 'Form Button Template', required=True),
@@ -79,7 +79,7 @@ class PaymentAcquirer(osv.Model):
_defaults = {
'company_id': lambda self, cr, uid, obj, ctx=None: self.pool['res.users'].browse(cr, uid, uid).company_id.id,
'env': 'test',
- 'process': 'dynamic',
+ 'validation': 'dynamic',
'website_published': True,
}
diff --git a/addons/payment_adyen/data/adyen.xml b/addons/payment_adyen/data/adyen.xml
index 92b0cf178b5..8f6e7e218e4 100644
--- a/addons/payment_adyen/data/adyen.xml
+++ b/addons/payment_adyen/data/adyen.xml
@@ -4,8 +4,11 @@
adyen
+
test
+ You will be redirected to the Adyen website after cliking on the payment button.
]]>
dummy
dummy
dummy
diff --git a/addons/payment_ogone/data/ogone.xml b/addons/payment_ogone/data/ogone.xml
index 2c57a361ef6..e94276ba3e1 100644
--- a/addons/payment_ogone/data/ogone.xml
+++ b/addons/payment_ogone/data/ogone.xml
@@ -4,8 +4,11 @@
ogone
+
test
+ You will be redirected to the Ogone website after cliking on the payment button.]]>
dummy
dummy
dummy
diff --git a/addons/payment_transfer/data/transfer.xml b/addons/payment_transfer/data/transfer.xml
index 78aae757181..c2863971d34 100644
--- a/addons/payment_transfer/data/transfer.xml
+++ b/addons/payment_transfer/data/transfer.xml
@@ -4,7 +4,9 @@
transfer
+
+ manual
test
There seems to be an error with your request.',
}
tx_ids = request.registry['payment.transaction'].search(
@@ -643,11 +644,25 @@ class Ecommerce(http.Controller):
], context=context)
if not tx_ids:
return {
- 'state': 'error'
+ 'state': 'error',
+ 'message': 'There seems to be an error with your request.
',
}
tx = request.registry['payment.transaction'].browse(cr, uid, tx_ids[0], context=context)
+ state = tx.state
+ if state == 'done':
+ message = 'Your payment has been received.
'
+ elif state == 'cancel':
+ message = 'The payment seems to have been canceled.
'
+ elif state == 'pending' and tx.validation == 'manual':
+ message = 'Your transaction is waiting confirmation.
'
+ message += tx.post_msg
+ else:
+ message = 'Your transaction is waiting confirmation.
'
+
return {
- 'state': tx.state,
+ 'state': state,
+ 'message': message,
+ 'validation': tx.validation
}
@http.route('/shop/payment/validate/', type='http', auth="public", website=True, multilang=True)
diff --git a/addons/website_sale/static/src/js/website_sale_validate.js b/addons/website_sale/static/src/js/website_sale_validate.js
index 2543d2e3c55..da917eb1298 100644
--- a/addons/website_sale/static/src/js/website_sale_validate.js
+++ b/addons/website_sale/static/src/js/website_sale_validate.js
@@ -11,22 +11,15 @@ $(document).ready(function () {
return openerp.jsonRpc('/shop/payment/get_status/' + order_id, 'call', {
}).then(function (result) {
var tx_node = $('div.oe_website_sale_tx_status');
- var txt = 'Your transaction is waiting confirmation.
';
_poll_nbr += 1;
- if (result.state == 'pending' && _poll_nbr <= 5) {
- txt = "Your transaction is waiting confirmation.
";
+ if (result.state == 'pending' && result.validation == 'automatic' && _poll_nbr <= 5) {
+ var txt = result.mesage;
setTimeout(function () {
payment_transaction_poll_status();
}, 1000);
}
- else if (result.state == 'done') {
- txt = "Your payment has been received.
";
- }
- else if (result.state == 'pending') {
- txt = "Your transaction is waiting confirmation. You may try to refresh this page.
";
- }
- else if (result.state == 'cancel') {
- txt = "The payment seems to have been canceled.
";
+ else {
+ var txt = result.message;
}
tx_node.html(txt);
});
diff --git a/addons/website_sale/views/website_sale.xml b/addons/website_sale/views/website_sale.xml
index 1d522f53aca..6e1112a57f4 100644
--- a/addons/website_sale/views/website_sale.xml
+++ b/addons/website_sale/views/website_sale.xml
@@ -960,7 +960,10 @@