Subversion Repositories SmartDukaan

Rev

Rev 10968 | Rev 13352 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10968 Rev 13286
Line 61... Line 61...
61
    
61
    
62
	public static final long PAYMENT_NOT_CREATED = -1;
62
	public static final long PAYMENT_NOT_CREATED = -1;
63
	
63
	
64
	private static final long HDFC_GATEWAY_ID = 1;
64
	private static final long HDFC_GATEWAY_ID = 1;
65
	private static final long EBS_GATEWAY_ID = 2;
65
	private static final long EBS_GATEWAY_ID = 2;
-
 
66
	private static final long PAYU_GATEWAY_ID = 19;
66
	private static final long EBAY_GATEWAY_ID = 16;
67
	private static final long EBAY_GATEWAY_ID = 16;
67
	private static final long SNAPDEAL_GATEWAY_ID = 18;
68
	private static final long SNAPDEAL_GATEWAY_ID = 18;
68
	private static final List<Long> HDFC_EMI_GATEWAY_IDS = Arrays.asList(5L,10L,11L,12L,14L);
69
	private static final List<Long> HDFC_EMI_GATEWAY_IDS = Arrays.asList(5L,10L,11L,12L,14L);
69
	
70
	
70
	ApplicationContext context = new ClassPathXmlApplicationContext("context.xml");
71
	ApplicationContext context = new ClassPathXmlApplicationContext("context.xml");
Line 420... Line 421...
420
        } else if (HDFC_EMI_GATEWAY_IDS.contains(gatewayId)){
421
        } else if (HDFC_EMI_GATEWAY_IDS.contains(gatewayId)){
421
            //Capture and update the HDFC EMI payment
422
            //Capture and update the HDFC EMI payment
422
            return captureAndUpdateHdfcEmiPayment(payment);
423
            return captureAndUpdateHdfcEmiPayment(payment);
423
        } else if (gatewayId == EBAY_GATEWAY_ID || gatewayId == SNAPDEAL_GATEWAY_ID) {
424
        } else if (gatewayId == EBAY_GATEWAY_ID || gatewayId == SNAPDEAL_GATEWAY_ID) {
424
        	return true;
425
        	return true;
-
 
426
        } else if (gatewayId == PAYU_GATEWAY_ID) {
-
 
427
        	return catpureAndUpdatePayuPayment(payment);
425
        }
428
        }
426
        
429
        
427
        logger.error("We have an authorized payment from unknown gateway: " + gatewayId);
430
        logger.error("We have an authorized payment from unknown gateway: " + gatewayId);
428
        return false;
431
        return false;
429
    }
432
    }
430
    
433
    
-
 
434
    private boolean catpureAndUpdatePayuPayment(
-
 
435
			in.shop2020.payment.domain.Payment payment) {
-
 
436
		return false;
-
 
437
	}
-
 
438
 
431
    @Override
439
	@Override
432
    public boolean partiallyCapturePayment(long merchantTxnId, double amount, String xferBy, String xferTxnId, long xferDate) throws PaymentException, TException {
440
    public boolean partiallyCapturePayment(long merchantTxnId, double amount, String xferBy, String xferTxnId, long xferDate) throws PaymentException, TException {
433
        logger.info("Attempting to partially capture payment corresponding to our transaction " + merchantTxnId);
441
        logger.info("Attempting to partially capture payment corresponding to our transaction " + merchantTxnId);
434
        List<in.shop2020.payment.domain.Payment> payments = paymentHandler.getPaymentForTxn(merchantTxnId);
442
        List<in.shop2020.payment.domain.Payment> payments = paymentHandler.getPaymentForTxn(merchantTxnId);
435
        if(payments ==null || payments.isEmpty())
443
        if(payments ==null || payments.isEmpty())
436
            throw new PaymentException(104, "No payments found corresponding to the merchant txn " + merchantTxnId);
444
            throw new PaymentException(104, "No payments found corresponding to the merchant txn " + merchantTxnId);