Skip to content

Commit

Permalink
Handle the case where the order can be an empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
0nko committed Jan 23, 2020
1 parent f3b4d1b commit 73fb317
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ val GATEWAYS_RESPONSE = listOf(
"cod",
"Cash on Delivery",
"Pay cash",
0,
"",
false,
"COD: Method title",
"COD: Method description",
Expand All @@ -17,7 +17,7 @@ val GATEWAYS_RESPONSE = listOf(
"stripe",
"Credit card",
"Pay with CC",
1,
"1",
true,
"Stripe: Method title",
"Stripe: Method description",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class GatewayMapper
response.gatewayId,
response.title ?: "",
response.description ?: "",
response.order ?: 0,
response.order?.toIntOrNull() ?: 0,
response.enabled ?: false,
response.methodTitle ?: "",
response.methodDescription ?: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ constructor(
@SerializedName("id") val gatewayId: String,
@SerializedName("title") val title: String?,
@SerializedName("description") val description: String?,
@SerializedName("order") val order: Int?,
@SerializedName("order") val order: String?,
@SerializedName("enabled") val enabled: Boolean?,
@SerializedName("method_title") val methodTitle: String?,
@SerializedName("method_description") val methodDescription: String?,
Expand Down

0 comments on commit 73fb317

Please sign in to comment.