When a receptionist attempts to process a card payment over the phone via /appointments/<id>/record-payment/, Stripe requires a postal code (ZIP) field. This creates two problems:
"Your postal code is incomplete" or "Your postal code is invalid" errorsThis blocks the card payment flow for phone-based payments.
The Stripe account (acct_1TU3wWV05DCU8TCf — Veripath sandbox, owned by mstickels@yahoo.co.uk) has postal code collection enabled at the account level in the Stripe Dashboard (Settings → Payments → Card payments → Postal code collection).
This setting cannot be overridden via the API — it must be changed in the Stripe Dashboard.
| Approach | Result |
|---|---|
hidePostalCode: true on combined Card Element |
Deprecated — no effect |
Individual Elements (cardNumber, cardExpiry, cardCvc) |
ZIP field still rendered |
billing_details.address.postal_code in confirmCardPayment |
Stripe still shows ZIP field on the element |
createPaymentMethod with billing_details.address.postal_code first, then confirmCardPayment with PaymentMethod ID |
Untested — may work since PaymentMethod already has postal code attached |
The most promising approach (last in the table above) was implemented but not yet verified:
PaymentMethod via stripe.createPaymentMethod({ type: 'card', card: cardNumber, billing_details: { address: { postal_code: '12345' } } })PaymentIntent with that PaymentMethod (which already has a postal code)templates/appointments/record_payment.html — Card payment form with Stripe Elementsappointments/views.py — CreatePaymentIntentView accepts payment_method_id and confirms server-sideLog into https://dashboard.stripe.com → Settings → Payments → Card payments → Postal code collection → set to "Optional" or "Do not collect".
This is the cleanest fix — once disabled, the ZIP field disappears from all Stripe Elements forms.
createPaymentMethod approachThe latest code creates a PaymentMethod with postal code first, then confirms via server. This may bypass the ZIP field entirely since the PaymentMethod is already complete.
Instead of frontend Elements, use Stripe API directly with test tokens (tok_visa) for test mode, and Stripe Terminal for production. This avoids frontend Elements entirely.
appointments_paymentconfig table (practice-level Stripe keys)