Avoid creating Billing Address from webform if not configured in settings

Created on 5 March 2024, 10 months ago
Updated 6 March 2024, 10 months ago

1.0 Problem/Motivation
I think this is a bug/improvement required on the d9/10 version of the module.

If a webform has an Address configured to store as Location type = Main.
On submitting the webform, if user tries to pay using a payment processor (eg stripe), an additional billing address is created for the contact in civicrm.
This location type is hardcoded in the module from a long time - https://github.com/colemanw/webform_civicrm/blob/6.x/src/WebformCivicrmP....

I think it could be modified to eg
- If there is an address field enabled on the webform "Contact" tab.
- If there is no Billing Address enabled on the webform "Contribution" tab.

2.0 Detailed steps to reproduce (embed screenshots)
- Create a webform with Address fields with location type = Main and enable contribuiton
- Enable a payment processor, eg Stripe.
- Submit the form using a contact.
- 2 address values are created on the contact (Main & Billing) which is confusing both for admin and for the contact?

3.0 Proposed resolution

Either we make it clear some way that an additional billing would be created if user pays instantly?

OR

- the code checks for the 2 conditions above and if both are true, ensure the address created is only the one configured in the contact tab.

Testing

- Possibly requires testing with multiple processors since I think some of them may require the billing address for certain reasons? Do they still behave the same eg iATs, Eway, etc?

🐛 Bug report
Status

Closed: works as designed

Version

6.2

Component

CiviCRM Data Handling

Created by

🇮🇳India jitendrapurohit

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jitendrapurohit
  • Status changed to Closed: works as designed 10 months ago
  • 🇮🇳India jitendrapurohit

    This is working as expected when i test it on a fresh local setup. Though, there's an issue when state field is not included on the webform (will raise a separate ticket/PR), but dont think it has anything to do with the billing address submission. Closing..

Production build 0.71.5 2024