| Line 354... |
Line 354... |
| 354 |
continue;
|
354 |
continue;
|
| 355 |
}
|
355 |
}
|
| 356 |
transactionId = String.valueOf(transaction_client.createTransaction(txn));
|
356 |
transactionId = String.valueOf(transaction_client.createTransaction(txn));
|
| 357 |
row.getCell(PAISAPAY_ID_INDEX).setCellType(Cell.CELL_TYPE_STRING);
|
357 |
row.getCell(PAISAPAY_ID_INDEX).setCellType(Cell.CELL_TYPE_STRING);
|
| 358 |
String paisaPayId = row.getCell(PAISAPAY_ID_INDEX).getStringCellValue();
|
358 |
String paisaPayId = row.getCell(PAISAPAY_ID_INDEX).getStringCellValue();
|
| 359 |
createPayment(user, paisaPayId, totalPrice);
|
359 |
long paymentId = createPayment(user, paisaPayId, totalPrice);
|
| 360 |
|
360 |
|
| 361 |
//TODO
|
361 |
//TODO
|
| 362 |
/*in.shop2020.model.v1.order.Attribute orderAttribute = new in.shop2020.model.v1.order.Attribute();
|
362 |
/*in.shop2020.model.v1.order.Attribute orderAttribute = new in.shop2020.model.v1.order.Attribute();
|
| 363 |
orderAttribute.setName("tinNumber");
|
363 |
orderAttribute.setName("tinNumber");
|
| 364 |
orderAttribute.setValue(sourceDetail.getTinNumber());
|
364 |
orderAttribute.setValue(sourceDetail.getTinNumber());
|
| Line 394... |
Line 394... |
| 394 |
ebayOrder.setPaisaPayId(paisaPayId);
|
394 |
ebayOrder.setPaisaPayId(paisaPayId);
|
| 395 |
ebayOrder.setSubsidyAmount(ebayItem.getSubsidy()*quantity);
|
395 |
ebayOrder.setSubsidyAmount(ebayItem.getSubsidy()*quantity);
|
| 396 |
ebayOrder.setListingName(ebayItem.getListingName());
|
396 |
ebayOrder.setListingName(ebayItem.getListingName());
|
| 397 |
ebayOrder.setListingPrice(listingPrice);
|
397 |
ebayOrder.setListingPrice(listingPrice);
|
| 398 |
transaction_client.createEbayOrder(ebayOrder);
|
398 |
transaction_client.createEbayOrder(ebayOrder);
|
| - |
|
399 |
in.shop2020.payments.PaymentService.Client client = new PaymentClient().getClient();
|
| - |
|
400 |
client.updatePaymentDetails(paymentId, null, null, null, null, null, null, paisaPayId, null, PaymentStatus.SUCCESS, null, null);
|
| 399 |
} catch (Exception e) {
|
401 |
} catch (Exception e) {
|
| 400 |
logger.error("Error while creating order for rowId " + rowId, e);
|
402 |
logger.error("Error while creating order for rowId " + rowId, e);
|
| 401 |
addActionError("Error while creating order for rowId " + rowId);
|
403 |
addActionError("Error while creating order for rowId " + rowId);
|
| 402 |
setErrorMsg(getErrorMsg() + "<br>Error while creating order for row number " + rowId);
|
404 |
setErrorMsg(getErrorMsg() + "<br>Error while creating order for row number " + rowId);
|
| 403 |
continue;
|
405 |
continue;
|
| Line 438... |
Line 440... |
| 438 |
lineItem.setColor(item.getColor());
|
440 |
lineItem.setColor(item.getColor());
|
| 439 |
}
|
441 |
}
|
| 440 |
return lineItem;
|
442 |
return lineItem;
|
| 441 |
}
|
443 |
}
|
| 442 |
|
444 |
|
| 443 |
private void createPayment(User user, String paisaPayId, double amount) throws NumberFormatException, PaymentException, TException {
|
445 |
private long createPayment(User user, String paisaPayId, double amount) throws NumberFormatException, PaymentException, TException {
|
| 444 |
in.shop2020.payments.PaymentService.Client client = new PaymentClient().getClient();
|
446 |
in.shop2020.payments.PaymentService.Client client = new PaymentClient().getClient();
|
| 445 |
long paymentId = client.createPayment(user.getUserId(), amount, EBAY_GATEWAY_ID, Long.valueOf(transactionId), false);
|
447 |
return client.createPayment(user.getUserId(), amount, EBAY_GATEWAY_ID, Long.valueOf(transactionId), false);
|
| 446 |
client.updatePaymentDetails(paymentId, null, null, null, null, null, null, paisaPayId, null, PaymentStatus.SUCCESS, null, null);
|
- |
|
| 447 |
}
|
448 |
}
|
| 448 |
|
449 |
|
| 449 |
public String index() {
|
450 |
public String index() {
|
| 450 |
if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), "/ebay-dashboard"))
|
451 |
if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), "/ebay-dashboard"))
|
| 451 |
return "authfail";
|
452 |
return "authfail";
|