File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
core/src/main/java/io/snabble/sdk Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -381,7 +381,6 @@ private void pay(final PaymentMethod paymentMethod, boolean force) {
381381
382382 if (paymentMethod .isOfflineMethod ()){
383383 notifyStateChanged (State .WAIT_FOR_APPROVAL );
384- return ;
385384 }
386385
387386 CheckoutProcessRequest checkoutProcessRequest = new CheckoutProcessRequest ();
@@ -403,6 +402,10 @@ private void pay(final PaymentMethod paymentMethod, boolean force) {
403402 call .enqueue (new Callback () {
404403 @ Override
405404 public void onResponse (Call call , Response response ) throws IOException {
405+ if (paymentMethod .isOfflineMethod ()){
406+ return ;
407+ }
408+
406409 if (response .isSuccessful ()) {
407410 ResponseBody body = response .body ();
408411 if (body == null ) {
@@ -435,14 +438,20 @@ public void onResponse(Call call, Response response) throws IOException {
435438
436439 @ Override
437440 public void onFailure (Call call , IOException e ) {
441+ if (paymentMethod .isOfflineMethod ()){
442+ return ;
443+ }
444+
438445 if (!call .isCanceled ()) {
439446 Logger .e ("Connection error while creating checkout process" );
440447 notifyStateChanged (State .CONNECTION_ERROR );
441448 }
442449 }
443450 });
444451
445- notifyStateChanged (State .VERIFYING_PAYMENT_METHOD );
452+ if (!paymentMethod .isOfflineMethod ()) {
453+ notifyStateChanged (State .VERIFYING_PAYMENT_METHOD );
454+ }
446455 }
447456 }
448457 }
You can’t perform that action at this time.
0 commit comments