diff --git a/www/assets/%version/gittip.js b/www/assets/%version/gittip.js index 0aae820ca0..0cbb9f77b3 100644 --- a/www/assets/%version/gittip.js +++ b/www/assets/%version/gittip.js @@ -154,14 +154,30 @@ Gittip.paymentProcessorAttempts = 0; Gittip.submitDeleteForm = function(e) { + e.stopPropagation() + e.preventDefault() + if (!confirm("Really delete your credit card details?")) - { - e.stopPropagation(); - e.preventDefault() return false; - } + + jQuery.ajax( + { url: '/credit-card.json' + , data: {action: "delete"} + , type: "POST" + , success: function() { + window.location.href = "/credit-card.html"; + } + , error: function(x,y,z) { + select(cur); + alert("Sorry, something went wrong deleting your credit card. :("); + console.log(x,y,z); + } + } + ); + return false; }; + Gittip.submitPaymentForm = function(e) { e.stopPropagation(); diff --git a/www/credit-card.html b/www/credit-card.html index aee484cd1e..ce71747687 100644 --- a/www/credit-card.html +++ b/www/credit-card.html @@ -195,8 +195,8 @@

Delete credit card.

Your credit card details will immediately be completely purged from Gittip.

-
- + +