Skip to content

Commit f49fa5b

Browse files
author
WooSignal
committed
v1.1.2 - Update FreeShipping model for minimum spend and endpoint for app status
1 parent 7834c3a commit f49fa5b

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [1.1.2] - 2020-07-22
2+
3+
* Update FreeShipping model for minimum spend
4+
* New endpoint for app status
5+
16
## [1.1.1] - 2020-07-03
27

38
* Fix MetaData for orders

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ In your flutter project add the dependency:
1515
``` dart
1616
dependencies:
1717
...
18-
woosignal: ^1.1.1
18+
woosignal: ^1.1.2
1919
```
2020

2121
### Usage example #

lib/models/response/shipping_method.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,18 @@ class FreeShipping {
115115
String title;
116116
String methodId;
117117
String cost;
118+
String minimumOrderAmount;
118119

119-
FreeShipping({this.id, this.title, this.methodId, this.cost});
120+
FreeShipping({this.id, this.title, this.methodId, this.cost, this.minimumOrderAmount});
120121

121122
FreeShipping.fromJson(Map<String, dynamic> json) {
122123
id = json['id'];
123124
title = json['title'];
124125
methodId = json['method_id'];
125126
cost = json['cost'];
127+
if (json['cost'] != null && json['cost'] == 'min_amount') {
128+
minimumOrderAmount = json['kind']['min_amount'];
129+
}
126130
}
127131

128132
Map<String, dynamic> toJson() {
@@ -131,6 +135,9 @@ class FreeShipping {
131135
data['title'] = this.title;
132136
data['method_id'] = this.methodId;
133137
data['cost'] = this.cost;
138+
if (minimumOrderAmount != null) {
139+
data['minimum_order_amount'] = this.minimumOrderAmount;
140+
}
134141
return data;
135142
}
136143
}

lib/woosignal.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,4 +681,16 @@ class WooSignal {
681681
_printLog(payloadRsp.toString());
682682
return payloadRsp;
683683
}
684+
685+
Future<dynamic> checkAppStatus() async {
686+
Map<String, dynamic> payload = {};
687+
payload = _standardPayload("get", [], "ws/app-status");
688+
689+
dynamic payloadRsp;
690+
await _apiProvider.post("/ws/app-status", payload).then((json) {
691+
payloadRsp = json;
692+
});
693+
_printLog(payloadRsp.toString());
694+
return payloadRsp;
695+
}
684696
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: woosignal
22
description: WooCommerce REST API for dart, connect a WooCommerce store and start developing with our interface for their API endpoints.
3-
version: 1.1.1
3+
version: 1.1.2
44
homepage: https://woosignal.com
55
repository: https://github.com/woosignal/flutter-woocommerce-api
66
issue_tracker: https://github.com/woosignal/flutter-woocommerce-api/issues

0 commit comments

Comments
 (0)