| Line 128... |
Line 128... |
| 128 |
* The transaction which should be marked as successful.
|
128 |
* The transaction which should be marked as successful.
|
| 129 |
* @param userServiceClient
|
129 |
* @param userServiceClient
|
| 130 |
* A user context service client to use.
|
130 |
* A user context service client to use.
|
| 131 |
* @param transactionServiceClient
|
131 |
* @param transactionServiceClient
|
| 132 |
* A transaction service client to use.
|
132 |
* A transaction service client to use.
|
| - |
|
133 |
* @param isFlagged
|
| - |
|
134 |
* If payment is flagged it will be true else false
|
| 133 |
*/
|
135 |
*/
|
| 134 |
public static void processSuccessfulTxn(long txnId, UserClient userServiceClient, TransactionClient transactionServiceClient) {
|
136 |
public static void processSuccessfulTxn(long txnId, UserClient userServiceClient, TransactionClient transactionServiceClient, boolean isFlagged) {
|
| 135 |
Transaction transaction = null;
|
137 |
Transaction transaction = null;
|
| - |
|
138 |
TransactionStatus tStatus = TransactionStatus.AUTHORIZED;
|
| - |
|
139 |
String description = "Payment authorized for the order";
|
| - |
|
140 |
// if flag is set, status to be changed to flagged
|
| - |
|
141 |
if(isFlagged){
|
| - |
|
142 |
tStatus = TransactionStatus.FLAGGED;
|
| - |
|
143 |
description = "Payment flagged for the order";
|
| - |
|
144 |
}
|
| 136 |
try {
|
145 |
try {
|
| 137 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient = transactionServiceClient.getClient();
|
146 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient = transactionServiceClient.getClient();
|
| 138 |
transactionClient.changeTransactionStatus(txnId, TransactionStatus.AUTHORIZED, "Payment authorized for the order");
|
147 |
transactionClient.changeTransactionStatus(txnId, tStatus, description);
|
| 139 |
transaction = transactionClient.getTransaction(txnId);
|
148 |
transaction = transactionClient.getTransaction(txnId);
|
| 140 |
transactionClient.enqueueTransactionInfoEmail(txnId);
|
149 |
transactionClient.enqueueTransactionInfoEmail(txnId);
|
| 141 |
} catch (TException e1) {
|
150 |
} catch (TException e1) {
|
| 142 |
log.error("Unable to update status of transaction. Thrift Exception:", e1);
|
151 |
log.error("Unable to update status of transaction. Thrift Exception:", e1);
|
| 143 |
} catch (TransactionServiceException e) {
|
152 |
} catch (TransactionServiceException e) {
|