Skip to content

Commit 494901d

Browse files
committed
choose payment method based on available payment methods
1 parent 259c202 commit 494901d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
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.14.11]
5+
6+
### Changed
7+
- Choose offline payment method based on available payment methods in metadata
8+
49
## [0.14.10]
510

611
### Changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ public boolean isAvailable() {
182182
}
183183

184184
private PaymentMethod getFallbackPaymentMethod() {
185-
// TODO remove project id hack when metadata contains explicit fallback method
186-
if(project.getEncodedCodesOptions() != null
187-
&& !project.getId().contains("ikea")
188-
&& !project.getId().contains("globus")) {
189-
return PaymentMethod.ENCODED_CODES;
185+
PaymentMethod[] paymentMethods = project.getAvailablePaymentMethods();
186+
for (PaymentMethod pm : paymentMethods) {
187+
if (pm.isOfflineMethod()) {
188+
return pm;
189+
}
190190
}
191191

192192
return null;

0 commit comments

Comments
 (0)