mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
fix: braintree payment processed twice (#27300)
(cherry picked from commit 798b464ee3)
# Conflicts:
# erpnext/accounts/doctype/payment_request/payment_request.py
# erpnext/hooks.py
This commit is contained in:
@@ -660,6 +660,7 @@ def make_payment_order(source_name, target_doc=None):
|
|||||||
|
|
||||||
return doclist
|
return doclist
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
def validate_payment(doc, method=None):
|
def validate_payment(doc, method=None):
|
||||||
if doc.reference_doctype != "Payment Request" or (
|
if doc.reference_doctype != "Payment Request" or (
|
||||||
@@ -672,3 +673,12 @@ def validate_payment(doc, method=None):
|
|||||||
doc.reference_docname
|
doc.reference_docname
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
=======
|
||||||
|
def validate_payment(doc, method=""):
|
||||||
|
if not frappe.db.has_column(doc.reference_doctype, 'status'):
|
||||||
|
return
|
||||||
|
|
||||||
|
status = frappe.db.get_value(doc.reference_doctype, doc.reference_docname, 'status')
|
||||||
|
if status == 'Paid':
|
||||||
|
frappe.throw(_("The Payment Request {0} is already paid, cannot process payment twice").format(doc.reference_docname))
|
||||||
|
>>>>>>> 798b464ee3 (fix: braintree payment processed twice (#27300))
|
||||||
|
|||||||
@@ -438,6 +438,7 @@ doc_events = {
|
|||||||
"validate": ["erpnext.erpnext_integrations.taxjar_integration.set_sales_tax"]
|
"validate": ["erpnext.erpnext_integrations.taxjar_integration.set_sales_tax"]
|
||||||
},
|
},
|
||||||
"Company": {
|
"Company": {
|
||||||
|
<<<<<<< HEAD
|
||||||
"on_trash": [
|
"on_trash": [
|
||||||
"erpnext.regional.india.utils.delete_gst_settings_for_company",
|
"erpnext.regional.india.utils.delete_gst_settings_for_company",
|
||||||
"erpnext.regional.saudi_arabia.utils.delete_vat_settings_for_company",
|
"erpnext.regional.saudi_arabia.utils.delete_vat_settings_for_company",
|
||||||
@@ -446,6 +447,13 @@ doc_events = {
|
|||||||
"Integration Request": {
|
"Integration Request": {
|
||||||
"validate": "erpnext.accounts.doctype.payment_request.payment_request.validate_payment"
|
"validate": "erpnext.accounts.doctype.payment_request.payment_request.validate_payment"
|
||||||
},
|
},
|
||||||
|
=======
|
||||||
|
"on_trash": "erpnext.regional.india.utils.delete_gst_settings_for_company"
|
||||||
|
},
|
||||||
|
"Integration Request": {
|
||||||
|
"validate": "erpnext.accounts.doctype.payment_request.payment_request.validate_payment"
|
||||||
|
}
|
||||||
|
>>>>>>> 798b464ee3 (fix: braintree payment processed twice (#27300))
|
||||||
}
|
}
|
||||||
|
|
||||||
# On cancel event Payment Entry will be exempted and all linked submittable doctype will get cancelled.
|
# On cancel event Payment Entry will be exempted and all linked submittable doctype will get cancelled.
|
||||||
|
|||||||
Reference in New Issue
Block a user