After setting up a test site and then integrating this module, I found that it relies on the existence of certain fields on an order.
For example, in the function commerce_payment_eway_submit_form_submit, line 258:

 $profile_id = $order->commerce_customer_billing['und'][0]['profile_id'];
  $profile = commerce_customer_profile_load ($profile_id);
  $address = $profile->commerce_customer_address['und'][0];

Now that commerce allows more flexibility with fields and entity relationships, these fields (commerce_customer_billing on order and commerce_customer_address on profile) may not necessarily exist. Additionally, when creating a customer (using token payments) there lots of fields which are passed to eway using hard-coded field names or static values (e.g. title =>"Prof.")

so the existence of these fields are currently required for the module to work

So what would be the best way to making these fields configurable?

Perhaps some kind of mapping UI or maybe a config array somewhere which can be altered with a hook.

I figure it's a good time to ask this question as the code is still in the early stages of development.

I'd be happy to help with coding here too.

-Tim

Comments

Anonymous’s picture

yep, that sounds like a bug.

patches welcome!

thtas’s picture

After some thought i think the "drupal commerce way" of doing this would be to integrate it all in to rules, and allow for fields to be selected with tokens.
It would mean the creation of some extra actions which can then have their fields configured in the rules ui.

I'm not very well versed with the rules api (yet!) so probably won't be starting on this any time soon...

Until this is done I think it's pretty acceptable to simply require the presence of the commerce_customer_billing field.

rcross’s picture

Status: Active » Postponed (maintainer needs more info)

I'll review this again later when we've made other changes to the code.