Closed (fixed)
Project:
UC Recurring Payments and Subscriptions
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2009 at 14:40 UTC
Updated:
15 Mar 2010 at 04:00 UTC
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
Comment #1
univate commentedThe 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.
Comment #2
amitaibuCan you explain your use case.
Comment #3
univate commentedThe 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.
Comment #4
amitaibu> 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)Comment #5
univate commentedThis 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.
Comment #6
univate commented