I'm currently working on an issue in the Webform Pay project that would keep track of the Pay module transaction information in the webform_submitted_data table (so that we could link to the Pay transaction from the Webform submission). However currently this seems to be very difficult to accomplish because the $transaction object is never passed along in the form_submit() handler. This patch adds the pay transaction into $form_state for later reference.

I'm not positive that this approach is 100% correct, but it seems to make sense that only one $form_state['pay_transaction'] item is needed because the single transaction can store all the actions from multiple payment methods. The $form_state['pay'] array also seems to be well structured right now with payment methods nicely keyed by pid.

CommentFileSizeAuthor
pay_transaction.patch816 bytesquicksketch

Comments

quicksketch’s picture

Status: Active » Needs review
allie micka’s picture

Status: Needs review » Postponed (maintainer needs more info)

Hi quicksketch!

At some point in the recent past, we began stashing activities in $form_state:

       $form_state['pay_activity'][] = $activity;

The activity can get its $transaction, so I think you're covered. I recall having good motives for using $activity rather than $transaction, but I don't really remember what those motives were offhand.

Do you find this sufficient for your needs?

allie micka’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I'm going to go ahead and won't-fix this, since transaction info is derivable from activity, which is already in form_state.