Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private fun parseTotal(json: JSONObject): BigDecimal? {

private fun parsePendingTotal(json: JSONObject): BigDecimal? {
try {
if (!json.has("payments") || !json.has("refunds")) { return null }
var total = BigDecimal(json.getString("total"))
if (json.getString("status") == "c") {
total = BigDecimal.ZERO
Expand Down Expand Up @@ -89,6 +90,7 @@ private fun parsePendingTotal(json: JSONObject): BigDecimal? {

private fun parsePayments(json: JSONObject): JSONArray {
try {
if (!json.has("payments")) { return JSONArray() }
return json.getJSONArray("payments")
} catch (e: JSONException) {
e.printStackTrace()
Expand All @@ -98,6 +100,7 @@ private fun parsePayments(json: JSONObject): JSONArray {

private fun parseRefunds(json: JSONObject): JSONArray {
try {
if (!json.has("refunds")) { return JSONArray() }
return json.getJSONArray("refunds")
} catch (e: JSONException) {
e.printStackTrace()
Expand Down
Loading