Skip to content

Commit

Permalink
Merge pull request #113 from ruthra-kumar/backport_clear_button
Browse files Browse the repository at this point in the history
refactor: 'Clear' button on Razorpay settings
  • Loading branch information
ruthra-kumar authored Nov 11, 2024
2 parents 23e7f05 + ae8da29 commit b5eda73
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
// Copyright (c) 2016, Frappe Technologies and contributors
// For license information, please see license.txt

frappe.ui.form.on('Razorpay Settings', {
refresh: function(frm) {

}
});
frappe.ui.form.on("Razorpay Settings", {
refresh: function (frm) {
frm.add_custom_button(__("Clear"), function () {
frm.call({
doc: frm.doc,
method: "clear",
callback: function (r) {
frm.refresh();
},
});
});
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,13 @@ def verify_signature(self, body, signature, key):

return result

@frappe.whitelist()
def clear(self):
self.api_key = self.api_secret = None
self.redirect_url = None
self.flags.ignore_mandatory = True
self.save()


def capture_payment(is_sandbox=False, sanbox_response=None):
"""
Expand Down

0 comments on commit b5eda73

Please sign in to comment.