Handling Tax - AEVI-AppFlow/pos-android-sdk GitHub Wiki
Tax is applied to goods and services around the world and requires special attention in some regions. AppFlow itself does not require or make use of tax amounts as a concept, but supports it being defined where required.
Tax information is represented via the TaxInfo
model, that consists of a tax amount and tax rates. Both the amount and tax rates are optional. This model can be associated at different levels of a payment - either for the whole payment/transaction, or per basket item as appropriate.
Payment
paymentBuilder.addAdditionalData("taxInfo", taxInfo);
TaxInfo taxInfo = payment.getAdditionalData().getValue("taxInfo", TaxInfo.class);
Per basket
basket.addAdditionalData("taxInfo", taxInfo);
TaxInfo taxInfo = basket.getAdditionalBasketData().getValue("taxInfo", TaxInfo.class);
Per basket item
basketItemBuilder.withItemData("taxInfo", taxInfo);
TaxInfo taxInfo = baskteItem.getItemData().getValue("taxInfo", TaxInfo.class);