diff options
| author | tbe-odoo <tbe@odoo.com> | 2017-07-28 15:52:34 +0200 |
|---|---|---|
| committer | Damien Bouvy <dbo@odoo.com> | 2017-08-14 08:30:59 +0200 |
| commit | 2df9c22d80be82b4ed7ffcd79f858e46c34e6479 (patch) | |
| tree | 5f3d7d68c4fc4e461e1a3f235266b14c23d0340a /addons/website_payment/static/src/js/payment_acquirer.js | |
| parent | c089d39a668fa6ab1f5d7867747da19d0b75f035 (diff) | |
[IMP] Payments & subscriptions: Improved Payments
- When registering a payment token, validating it using a payment of a small amount (~1.50€) followed by a refund allows ensuring
that the payment method is valid (i.e. checksumming the card number simple ensure the number is valid but not that the card exists).
This commit introduces a generic approach that must be implemented for each acquirer that has tokenization support.
This commit also introduces a generic payment token registration/usage template that can be adapted according to one's need.
- Introducing a new payment form that handles payment, deletion and adding payment method (only for server2server for the moment).
- On /my/payment_method, changed strings 'Payment Acquirers' to 'Payment Methods' which is more clear.
- Stripe can now be used to pay subscriptions.
Diffstat (limited to 'addons/website_payment/static/src/js/payment_acquirer.js')
| -rw-r--r-- | addons/website_payment/static/src/js/payment_acquirer.js | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/addons/website_payment/static/src/js/payment_acquirer.js b/addons/website_payment/static/src/js/payment_acquirer.js index e047694ac03..d7397f1b04d 100644 --- a/addons/website_payment/static/src/js/payment_acquirer.js +++ b/addons/website_payment/static/src/js/payment_acquirer.js @@ -60,58 +60,3 @@ $(document).ready(function () { }); }); - - -odoo.define('website_payment.payment_acquirer', function (require) { -"use strict"; - -var website = require('website.website'); -var ajax = require('web.ajax'); -var Dialog = require('web.Dialog'); - - var payment_methods = $('#payment_tokens_list'); - - payment_methods.find('button[name="delete_pm_id"]').on('click', function(ev){ - ev.stopPropagation(); - ev.preventDefault(); - var self = this; - - // we retrieve the selected payment method id - var payment_method_id = ev.target.value; - - var Delete = function() - { - payment_methods.find('button[name="delete_pm_id"]').off("click"); - ev.target.click(); - }; - - ajax.jsonRpc('/website_payment/get_linked_records', 'call', { - 'payment_token_id': payment_method_id, - }).done(function (response) { - // if there's records linked to the payment method we're trying to delete - if(response.length > 0) - { - var content = ''; - - response.forEach(function(sub) { - content += '<p><a href="/my/subscription/' + sub.id + '">' + sub.name + '</a><p/>'; - }); - - content = $('<div>').html('<p>This card is currently linked to the following records:<p/>' + content); - // Then we display the list of the records and ask the user if he really want to remove the ppayment method. - new Dialog(self, { - title: 'Warning!', - size: 'medium', - $content: content, - buttons: [ - {text: 'Confirm Deletion', classes: 'btn-primary', close: true, click: Delete}, - {text: 'Cancel', close: true}]}).open(); - } - // otherwise if the user has no records linked to this payment method, then we just delete it. - else - { - Delete(); - } - }); - }); -}); |
