piggybak/piggybak — pull request #44 by dinjas (2013-03-14 17:39:38+00:00)
Title: Creating a payment object for a line_item if it doesn't exist in the line item preprocess method.

While trying to implement piggybak and piggybak_stripe into my project, piggybak kept throwing an error when the order was submitted in the line_item postprocess_payment method indicating that self.payment was nil on the line:

if self.payment.process(self.order)

I wasn't really able to determine where payments were expected to be created. I see some created on line 154 in order.rb, but they don't seem to be present when processing the order in line_item.rb. I hacked around this by creating the payment object if it doesn't exist, but am wondering why others haven't had the same problem.

Has anyone else run into this issue? I believe I've set everything up correctly, and all seems to be working with this modification to the piggybak gem.

Thanks