mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-08 21:12:32 +00:00
Merge pull request #42393 from blaggacao/payments/pr-5
refactor: explicate intent on make_payment_request interface
This commit is contained in:
@@ -491,10 +491,15 @@ def make_payment_request(**args):
|
||||
"party_type": args.get("party_type") or "Customer",
|
||||
"party": args.get("party") or ref_doc.get("customer"),
|
||||
"bank_account": bank_account,
|
||||
"make_sales_invoice": args.order_type == "Shopping Cart",
|
||||
"mute_email": args.mute_email
|
||||
or args.order_type == "Shopping Cart"
|
||||
or gateway_account.get("payment_channel", "Email") != "Email",
|
||||
"make_sales_invoice": (
|
||||
args.make_sales_invoice # new standard
|
||||
or args.order_type == "Shopping Cart" # compat for webshop app
|
||||
),
|
||||
"mute_email": (
|
||||
args.mute_email # new standard
|
||||
or args.order_type == "Shopping Cart" # compat for webshop app
|
||||
or gateway_account.get("payment_channel", "Email") != "Email"
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -194,7 +194,8 @@ class TestPaymentRequest(unittest.TestCase):
|
||||
dt="Sales Order",
|
||||
dn=so.name,
|
||||
payment_gateway_account="_Test Gateway - USD", # email channel
|
||||
order_type="Shopping Cart",
|
||||
make_sales_invoice=True,
|
||||
mute_email=True,
|
||||
submit_doc=True,
|
||||
return_doc=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user