refactor: phone number field when channel is phone on Payment Request (#44949)

Co-authored-by: maniamartial <martialamania19@gmail.com>
(cherry picked from commit cfa062df86)
This commit is contained in:
Joseph Mania
2025-01-04 02:53:41 +03:00
committed by ruthra kumar
parent 5245c54de9
commit 947ab72441
2 changed files with 15 additions and 2 deletions

View File

@@ -60,7 +60,8 @@
"payment_order",
"amended_from",
"column_break_pnyv",
"payment_url"
"payment_url",
"phone_number"
],
"fields": [
{
@@ -378,6 +379,7 @@
"read_only": 1
},
{
"depends_on": "eval: doc.payment_channel==\"Phone\"",
"fetch_from": "payment_gateway_account.payment_channel",
"fieldname": "payment_channel",
"fieldtype": "Select",
@@ -444,13 +446,22 @@
"fieldtype": "Data",
"label": "Party Name",
"read_only": 1
},
{
"fieldname": "column_break_iiuv",
"fieldtype": "Column Break"
},
{
"fieldname": "phone_number",
"fieldtype": "Data",
"label": "Phone Number"
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-10-23 12:23:40.117336",
"modified": "2024-12-27 21:29:10.361894",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",

View File

@@ -221,6 +221,7 @@ class PaymentRequest(Document):
sender=self.email_to,
currency=self.currency,
payment_gateway=self.payment_gateway,
phone_number=self.phone_number,
)
controller.validate_transaction_currency(self.currency)
@@ -643,6 +644,7 @@ def make_payment_request(**args):
or args.order_type == "Shopping Cart" # compat for webshop app
or gateway_account.get("payment_channel", "Email") != "Email"
),
"phone_number": args.get("phone_number") if args.get("phone_number") else None,
}
)