In our current project, we are optionally selling warranty extensions on top of the chosen product. There is no VAT in Austria on that. So it comes that the order has both order items with tax and without. We have to check for that, otherwise we will get this PHP Notice:

"Undefined index: total_tax_amount in Drupal\commerce_klarna_payments\Klarna\Service\Payment\RequestBuilder->createUpdateRequest()"

CommentFileSizeAuthor
#2 3013563-2.patch1.63 KBagoradesign

Comments

agoradesign created an issue. See original summary.

agoradesign’s picture

Status: Active » Needs review
StatusFileSize
new1.63 KB

I'm proposing an explicit getter for the total tax amount, that takes care of whether or not the data is set at all.. I like explicit getters more than looking up in arrays

tuutti’s picture

Thanks for the patch!

  • tuutti committed 961ea57 on 8.x-1.x authored by agoradesign
    Issue #3013563 by agoradesign: Undefined index: total_tax_amount PHP...
tuutti’s picture

Status: Needs review » Fixed
agoradesign’s picture

wow nice, lots of other new getter functions :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.