Skip to content

Commit 42f8c73

Browse files
committed
fix age verification aborts
1 parent 78c8c7a commit 42f8c73

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.39.3]
5+
6+
### Fixed
7+
- Fixed checkouts not aborting when age verification check is not passing
8+
49
## [0.39.2]
510

611
### Fixed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ allprojects {
3131
}
3232

3333
project.ext {
34-
sdkVersion='0.39.2'
34+
sdkVersion='0.39.3'
3535
versionCode=1
3636

3737
compileSdkVersion=30

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,10 @@ private boolean runChecks(CheckoutApi.CheckoutProcessResponse checkoutProcessRes
433433
continue;
434434
}
435435

436+
if (check.state == CheckoutApi.State.FAILED) {
437+
return false;
438+
}
439+
436440
if (check.performedBy == CheckoutApi.Performer.APP) {
437441
if (check.type == CheckoutApi.CheckType.MIN_AGE) {
438442
Logger.d("Verifying age...");
@@ -604,6 +608,12 @@ private boolean handleProcessResponse() {
604608
return true;
605609
}
606610

611+
if (!runChecks(checkoutProcess)) {
612+
Logger.d("Payment denied by supervisor");
613+
shoppingCart.generateNewUUID();
614+
notifyStateChanged(Checkout.State.DENIED_BY_SUPERVISOR);
615+
}
616+
607617
if (checkoutProcess.supervisorApproval != null && !checkoutProcess.supervisorApproval) {
608618
Logger.d("Payment denied by supervisor");
609619
shoppingCart.generateNewUUID();

0 commit comments

Comments
 (0)