Overview
What this PR does
When clinic staff generate an online payment link for a patient — to collect an invoice balance, a diagnostic fee, or a deposit at booking — Dentolize calls out to a payment provider (Geidea, Paymob, Fawry, or Stripe, depending on what the clinic has configured) and asks it to create a hosted checkout page.
If the provider is Paymob and the patient has no email address on file (email is an optional field on a patient's profile), the payment-link request that Dentolize sent to Paymob was missing the email field entirely. This PR makes Dentolize send a fallback email address, online_payment@dentolize.com, instead of omitting the field.
Why it matters
Paymob is one of four supported online payment providers, used primarily by clinics billing in Saudi riyal (SAR) or Egyptian pound (EGP). A patient's email is not a required field anywhere in Dentolize — not on the patient profile, not on the "Generate Online Link" form. That means it is completely normal, day-to-day usage for a patient to have no email at all. Every time that happened and staff tried to generate a Paymob payment link, the request to Paymob's API went out without an email key in the JSON body at all (because undefined values are dropped during serialization).
This PR is a one-line-of-logic fix: packages/server/src/resolvers/mutations/mutationUtils/onlinePaymentsUtils.js:196 now falls back to a placeholder email so the request always includes one.
Scope
This is a small, surgical bug fix — one shared helper function is changed, and every feature that calls it inherits the fix automatically:
- Generating an online payment link from an invoice (the most common path)
- Collecting a diagnostic fee online during an appointment
- Requesting online payment while booking a new appointment
- Requesting online payment while registering a new patient
Only the Paymob code path is affected. Geidea, Fawry, and Stripe use separate payloads that were not touched by this change and were not affected by this bug in the first place.
See Walkthrough for a guided tour of where this shows up in the product, and Paymob Fallback Email for the full technical breakdown.