| Line 335... |
Line 335... |
| 335 |
|
335 |
|
| 336 |
|
336 |
|
| 337 |
@Override
|
337 |
@Override
|
| 338 |
public long createRefund(long orderId, long merchantTxnId, double amount) throws PaymentException, TException{
|
338 |
public long createRefund(long orderId, long merchantTxnId, double amount) throws PaymentException, TException{
|
| 339 |
logger.info("Attempting to create a refund for order: " + orderId);
|
339 |
logger.info("Attempting to create a refund for order: " + orderId);
|
| 340 |
if(!refundPayment(merchantTxnId, amount, false)){
|
340 |
// if(!refundPayment(merchantTxnId, amount, false)){
|
| 341 |
logger.warn("Not able to refund corresponding to the merchant txn " + merchantTxnId);
|
341 |
// logger.warn("Not able to refund corresponding to the merchant txn " + merchantTxnId);
|
| 342 |
}
|
342 |
// }
|
| 343 |
List<in.shop2020.payment.domain.Payment> payments = paymentHandler.getPaymentForTxn(merchantTxnId);
|
343 |
List<in.shop2020.payment.domain.Payment> payments = paymentHandler.getPaymentForTxn(merchantTxnId);
|
| 344 |
if(payments ==null || payments.isEmpty())
|
344 |
if(payments ==null || payments.isEmpty())
|
| 345 |
throw new PaymentException(104, "No payments found corresponding to the merchant txn " + merchantTxnId);
|
345 |
throw new PaymentException(104, "No payments found corresponding to the merchant txn " + merchantTxnId);
|
| 346 |
|
346 |
|
| 347 |
in.shop2020.payment.domain.Payment payment = payments.get(0);
|
347 |
in.shop2020.payment.domain.Payment payment = payments.get(0);
|