Skip to content

Commit 13e56c1

Browse files
committed
abort payment on allocation failure
1 parent 73c40bc commit 13e56c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ui/src/main/java/io/snabble/sdk/ui/checkout/PaymentStatusView.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,11 @@ open class PaymentStatusView @JvmOverloads constructor(
330330
itemView.setTitle(resources.getString(R.string.Snabble_PaymentStatus_Tobacco_title))
331331
itemView.state = PaymentStatusItemView.State.IN_PROGRESS
332332
} else if (it.state.isFailure) {
333+
if (it.state == FulfillmentState.ALLOCATION_FAILED
334+
|| it.state == FulfillmentState.ALLOCATION_TIMED_OUT) {
335+
handlePaymentAborted()
336+
}
337+
333338
itemView.setText(resources.getString(R.string.Snabble_PaymentStatus_Tobacco_error))
334339
itemView.setTitle(resources.getString(R.string.Snabble_PaymentStatus_Tobacco_title))
335340
itemView.state = PaymentStatusItemView.State.FAILED

0 commit comments

Comments
 (0)