utility to combine PaymentTransactionInfoPlugins

Maybe the pull request can be simplified to hide internal changes that aren't interesting after the fact
t2 can be nil: we've only returned in case both are nil. If only t1 or t2
is nill, I swap so t2 is the one that's nil and finish building t3. Maybe
this should be clearer.


On Fri, Aug 15, 2014 at 3:00 AM, Pierre-Alexandre Meyer <
notifications@github.com> wrote:

> In lib/killbill/helpers/utils.rb:
>
> > +        if t1.nil?
> > +          return nil if t2.nil?
> > +          t1=t2
> > +          t2=nil
> > +        end
> > +
> > +        # Create the combined transaction info and set the values
> > +        t3=Killbill::Plugin::Model::PaymentTransactionInfoPlugin.new
> > +        t3.kb_payment_id=t1.kb_payment_id
> > +        t3.kb_transaction_payment_id=t1.kb_transaction_payment_id
> > +        t3.transaction_type=t1.transaction_type
> > +        t3.amount=t1.amount
> > +        t3.currency=t1.currency
> > +        t3.created_date=t1.created_date
> > +        t3.effective_date=t1.effective_date
> > +        t3.status=t1.status==:PROCESSED && ( t2.nil? || t2.status==:PROCESSED) ? :PROCESSED : :ERROR
>
> t2 cannot be nil anymore (validation step above), can it?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/killbill/killbill-plugin-framework-ruby/pull/4/files#r16286362>
> .
>



-- 
Kevin Postlewaite