summaryrefslogtreecommitdiff
path: root/addons/website_payment/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/website_payment/static/src/js')
-rw-r--r--addons/website_payment/static/src/js/payment_acquirer.js55
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();
- }
- });
- });
-});