| Line 14... |
Line 14... |
| 14 |
private static Logger log = Logger.getLogger(Class.class);
|
14 |
private static Logger log = Logger.getLogger(Class.class);
|
| 15 |
|
15 |
|
| 16 |
private long paymentId;
|
16 |
private long paymentId;
|
| 17 |
|
17 |
|
| 18 |
@Override
|
18 |
@Override
|
| 19 |
public long createPayment(long userId, long txnId, String paymentOption, int gatewayId) {
|
19 |
public long createPayment(long userId, long txnId, String paymentOption, int gatewayId,String paymentType) {
|
| 20 |
log.info("Creating payment for the txn#: " + txnId + " for the user: " + userId + " for processing through COD");
|
20 |
log.info("Creating payment for the txn#: " + txnId + " for the user: " + userId + " for processing through COD");
|
| 21 |
CommonPaymentService cps = new CommonPaymentService();
|
21 |
CommonPaymentService cps = new CommonPaymentService();
|
| 22 |
if(!cps.createPayment(userId, txnId, gatewayId)){
|
22 |
if(!cps.createPayment(userId, txnId, gatewayId)){
|
| 23 |
log.error("Error while creating the basic payment");
|
23 |
log.error("Error while creating the basic payment");
|
| 24 |
return PAYMENT_NOT_CREATED;
|
24 |
return PAYMENT_NOT_CREATED;
|
| Line 26... |
Line 26... |
| 26 |
paymentId = cps.getPaymentId();
|
26 |
paymentId = cps.getPaymentId();
|
| 27 |
|
27 |
|
| 28 |
if(paymentOption != null){
|
28 |
if(paymentOption != null){
|
| 29 |
List<Attribute> attributes = new ArrayList<Attribute>();
|
29 |
List<Attribute> attributes = new ArrayList<Attribute>();
|
| 30 |
attributes.add(new Attribute(IPaymentService.PAYMENT_METHOD, paymentOption));
|
30 |
attributes.add(new Attribute(IPaymentService.PAYMENT_METHOD, paymentOption));
|
| 31 |
|
31 |
attributes.add(new Attribute(IPaymentService.PAYMENT_TYPE, paymentType));
|
| 32 |
try {
|
32 |
try {
|
| 33 |
PaymentClient paymentServiceClient = new PaymentClient();
|
33 |
PaymentClient paymentServiceClient = new PaymentClient();
|
| 34 |
paymentServiceClient.getClient().updatePaymentDetails(paymentId, null, null, null, null, null, null, null, null, PaymentStatus.INIT, null, attributes);
|
34 |
paymentServiceClient.getClient().updatePaymentDetails(paymentId, null, null, null, null, null, null, null, null, PaymentStatus.INIT, null, attributes);
|
| 35 |
} catch (Exception e) {
|
35 |
} catch (Exception e) {
|
| 36 |
log.error("Error while saving payment option attribute", e);
|
36 |
log.error("Error while saving payment option attribute", e);
|