http://drupal.org/cvs?commit=290126

This durpal_alter() isn't needed, as we already do it in a lower level -- uc_recurring_fee_user_save()

Comments

univate’s picture

The problem is that by the time you get to the uc_recurring_fee_user_save the fee has already been processed, thats a problem as the drupal_alter needs to be called before the data is actually processed or used so modules have a change to alter it.

I am tempted to suggest that we don't need the save one and this one will do the job of both.

amitaibu’s picture

Can you explain your use case.

univate’s picture

The use case is more related to hosted recurring gateways, where a module may want to adjust the recurring fee that is being setup. For gateways like Authorize.net ARB or Paypal WPS the recurring fee in uc_recurring is not really relevant once its been processed, so for these hosted gateways if a module wants to do something it needs to do it before it gets processed.

The drupal_alter needs to be called as soon as the data object is created, which is why the one where it is save method probably is not required.

Also having this in the save function may not be the most useful place, as this function is call for lots of different reasons in lots of different places ie: creating/editing/deleting recurring fees.

Although having said all this I'm now wondering if maybe what I'm really wanting is a hook? and not a drupal_alter function.

amitaibu’s picture

> For gateways like Authorize.net ARB or Paypal WPS

I think you should look at the implementaion of #569300: Create Paypal WPP recurring fee handler and how it solves the "need to process the recurring in one go".

> ie: creating/editing/deleting recurring fees.

Not exactly:
- Deleting has module_invoke_all('recurring_user_delete', $rfid);
- Create or update can be distinguished by an implementing module by checking !empty($fee->rfid)

univate’s picture

This issue is not about a payment gateway module but any general module that wants to alter the fee data before it is processed - its just this is most relevant on hosted gateways as once they have been processed you can't always alter the fee information.

I guess it could still use the method you describe, but not sure that makes the most sense here when all I really what is say change the first date the recurring fee should occur on - no matter what gateway is actually used.

univate’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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