Subversion Repositories SmartDukaan

Rev

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

Rev 9088 Rev 9089
Line 492... Line 492...
492
				sb.append(orderId+" "+subOrderId + " Transaction Service Exception could not create transaction" +"\n");
492
				sb.append(orderId+" "+subOrderId + " Transaction Service Exception could not create transaction" +"\n");
493
				logger.info(orderId+" "+subOrderId + " Transaction Service Exception could not create transaction" +"\n" , e);
493
				logger.info(orderId+" "+subOrderId + " Transaction Service Exception could not create transaction" +"\n" , e);
494
				continue;
494
				continue;
495
			}
495
			}
496
			try{
496
			try{
497
				logger.info("Creating payment for suborder id " + subOrderId);
497
				logger.info("Creating payment for suborder id " + subOrderId +" ");
498
				createPayment(user,subOrderId,unitSellingPrice);
498
				createPayment(user,subOrderId,unitSellingPrice);
499
			}
499
			}
500
			catch (NumberFormatException e) {
500
			catch (NumberFormatException e) {
501
				logger.error("Could not create payment",e);
501
				logger.error("Could not create payment",e);
502
				sb.append(orderId+" "+subOrderId + " Could not create payment");
502
				sb.append(orderId+" "+subOrderId + " Could not create payment");
Line 515... Line 515...
515
			}
515
			}
516
			Transaction transaction = null;
516
			Transaction transaction = null;
517
			try {
517
			try {
518
				transaction = new TransactionClient().getClient().getTransaction(Long.parseLong(transactionId));
518
				transaction = new TransactionClient().getClient().getTransaction(Long.parseLong(transactionId));
519
			} catch (NumberFormatException e) {
519
			} catch (NumberFormatException e) {
520
				logger.error("Problem parsing transaction id " + transactionId);
520
				logger.error("Problem parsing transaction id " + transactionId +" ", e);
521
				sb.append(orderId+" "+subOrderId  + " Problem parsing transaction id "+ transactionId +"\n");
521
				sb.append(orderId+" "+subOrderId  + " Problem parsing transaction id "+ transactionId +"\n");
522
				e.printStackTrace();
522
				e.printStackTrace();
523
				continue;
523
				continue;
524
			} catch (TransactionServiceException e) {
524
			} catch (TransactionServiceException e) {
525
				logger.error("Problem getting transaction from service transaction id " + transactionId);
525
				logger.error("Problem getting transaction from service transaction id " + transactionId +" ",e);
526
				sb.append(orderId+" "+subOrderId  + " Problem getting transaction id "+ transactionId +"\n");
526
				sb.append(orderId+" "+subOrderId  + " Problem getting transaction id "+ transactionId +"\n");
527
				e.printStackTrace();
527
				e.printStackTrace();
528
				continue;
528
				continue;
529
			} catch (TException e) {
529
			} catch (TException e) {
530
				logger.error("Problem with transaction service while getting transaction id " + transactionId);
530
				logger.error("Problem with transaction service while getting transaction id " + transactionId + " " , e);
531
				sb.append(orderId+" "+subOrderId + " Problem with transaction service while getting transaction id "+ transactionId +"\n");
531
				sb.append(orderId+" "+subOrderId + " Problem with transaction service while getting transaction id "+ transactionId +"\n");
532
				e.printStackTrace();
532
				e.printStackTrace();
533
				continue;
533
				continue;
534
			}
534
			}
535
			List<in.shop2020.model.v1.order.Order> flipkartorders = transaction.getOrders();
535
			List<in.shop2020.model.v1.order.Order> flipkartorders = transaction.getOrders();
Line 553... Line 553...
553
					try {
553
					try {
554
						new TransactionClient().getClient().createFlipkartOrder(flipkartOrder);
554
						new TransactionClient().getClient().createFlipkartOrder(flipkartOrder);
555
						new TransactionClient().getClient().setOrderAttributes(flipkartOrder.getOrderId(),attributeList);
555
						new TransactionClient().getClient().setOrderAttributes(flipkartOrder.getOrderId(),attributeList);
556
						orders_processed++;
556
						orders_processed++;
557
					} catch (TException e) {
557
					} catch (TException e) {
558
						logger.error("Could not create flipkart order");
558
						logger.error("Could not create flipkart order ",e);
559
						sb.append(orderId+" "+subOrderId + " Could not create flipkart order"+"\n");
559
						sb.append(orderId+" "+subOrderId + " Could not create flipkart order"+"\n");
560
						continue;
560
						continue;
561
					}
561
					}
562
 
562
 
563
				} catch (InventoryServiceException e1) {
563
				} catch (InventoryServiceException e1) {
564
					logger.error("Problem while reserving item in inventory service" + flipkartorder.getId());
564
					logger.error("Problem while reserving item in inventory service" + flipkartorder.getId() + " ",e1);
565
					sb.append(orderId+" "+subOrderId + " Could not reserve inventory for sku "+ sku +"\n");
565
					sb.append(orderId+" "+subOrderId + " Could not reserve inventory for sku "+ sku +"\n");
566
					continue;
566
					continue;
567
				} catch (TException e1) {
567
				} catch (TException e1) {
568
					logger.error("Problem with inventory service" + flipkartorder.getId());
568
					logger.error("Problem with inventory service" + flipkartorder.getId()+" ",e1);
569
					sb.append(orderId+" "+subOrderId + " Problem with inventory service while reserving inventory for sku "+ sku +"\n");
569
					sb.append(orderId+" "+subOrderId + " Problem with inventory service while reserving inventory for sku "+ sku +"\n");
570
					continue;
570
					continue;
571
				}
571
				}
572
			}
572
			}
573
		}
573
		}