File tree Expand file tree Collapse file tree 9 files changed +39
-9
lines changed
core/src/main/java/io/snabble/sdk/checkout
ui/src/main/java/io/snabble/sdk/ui Expand file tree Collapse file tree 9 files changed +39
-9
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file.
88### Fixed
99
1010## [ 0.72.0]
11+ ### Added
12+ * core: Add missing payment state transferred
13+ * if the checkout process receives the final state transferred it updates the checkout state with PAYMENT_TRANSFERRED.
1114### Changed
1215* core/ui : Update icons and description from paydirekt to GiroPay
1316 * The use of the following functions changed:
Original file line number Diff line number Diff line change @@ -417,7 +417,7 @@ class Checkout @JvmOverloads constructor(
417417 private fun hasAnyFulfillmentAllocationFailed (): Boolean {
418418 return checkoutProcess?.fulfillments?.any {
419419 it.state == FulfillmentState .ALLOCATION_FAILED
420- || it.state == FulfillmentState .ALLOCATION_TIMED_OUT
420+ || it.state == FulfillmentState .ALLOCATION_TIMED_OUT
421421 } ? : false
422422 }
423423
@@ -500,7 +500,7 @@ class Checkout @JvmOverloads constructor(
500500 return true
501501 }
502502
503- if (state.value == CheckoutState .VERIFYING_PAYMENT_METHOD ) {
503+ if (state.value == CheckoutState .VERIFYING_PAYMENT_METHOD && checkoutProcess.paymentState != CheckState . TRANSFERRED ) {
504504 when (checkoutProcess.routingTarget) {
505505 RoutingTarget .SUPERVISOR -> {
506506 notifyStateChanged(CheckoutState .WAIT_FOR_SUPERVISOR )
@@ -575,6 +575,10 @@ class Checkout @JvmOverloads constructor(
575575 }
576576 }
577577
578+ CheckState .TRANSFERRED -> {
579+ notifyStateChanged(CheckoutState .PAYMENT_TRANSFERRED )
580+ }
581+
578582 CheckState .FAILED -> {
579583 if (checkoutProcess.paymentResult?.failureCause != null
580584 && checkoutProcess.paymentResult.failureCause == " terminalAbort"
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ enum class CheckState {
120120 @SerializedName(" pending" ) PENDING ,
121121 @SerializedName(" processing" ) PROCESSING ,
122122 @SerializedName(" successful" ) SUCCESSFUL ,
123+ @SerializedName(" transferred" ) TRANSFERRED ,
123124 @SerializedName(" failed" ) FAILED
124125}
125126
Original file line number Diff line number Diff line change @@ -123,4 +123,10 @@ enum class CheckoutState {
123123 * SEPA mandate for PAYONE is needed
124124 */
125125 PAYONE_SEPA_MANDATE_REQUIRED ,
126+
127+ /* *
128+ * The process was transferred to a payment system. The outcome of the processing
129+ * will not be communicated
130+ */
131+ PAYMENT_TRANSFERRED ,
126132}
Original file line number Diff line number Diff line change @@ -372,6 +372,7 @@ open class CheckoutBar @JvmOverloads constructor(
372372 CheckoutState .WAIT_FOR_SUPERVISOR ,
373373 CheckoutState .WAIT_FOR_APPROVAL ,
374374 CheckoutState .PAYMENT_APPROVED ,
375+ CheckoutState .PAYMENT_TRANSFERRED ,
375376 CheckoutState .DENIED_BY_PAYMENT_PROVIDER ,
376377 CheckoutState .DENIED_BY_SUPERVISOR ,
377378 CheckoutState .PAYMENT_PROCESSING -> {
@@ -465,7 +466,6 @@ open class CheckoutBar @JvmOverloads constructor(
465466 .show()
466467 progressDialog.dismiss()
467468 }
468-
469469 else -> {
470470 Logger .d(" Unhandled event in CheckoutBar: $state " )
471471 }
Original file line number Diff line number Diff line change @@ -155,9 +155,6 @@ class CheckoutActivity : FragmentActivity() {
155155 PaymentMethod .QRCODE_POS -> {
156156 R .id.snabble_nav_checkout_pos
157157 }
158- PaymentMethod .QRCODE_OFFLINE -> {
159- R .id.snabble_nav_checkout_offline
160- }
161158 else -> {
162159 R .id.snabble_nav_payment_status
163160 }
@@ -190,6 +187,11 @@ class CheckoutActivity : FragmentActivity() {
190187 CheckoutState .PAYONE_SEPA_MANDATE_REQUIRED -> {
191188 R .id.snabble_nav_payment_payone_sepa_mandate
192189 }
190+
191+ CheckoutState .PAYMENT_TRANSFERRED -> {
192+ R .id.snabble_nav_checkout_offline
193+ }
194+
193195 else -> R .id.snabble_nav_payment_status
194196 }
195197 }
Original file line number Diff line number Diff line change @@ -27,5 +27,6 @@ val CheckoutState.isCheckoutState: Boolean
2727 CheckoutState .DENIED_BY_SUPERVISOR ,
2828 CheckoutState .PAYMENT_ABORT_FAILED ,
2929 CheckoutState .PAYMENT_PROCESSING_ERROR ,
30+ CheckoutState .PAYMENT_TRANSFERRED ,
3031 CheckoutState .PAYONE_SEPA_MANDATE_REQUIRED -> true
3132 }
Original file line number Diff line number Diff line change 11package io.snabble.sdk.ui.checkout
22
3+ import android.os.Bundle
4+ import androidx.activity.addCallback
5+ import io.snabble.sdk.Snabble
36import io.snabble.sdk.ui.BaseFragment
47import io.snabble.sdk.ui.R
58
6- open class CheckoutOfflineFragment : BaseFragment (R .layout.snabble_fragment_checkout_offline)
9+ open class CheckoutOfflineFragment : BaseFragment (R .layout.snabble_fragment_checkout_offline) {
10+
11+ override fun onCreate (savedInstanceState : Bundle ? ) {
12+ super .onCreate(savedInstanceState)
13+ activity?.onBackPressedDispatcher?.addCallback {
14+ Snabble .checkedInProject.value?.checkout?.reset()
15+ }
16+ }
17+ }
Original file line number Diff line number Diff line change @@ -162,7 +162,9 @@ public void showDidPayDialog() {
162162 dialog .getWindow ().setGravity (Gravity .BOTTOM );
163163
164164 dialog .findViewById (R .id .ok ).setOnClickListener (v -> {
165- project .getCheckout ().approveOfflineMethod ();
165+ if (project != null ) {
166+ project .getCheckout ().approveOfflineMethod ();
167+ }
166168 Telemetry .event (Telemetry .Event .CheckoutFinishByUser );
167169 dialog .dismiss ();
168170 });
@@ -285,4 +287,4 @@ public int getItemCount() {
285287 return codes .size ();
286288 }
287289 }
288- }
290+ }
You can’t perform that action at this time.
0 commit comments