Skip to content

Commit 119a64a

Browse files
committed
use receipt shopName and price
1 parent 7a966c7 commit 119a64a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

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

4+
## [0.12.0-beta4]
5+
6+
## Changes
7+
- Add support for new receipts api
8+
- OkHttpClient is now shared across projects
9+
410
## [0.12.0-beta3]
511

612
### Important Changes

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ private class ApiOrder {
2929
public String id;
3030
public String project;
3131
public String date;
32+
public String shopName;
33+
public int price;
3234
public Map<String, ApiLink> links;
3335
}
3436

@@ -79,14 +81,16 @@ public void success(ApiReceipt apiReceipt) {
7981

8082
Project project = projectsById.get(apiOrder.project);
8183
if (project != null) {
84+
PriceFormatter priceFormatter = new PriceFormatter(project);
85+
8286
try {
8387
ReceiptInfo receiptInfo = new ReceiptInfo(
8488
apiOrder.id,
8589
project,
8690
simpleDateFormat.parse(apiOrder.date),
8791
snabble.absoluteUrl(apiLink.href),
88-
"",
89-
"0,00 €");
92+
apiOrder.shopName,
93+
priceFormatter.format(apiOrder.price));
9094

9195
result.add(receiptInfo);
9296
} catch (ParseException e) {

0 commit comments

Comments
 (0)