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

View File

@@ -221,6 +221,7 @@ class PaymentRequest(Document):
sender=self.email_to, sender=self.email_to,
currency=self.currency, currency=self.currency,
payment_gateway=self.payment_gateway, payment_gateway=self.payment_gateway,
phone_number=self.phone_number,
) )
controller.validate_transaction_currency(self.currency) 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 args.order_type == "Shopping Cart" # compat for webshop app
or gateway_account.get("payment_channel", "Email") != "Email" or gateway_account.get("payment_channel", "Email") != "Email"
), ),
"phone_number": args.get("phone_number") if args.get("phone_number") else None,
} }
) )