boomerdigital / spree_avatax_certified

Improve your Spree store's sales tax decision automation with Avalara AvaTax
Other
12 stars 42 forks source link

Spree::Payment#avalara_finalize bug #127

Open rczjns opened 5 years ago

rczjns commented 5 years ago

I'm using the master branch. And this bug

Bug

avalara_finalize method updates the amount of payment to be the order total. This is not a valid update, if the order contains multiple payments (store credit plus credit card too).

def avalara_finalize
    return unless avalara_tax_enabled?

    if self.amount != order.total
      self.update_attributes(amount: order.total)
    end

    order.avalara_capture_finalize
  end

Why is this update necessary after the capture?

dhonig commented 5 years ago

@rczjns The gem is written to meet the needs of the 80/20, against a solidus store out of the box. Its most common for stores to use one or two payment methods at most. Do you have a need for this in your store? If so do you have a proposal or suggestion for behavior of this method?