Skip to content

Commit 899317b

Browse files
committed
taxation decider is now if value exists or not
1 parent fe04b45 commit 899317b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/src/main/java/io/snabble/sdk/Checkout.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public void success(CheckoutApi.SignedCheckoutInfo checkoutInfo,
290290
CheckoutApi.PaymentMethodInfo[] availablePaymentMethods) {
291291
signedCheckoutInfo = checkoutInfo;
292292

293-
if (shoppingCart.getTaxation() == ShoppingCart.Taxation.UNDECIDED && signedCheckoutInfo.isRequiringTaxation()) {
293+
if (signedCheckoutInfo.isRequiringTaxation()) {
294294
Logger.d("Taxation requested");
295295
notifyStateChanged(State.REQUEST_TAXATION);
296296
return;

core/src/main/java/io/snabble/sdk/CheckoutApi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public boolean isRequiringTaxation() {
6363
JsonArray jsonArray = checkoutInfo.get("requiredInformation").getAsJsonArray();
6464
for (JsonElement element : jsonArray) {
6565
String id = element.getAsJsonObject().get("id").getAsString();
66-
if (id.equals("taxation")) {
66+
boolean hasValue = element.getAsJsonObject().has("value");
67+
if (id.equals("taxation") && !hasValue) {
6768
return true;
6869
}
6970
}

0 commit comments

Comments
 (0)