When Billing information is disabled on Checkout settings, using WPP payment method results in EntityMetadataWrapperException: Unknown data property commerce_customer_address. in EntityStructureWrapper->getPropertyInfo() (line 340 of /var/www/kickstart1/sites/all/modules/entity/includes/entity.wrapper.inc). error.

Just discussed it with Haza, and we're thinking about 2-part verification here:

  • implementing hook_requirements() for commerce_paypal_wpp - verifying that Billing information is not disabled,
  • altering commerce_checkout_builder_form with new validation function doing the same verification as above.

Any thoughts on this?

I could do a patch for it, unless someone already has it fixed?

Comments

rszrama’s picture

Status: Active » Fixed

I don't think we can reliably know in advance whether or not an order is going to have a billing profile with an address field on it prior to the point at which we actually attempt payment. The problem is that the billing profile could have been populated any number of ways that don't involve using the core "Billing information" checkout pane - Address Book with default addresses, custom Rules based on user profile fields, or just custom code working through one of many hooks.

The best we can hope for here is to just check before trying to get the address data from the order and fail if it couldn't be found. The PayPal WPP API requires these values to process payments, so I've added an error message that indicates this if the address couldn't be found. I'll update the documentation as well.

Commit: http://drupalcode.org/project/commerce_paypal.git/commitdiff/09c776e

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.