diff options
Diffstat (limited to 'addons/website_payment/static/src')
3 files changed, 2 insertions, 57 deletions
diff --git a/addons/website_payment/static/src/css/website_payment.css b/addons/website_payment/static/src/css/website_payment.css index 1892700fdd0..e9db1fd8d28 100644 --- a/addons/website_payment/static/src/css/website_payment.css +++ b/addons/website_payment/static/src/css/website_payment.css @@ -8,7 +8,7 @@ div.card_placeholder { width: 32px; height: 20px; position: absolute; - top: 34px; + top: 8px; right: 20px; -webkit-transition: 0.4s cubic-bezier(0.455, 0.03, 0.515, 0.955); transition: 0.4s cubic-bezier(0.455, 0.03, 0.515, 0.955); diff --git a/addons/website_payment/static/src/css/website_payment.sass b/addons/website_payment/static/src/css/website_payment.sass index a396bae99c1..e7de8c55cd5 100644 --- a/addons/website_payment/static/src/css/website_payment.sass +++ b/addons/website_payment/static/src/css/website_payment.sass @@ -10,7 +10,7 @@ div.card_placeholder width: 32px height: 20px position: absolute - top: 34px + top: 8px right: 20px -webkit-transition: .4s cubic-bezier(0.455,0.03,0.515,0.955) transition: .4s cubic-bezier(0.455,0.03,0.515,0.955) 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(); - } - }); - }); -}); |
