Skip to content

Commit

Permalink
Merge pull request #112 from ruthra-kumar/clear_button_for_razorpay_s…
Browse files Browse the repository at this point in the history
…ettings

refactor: button to clear razorpay settings
  • Loading branch information
ruthra-kumar authored Oct 28, 2024
2 parents 22581cc + 80272ce commit d80039b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,15 @@
// For license information, please see license.txt

frappe.ui.form.on("Razorpay Settings", {
refresh: function (frm) {},
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 d80039b

Please sign in to comment.