File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
core/src/main/java/io/snabble/sdk
ui/src/main/java/io/snabble/sdk/ui/checkout Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,18 @@ All notable changes to this project will be documented in this file.
33
44## [ 0.13.14]
55
6+ ### Added
7+ - Added Config parameter maxShoppingCartAge
8+
9+ ### Removed
10+ - Removed config parameter enableReceiptAutoDownload as it is no longer used
611
712### Changes
813- Add keepScreenOn flag on checkout view
914
1015### Fixed
1116- Null pointer in very rare circumstances using ZXing Barcode Detector
17+ - CheckoutSuccessful Telemetry Event was not firing
1218
1319## [ 0.13.13]
1420
Original file line number Diff line number Diff line change 2020
2121public class ShoppingCart {
2222 public static final int MAX_QUANTITY = 99999 ;
23- public static final long TIMEOUT = TimeUnit .HOURS .toMillis (4 );
2423
2524 private String id ;
2625 private long lastModificationTime ;
@@ -224,7 +223,8 @@ public void updatePrices(boolean debounce) {
224223 public void checkForTimeout () {
225224 long currentTime = System .currentTimeMillis ();
226225
227- if (lastModificationTime + TIMEOUT < currentTime ) {
226+ long timeout = Snabble .getInstance ().getConfig ().maxShoppingCartAge ;
227+ if (lastModificationTime + timeout < currentTime ) {
228228 invalidate ();
229229 }
230230 }
Original file line number Diff line number Diff line change @@ -532,10 +532,13 @@ public static class Config {
532532 public long maxProductDatabaseAge = TimeUnit .HOURS .toMillis (1 );
533533
534534 /**
535- * If set to true, downloads receipts automatically and stores them in the projects
536- * internal storage folder.
535+ * The time that the shopping cart is allowed to be alive after the last modification.
536+ *
537+ * The time is specified in milliseconds.
538+ *
539+ * The default value is 4 hours.
537540 */
538- public boolean enableReceiptAutoDownload ;
541+ public long maxShoppingCartAge = TimeUnit . HOURS . toMillis ( 4 ) ;
539542
540543 /** If set to true, disables certificate pinning **/
541544 public boolean disableCertificatePinning ;
Original file line number Diff line number Diff line change 1919import io .snabble .sdk .encodedcodes .EncodedCodesOptions ;
2020import io .snabble .sdk .ui .R ;
2121import io .snabble .sdk .ui .SnabbleUI ;
22+ import io .snabble .sdk .ui .telemetry .Telemetry ;
2223import io .snabble .sdk .ui .utils .DelayedProgressDialog ;
2324import io .snabble .sdk .ui .utils .UIUtils ;
2425import io .snabble .sdk .utils .SimpleActivityLifecycleCallbacks ;
@@ -91,6 +92,7 @@ public void onStateChanged(Checkout.State state) {
9192 case PAYMENT_APPROVED :
9293 if (!checkout .getSelectedPaymentMethod ().isOfflineMethod ()) {
9394 displayView (new CheckoutDoneView (getContext ()));
95+ Telemetry .event (Telemetry .Event .CheckoutSuccessful );
9496 }
9597 break ;
9698 case PAYMENT_ABORTED :
You can’t perform that action at this time.
0 commit comments