Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-18397: Blank billing address created on paid event registrations with no billing address #8176

Closed
wants to merge 1 commit into from

Conversation

rohankatkar
Copy link
Contributor

@rohankatkar
Copy link
Contributor Author

jenkins, retest this please

@rohankatkar
Copy link
Contributor Author

@JKingsnorth, following cases are covered in this PR:

  1. Event registration with 'external' payment processor.
  2. Event registration with 'pay_later' and 'isBillingAddressRequiredForPayLater'.

@JKingsnorth
Copy link
Contributor

Manual testing does not pass, commented on JIRA.

@monishdeb monishdeb added the needs-work-not-review-ready Submitter required to take action, will be closed after 1-2 weeks in this state label Apr 20, 2016
@rohankatkar
Copy link
Contributor Author

@JKingsnorth , I agree with your comment which you've mentioned on JIRA. If you changed any information for contact it does not update.

This PR changes only fixes the following scenario:

  1. If you made a payment via external payment processor (here I am creating test contribution via 'PayPal Pro'), then it does not ask to fill billing address field as it redirects to the pay pal. After creating contribution, there is no blank billing address is added on contact summary page (no billing address section on contact summary page).

  2. As mentioned the case CRM-11926 Improve error message on APi failure to include DB error message #2 above in my comment, we also need to handle the case if 'pay_later' and 'isBillingAddressRequiredForPayLater' is set to true. In this case, if you changed any information for contact then, it gets updated. And of course 'Billing Address' is added for that contact.

I have also tested with your PR (#8122). As you mentioned in issue description, if we don't ask for billing details on the form, then we don't want to store them in Civi. So don't create a blank billing address.

In your PR, if I create contribution via external payment processor, then its added blank 'Billing Address' on contact summary page only with billing names and empty address fields. I think this is odd.

So, I think as you mentioned in comment on JIRA, need to handle changes to updates contact information.

@JKingsnorth
Copy link
Contributor

I'll take another look at the other PR. On my last testing it didn't create the blank billing details, but I'll re-check with a couple of external providers to see what the problem is - thanks for the feedback.

I'll also take a look at it in the context of 'pay later' with the 'billing address required' setting that you mention.

I'll take a look at this as soon as I can tomorrow. Thanks again.

@rohankatkar
Copy link
Contributor Author

@JKingsnorth, I have updated a PR for following scenarios:

  1. Event registration with 'external' payment processor.
  2. If an authenticated user makes the contribution then, contact fields are getting updated (e.g Email Address, Contact name).
  3. If an anonymous user registers for an event then, a new contact is created.
  4. If 'pay_later' and 'isBillingAddressRequiredForPayLater' is set to true, then, billing address is updated or added for that contact.

can you please check if PR satisfies above scenarios?

Changes for CRM-18397

warning fix
unset($value["billing_country_id-{$this->_bltID}"]);
unset($value["address_name-{$this->_bltID}"]);
}

Copy link
Member

@monishdeb monishdeb Apr 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks redundant as the above code 469-494 does the same job - unset billing address field (should have extended the above IF condition to do the same). Also looks like we are simply wiping out the billing address without a criteria this might affect payment processor which require billing address.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also have a bit of a vendetta against 'lists of fields' in Civi that are manually typed out like this. They are quite hard to maintain. I'll take another look at this in the alternate PR.

@rohankatkar
Copy link
Contributor Author

@JKingsnorth, I am using 'PayPal - Website Payments Pro' processor for testing.
I think, statndard solution would be just do not create billing address for contact, if billing address fields are empty.

I am closing this PR, because it may affect other use-cases where billing address is required in case of other external payment processor. you can cherry-pick my commit if its helpful.

@magnolia61
Copy link
Contributor

Am I correct this PR is not merged? Any chance it will be?

@JKingsnorth
Copy link
Contributor

@magnolia61 Would you be able to test the other PR we've proposed? #8122 If it works for you then that would be a good bit of review. If you find any issues then do let us know on the issue on JIRA, or on that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master needs-work-not-review-ready Submitter required to take action, will be closed after 1-2 weeks in this state
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants