@Test public void getOrderStatusNotAuthorizeTest() { assertEquals("Order status is not authorized", OrderStatus.PAYMENT_NOT_AUTHORIZED, wirecardPaymentService.getOrderStatus(authorizationRejected)); }
@Override public OrderStatus getOrderStatus(Payment response) { TransactionState transactionState; OrderStatus orderStatus = null; if (response != null) { transactionState = response.getTransactionState(); if (response.getTransactionType().equals(TransactionType.AUTHORIZATION)) { if (transactionState == TransactionState.SUCCESS) { orderStatus = OrderStatus.PAYMENT_AUTHORIZED; } else { orderStatus = OrderStatus.PAYMENT_NOT_AUTHORIZED; } } else if (response.getTransactionType().equals(TransactionType.CAPTURE_AUTHORIZATION) || response.getTransactionType().equals(TransactionType.DEBIT)) { if (transactionState == TransactionState.SUCCESS) { orderStatus = OrderStatus.PAYMENT_CAPTURED; } else { orderStatus = OrderStatus.PAYMENT_NOT_CAPTURED; } } } return orderStatus; }
DefaultWirecardPaymentService implements WirecardPaymentService { @Override public OrderStatus getOrderStatus(Payment response) { TransactionState transactionState; OrderStatus orderStatus = null; if (response != null) { transactionState = response.getTransactionState(); if (response.getTransactionType().equals(TransactionType.AUTHORIZATION)) { if (transactionState == TransactionState.SUCCESS) { orderStatus = OrderStatus.PAYMENT_AUTHORIZED; } else { orderStatus = OrderStatus.PAYMENT_NOT_AUTHORIZED; } } else if (response.getTransactionType().equals(TransactionType.CAPTURE_AUTHORIZATION) || response.getTransactionType().equals(TransactionType.DEBIT)) { if (transactionState == TransactionState.SUCCESS) { orderStatus = OrderStatus.PAYMENT_CAPTURED; } else { orderStatus = OrderStatus.PAYMENT_NOT_CAPTURED; } } } return orderStatus; } }
DefaultWirecardPaymentService implements WirecardPaymentService { @Override public OrderStatus getOrderStatus(Payment response) { TransactionState transactionState; OrderStatus orderStatus = null; if (response != null) { transactionState = response.getTransactionState(); if (response.getTransactionType().equals(TransactionType.AUTHORIZATION)) { if (transactionState == TransactionState.SUCCESS) { orderStatus = OrderStatus.PAYMENT_AUTHORIZED; } else { orderStatus = OrderStatus.PAYMENT_NOT_AUTHORIZED; } } else if (response.getTransactionType().equals(TransactionType.CAPTURE_AUTHORIZATION) || response.getTransactionType().equals(TransactionType.DEBIT)) { if (transactionState == TransactionState.SUCCESS) { orderStatus = OrderStatus.PAYMENT_CAPTURED; } else { orderStatus = OrderStatus.PAYMENT_NOT_CAPTURED; } } } return orderStatus; }  }
DefaultWirecardPaymentService implements WirecardPaymentService { @Override public OrderStatus getOrderStatus(Payment response) { TransactionState transactionState; OrderStatus orderStatus = null; if (response != null) { transactionState = response.getTransactionState(); if (response.getTransactionType().equals(TransactionType.AUTHORIZATION)) { if (transactionState == TransactionState.SUCCESS) { orderStatus = OrderStatus.PAYMENT_AUTHORIZED; } else { orderStatus = OrderStatus.PAYMENT_NOT_AUTHORIZED; } } else if (response.getTransactionType().equals(TransactionType.CAPTURE_AUTHORIZATION) || response.getTransactionType().equals(TransactionType.DEBIT)) { if (transactionState == TransactionState.SUCCESS) { orderStatus = OrderStatus.PAYMENT_CAPTURED; } else { orderStatus = OrderStatus.PAYMENT_NOT_CAPTURED; } } } return orderStatus; }  @Override ReturnStatus getReturnStatus(Payment response); void setReturnRequestStatus(final ReturnRequestModel returnRequest, final ReturnStatus status); @Override OrderStatus getOrderStatus(Payment response); @Override void storePares(AbstractOrderModel abstractOrderModel, String pares); @Override void storeToken(AbstractOrderModel abstractOrderModel, String token); @Override void storeMPIthreeDparameters(AbstractOrderModel abstractOrderModel,
                                         String cardholderAuthenticationStatus,
                                         String cardholderAuthenticationValue,
                                         String eci,
                                         String xid); @Required void setModelService(ModelService modelService); @Required void setWirecardTransactionService(WirecardTransactionService wirecardTransactionService); }
DefaultWirecardPaymentService implements WirecardPaymentService { @Override public OrderStatus getOrderStatus(Payment response) { TransactionState transactionState; OrderStatus orderStatus = null; if (response != null) { transactionState = response.getTransactionState(); if (response.getTransactionType().equals(TransactionType.AUTHORIZATION)) { if (transactionState == TransactionState.SUCCESS) { orderStatus = OrderStatus.PAYMENT_AUTHORIZED; } else { orderStatus = OrderStatus.PAYMENT_NOT_AUTHORIZED; } } else if (response.getTransactionType().equals(TransactionType.CAPTURE_AUTHORIZATION) || response.getTransactionType().equals(TransactionType.DEBIT)) { if (transactionState == TransactionState.SUCCESS) { orderStatus = OrderStatus.PAYMENT_CAPTURED; } else { orderStatus = OrderStatus.PAYMENT_NOT_CAPTURED; } } } return orderStatus; }  @Override ReturnStatus getReturnStatus(Payment response); void setReturnRequestStatus(final ReturnRequestModel returnRequest, final ReturnStatus status); @Override OrderStatus getOrderStatus(Payment response); @Override void storePares(AbstractOrderModel abstractOrderModel, String pares); @Override void storeToken(AbstractOrderModel abstractOrderModel, String token); @Override void storeMPIthreeDparameters(AbstractOrderModel abstractOrderModel,
                                         String cardholderAuthenticationStatus,
                                         String cardholderAuthenticationValue,
                                         String eci,
                                         String xid); @Required void setModelService(ModelService modelService); @Required void setWirecardTransactionService(WirecardTransactionService wirecardTransactionService);  }