Skip to content

Commit 3a6d733

Browse files
committed
Merge branch 'master' into 0.52.x
# Conflicts: # CHANGELOG.md # build.gradle
2 parents 25994cf + 49f3745 commit 3a6d733

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ All notable changes to this project will be documented in this file.
1212
- Added optional CheckInManager and CheckInLocationManager which can used for geofencing store locations
1313
- Added support for PayOne credit card tokenization and transactions
1414

15+
## [0.51.6]
16+
17+
### Fixed
18+
- Only fallback to offline payment method if an offline capable payment method is selected
19+
1520
## [0.51.5]
1621

1722
### Fixed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ private PaymentMethod getFallbackPaymentMethod() {
255255
}
256256

257257
public void checkout() {
258-
checkout(-1);
258+
checkout(-1, false);
259259
}
260260

261261
/**
@@ -268,7 +268,7 @@ public void checkout() {
268268
* You then need to sometime after call @link Checkout#pay(PaymentMethod)}
269269
* to pay with that payment method.
270270
*/
271-
public void checkout(long timeout) {
271+
public void checkout(long timeout, boolean allowFallbackAfterTimeout) {
272272
checkoutProcess = null;
273273
rawCheckoutProcess = null;
274274
signedCheckoutInfo = null;
@@ -349,7 +349,7 @@ public void unknownError() {
349349
@Override
350350
public void connectionError() {
351351
PaymentMethod fallback = getFallbackPaymentMethod();
352-
if(fallback != null) {
352+
if(fallback != null && allowFallbackAfterTimeout) {
353353
paymentMethod = fallback;
354354
priceToPay = shoppingCart.getTotalPrice();
355355
checkoutRetryer.add(backendCart);

ui/src/main/java/io/snabble/sdk/ui/cart/CheckoutBar.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ open class CheckoutBar @JvmOverloads constructor(
217217
object : OneShotClickListener() {
218218
override fun click() {
219219
if (entry.paymentMethod.isOfflineMethod) {
220-
project.checkout.checkout(3000)
220+
project.checkout.checkout(3000, true)
221221
} else {
222222
project.checkout.checkout()
223223
}

0 commit comments

Comments
 (0)