| Line 22... |
Line 22... |
| 22 |
public static final String TXN_TYPE = "transactionType";
|
22 |
public static final String TXN_TYPE = "transactionType";
|
| 23 |
|
23 |
|
| 24 |
private long paymentId;
|
24 |
private long paymentId;
|
| 25 |
|
25 |
|
| 26 |
@Override
|
26 |
@Override
|
| 27 |
public long createPayment(long userId, long txnId, String paymentOption, int gatewayId){
|
27 |
public long createPayment(long userId, long txnId, String paymentOption, int gatewayId, String paymentType){
|
| 28 |
log.info("Creating payment for the txn#: " + txnId + " for the user: " + userId + " for processing through Innoviti");
|
28 |
log.info("Creating payment for the txn#: " + txnId + " for the user: " + userId + " for processing through Innoviti");
|
| 29 |
CommonPaymentService cps = new CommonPaymentService();
|
29 |
CommonPaymentService cps = new CommonPaymentService();
|
| 30 |
if(!cps.createPayment(userId, txnId, gatewayId)){
|
30 |
if(!cps.createPayment(userId, txnId, gatewayId)){
|
| 31 |
log.error("Error while creating the basic payment");
|
31 |
log.error("Error while creating the basic payment");
|
| 32 |
return PAYMENT_NOT_CREATED;
|
32 |
return PAYMENT_NOT_CREATED;
|
| Line 34... |
Line 34... |
| 34 |
paymentId = cps.getPaymentId();
|
34 |
paymentId = cps.getPaymentId();
|
| 35 |
|
35 |
|
| 36 |
if(paymentOption != null){
|
36 |
if(paymentOption != null){
|
| 37 |
List<Attribute> attributes = new ArrayList<Attribute>();
|
37 |
List<Attribute> attributes = new ArrayList<Attribute>();
|
| 38 |
attributes.add(new Attribute(IPaymentService.PAYMENT_METHOD, paymentOption));
|
38 |
attributes.add(new Attribute(IPaymentService.PAYMENT_METHOD, paymentOption));
|
| - |
|
39 |
attributes.add(new Attribute(IPaymentService.PAYMENT_TYPE, paymentType));
|
| 39 |
double emiAmount = CommonPaymentService.calculateEmiAmount(paymentOption, cps.getAmount());
|
40 |
double emiAmount = CommonPaymentService.calculateEmiAmount(paymentOption, cps.getAmount());
|
| 40 |
if(emiAmount > 0){
|
41 |
if(emiAmount > 0){
|
| 41 |
attributes.add(new Attribute(IPaymentService.EMI_AMOUNT, ""+emiAmount));
|
42 |
attributes.add(new Attribute(IPaymentService.EMI_AMOUNT, ""+emiAmount));
|
| 42 |
}
|
43 |
}
|
| 43 |
try {
|
44 |
try {
|