Subversion Repositories SmartDukaan

Rev

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

Rev 8966 Rev 8967
Line 459... Line 459...
459
					t_order.setOrderType(OrderType.B2C);
459
					t_order.setOrderType(OrderType.B2C);
460
					total_price = total_price + unitSellingPrice;
460
					total_price = total_price + unitSellingPrice;
461
					orderlist.add(t_order);
461
					orderlist.add(t_order);
462
				}
462
				}
463
				txn.setOrders(orderlist);
463
				txn.setOrders(orderlist);
464
				String transactionId;
-
 
465
				try {
464
				try {
466
					transactionId =  String.valueOf(transaction_client.createTransaction(txn));
465
					transactionId =  String.valueOf(transaction_client.createTransaction(txn));
467
					logger.info("Transaction id is : " + transactionId);
466
					logger.info("Transaction id is : " + transactionId);
468
				} catch (TransactionServiceException e) {
467
				} catch (TransactionServiceException e) {
469
					logger.error(orderId+" "+subOrderId + " Could not create transaction " , e);
468
					logger.error(orderId+" "+subOrderId + " Could not create transaction " , e);
Line 705... Line 704...
705
		if (fw != null)fw.close();
704
		if (fw != null)fw.close();
706
	}		
705
	}		
707
 
706
 
708
	public static void createPayment(User user, String subOrderId, double amount) throws PaymentException, TException {
707
	public static void createPayment(User user, String subOrderId, double amount) throws PaymentException, TException {
709
		in.shop2020.payments.PaymentService.Client client = new PaymentClient().getClient();
708
		in.shop2020.payments.PaymentService.Client client = new PaymentClient().getClient();
710
		logger.info("Create payment for user id " + user.getUserId() + " Gateway id " + FLIPKART_GATEWAY_ID);
709
		logger.info("Creating payment for user id " + user.getUserId() + " Gateway id " + FLIPKART_GATEWAY_ID);
711
		logger.info("Long value of transaction id : " + Long.valueOf(transactionId));
710
		logger.info("Long value of transaction id : " + Long.valueOf(transactionId));
712
		long paymentId = client.createPayment(user.getUserId(), amount, FLIPKART_GATEWAY_ID, Long.valueOf(transactionId), false);
711
		long paymentId = client.createPayment(user.getUserId(), amount, FLIPKART_GATEWAY_ID, Long.valueOf(transactionId), false);
713
		logger.info("transaction id : " + Long.valueOf(transactionId) + " Payment id : " + paymentId);
712
		logger.info("transaction id : " + Long.valueOf(transactionId) + " Payment id : " + paymentId);
714
		client.updatePaymentDetails(paymentId, null, null, null, null, null, null, subOrderId, null, PaymentStatus.AUTHORIZED, null, null);
713
		client.updatePaymentDetails(paymentId, null, null, null, null, null, null, subOrderId, null, PaymentStatus.AUTHORIZED, null, null);
715
	}   
714
	}