@Test public void getPaymentTransactionTest() { PaymentTransactionModel transactionModel = defaultWirecardTransactionService.getPaymentTransaction(order); assertEquals("Payment transaction", transaction1, transactionModel); }
@Override public PaymentTransactionModel getPaymentTransaction(AbstractOrderModel abstractOrder) { final List<PaymentTransactionModel> listTransactions = abstractOrder.getPaymentTransactions(); String cartPaymentModeCode = abstractOrder.getPaymentMode().getCode(); return listTransactions.stream() .filter(transaction -> cartPaymentModeCode.equalsIgnoreCase(transaction.getPaymentProvider())) .findFirst() .orElse(null); }
DefaultWirecardTransactionService implements WirecardTransactionService { @Override public PaymentTransactionModel getPaymentTransaction(AbstractOrderModel abstractOrder) { final List<PaymentTransactionModel> listTransactions = abstractOrder.getPaymentTransactions(); String cartPaymentModeCode = abstractOrder.getPaymentMode().getCode(); return listTransactions.stream() .filter(transaction -> cartPaymentModeCode.equalsIgnoreCase(transaction.getPaymentProvider())) .findFirst() .orElse(null); } }
DefaultWirecardTransactionService implements WirecardTransactionService { @Override public PaymentTransactionModel getPaymentTransaction(AbstractOrderModel abstractOrder) { final List<PaymentTransactionModel> listTransactions = abstractOrder.getPaymentTransactions(); String cartPaymentModeCode = abstractOrder.getPaymentMode().getCode(); return listTransactions.stream() .filter(transaction -> cartPaymentModeCode.equalsIgnoreCase(transaction.getPaymentProvider())) .findFirst() .orElse(null); }  }
DefaultWirecardTransactionService implements WirecardTransactionService { @Override public PaymentTransactionModel getPaymentTransaction(AbstractOrderModel abstractOrder) { final List<PaymentTransactionModel> listTransactions = abstractOrder.getPaymentTransactions(); String cartPaymentModeCode = abstractOrder.getPaymentMode().getCode(); return listTransactions.stream() .filter(transaction -> cartPaymentModeCode.equalsIgnoreCase(transaction.getPaymentProvider())) .findFirst() .orElse(null); }  @Override PaymentTransactionModel createTransaction(WirecardTransactionData wirecardTransactionData); void calculateCart(final AbstractOrderModel abstractOrderModel); @Override PaymentTransactionEntryModel logTransactionData(WirecardTransactionData wirecardTransactionData); @Override PaymentTransactionModel lookForCompatibleTransactions(final AbstractOrderModel abstractOrder,
                                                                 final String checkoutPaymentType); @Override boolean lookForAcceptedTransactions(AbstractOrderModel abstractOrderModel, PaymentTransactionType paymentTransactionType); @Override String getParentTransactionIdToOperate(AbstractOrderModel abstractOrderModel, PaymentTransactionType paymentTransactionType); @Override PaymentTransactionEntryModel getNewestAcceptedTransactionEntry(PaymentTransactionModel paymentTransactionModel,
                                                                          PaymentTransactionType paymentTransactionType); @Override PaymentTransactionModel getPaymentTransaction(AbstractOrderModel abstractOrder); @Override TransactionStatus getTransactionStatus(Payment response); @Required void setModelService(final ModelService modelService); @Required void setWirecardPaymentService(WirecardPaymentService wirecardPaymentService); @Required void setCommerceCheckoutService(CommerceCheckoutService commerceCheckoutService); @Required void setPaymentConverter(PaymentConverter paymentConverter); @Required void setMediaService(DefaultMediaService mediaService); }
DefaultWirecardTransactionService implements WirecardTransactionService { @Override public PaymentTransactionModel getPaymentTransaction(AbstractOrderModel abstractOrder) { final List<PaymentTransactionModel> listTransactions = abstractOrder.getPaymentTransactions(); String cartPaymentModeCode = abstractOrder.getPaymentMode().getCode(); return listTransactions.stream() .filter(transaction -> cartPaymentModeCode.equalsIgnoreCase(transaction.getPaymentProvider())) .findFirst() .orElse(null); }  @Override PaymentTransactionModel createTransaction(WirecardTransactionData wirecardTransactionData); void calculateCart(final AbstractOrderModel abstractOrderModel); @Override PaymentTransactionEntryModel logTransactionData(WirecardTransactionData wirecardTransactionData); @Override PaymentTransactionModel lookForCompatibleTransactions(final AbstractOrderModel abstractOrder,
                                                                 final String checkoutPaymentType); @Override boolean lookForAcceptedTransactions(AbstractOrderModel abstractOrderModel, PaymentTransactionType paymentTransactionType); @Override String getParentTransactionIdToOperate(AbstractOrderModel abstractOrderModel, PaymentTransactionType paymentTransactionType); @Override PaymentTransactionEntryModel getNewestAcceptedTransactionEntry(PaymentTransactionModel paymentTransactionModel,
                                                                          PaymentTransactionType paymentTransactionType); @Override PaymentTransactionModel getPaymentTransaction(AbstractOrderModel abstractOrder); @Override TransactionStatus getTransactionStatus(Payment response); @Required void setModelService(final ModelService modelService); @Required void setWirecardPaymentService(WirecardPaymentService wirecardPaymentService); @Required void setCommerceCheckoutService(CommerceCheckoutService commerceCheckoutService); @Required void setPaymentConverter(PaymentConverter paymentConverter); @Required void setMediaService(DefaultMediaService mediaService);  }