@Test public void shouldNotMarkPaymentTransactionEntriesAsNonPendingWhenTheRefundReferenceDoesNotMatches() { when(orderNotificationMessageMock.getPaymentReply().getRefundReference()).thenReturn(REFUND_REFERENCE); when(paymentTransactionEntryModelMock.getCode()).thenReturn(REFUND_REFERENCE + "_INVALID"); when(paymentTransactionModelMock.getEntries()).thenReturn(singletonList(paymentTransactionEntryModelMock)); testObj.processNotificationMessage(paymentTransactionModelMock, orderNotificationMessageMock); verify(paymentTransactionEntryModelMock, never()).setPending(Boolean.FALSE); verify(modelServiceMock, never()).save(paymentTransactionEntryModelMock); }
@Override public void processNotificationMessage(final PaymentTransactionModel paymentTransactionModel, final OrderNotificationMessage orderNotificationMessage) { transactionTemplate.execute(transactionStatus -> { setMatchingEntryAsNotPending(paymentTransactionModel, orderNotificationMessage); return null; }); }
DefaultRefundedOrderNotificationProcessorStrategy implements OrderNotificationProcessorStrategy { @Override public void processNotificationMessage(final PaymentTransactionModel paymentTransactionModel, final OrderNotificationMessage orderNotificationMessage) { transactionTemplate.execute(transactionStatus -> { setMatchingEntryAsNotPending(paymentTransactionModel, orderNotificationMessage); return null; }); } }
DefaultRefundedOrderNotificationProcessorStrategy implements OrderNotificationProcessorStrategy { @Override public void processNotificationMessage(final PaymentTransactionModel paymentTransactionModel, final OrderNotificationMessage orderNotificationMessage) { transactionTemplate.execute(transactionStatus -> { setMatchingEntryAsNotPending(paymentTransactionModel, orderNotificationMessage); return null; }); }  }
DefaultRefundedOrderNotificationProcessorStrategy implements OrderNotificationProcessorStrategy { @Override public void processNotificationMessage(final PaymentTransactionModel paymentTransactionModel, final OrderNotificationMessage orderNotificationMessage) { transactionTemplate.execute(transactionStatus -> { setMatchingEntryAsNotPending(paymentTransactionModel, orderNotificationMessage); return null; }); }  @Override void processNotificationMessage(final PaymentTransactionModel paymentTransactionModel, final OrderNotificationMessage orderNotificationMessage); @Required void setModelService(ModelService modelService); @Required void setTransactionTemplate(TransactionOperations transactionTemplate); }
DefaultRefundedOrderNotificationProcessorStrategy implements OrderNotificationProcessorStrategy { @Override public void processNotificationMessage(final PaymentTransactionModel paymentTransactionModel, final OrderNotificationMessage orderNotificationMessage) { transactionTemplate.execute(transactionStatus -> { setMatchingEntryAsNotPending(paymentTransactionModel, orderNotificationMessage); return null; }); }  @Override void processNotificationMessage(final PaymentTransactionModel paymentTransactionModel, final OrderNotificationMessage orderNotificationMessage); @Required void setModelService(ModelService modelService); @Required void setTransactionTemplate(TransactionOperations transactionTemplate);  }