| Line 1307... |
Line 1307... |
| 1307 |
def __capture_txn(order):
|
1307 |
def __capture_txn(order):
|
| 1308 |
txnId = order.transaction_id
|
1308 |
txnId = order.transaction_id
|
| 1309 |
logging.info("Capturing payment for merchant txn:" + str(txnId))
|
1309 |
logging.info("Capturing payment for merchant txn:" + str(txnId))
|
| 1310 |
try:
|
1310 |
try:
|
| 1311 |
payment_client = PaymentClient().get_client()
|
1311 |
payment_client = PaymentClient().get_client()
|
| - |
|
1312 |
payment = payment_client.getPaymentForTxnId(order.transaction_id)
|
| - |
|
1313 |
if payment.gatewayId == 9:
|
| - |
|
1314 |
return
|
| 1312 |
capture_result = payment_client.capturePayment(txnId)
|
1315 |
capture_result = payment_client.capturePayment(txnId, False)
|
| 1313 |
if capture_result:
|
1316 |
if capture_result:
|
| 1314 |
logging.info("Successfully captured payment for merchant txn:" + str(txnId))
|
1317 |
logging.info("Successfully captured payment for merchant txn:" + str(txnId))
|
| 1315 |
change_transaction_status(txnId, TransactionStatus.IN_PROCESS, "Payment received", PickUpType.COURIER, order.orderType, order.source)
|
1318 |
change_transaction_status(txnId, TransactionStatus.IN_PROCESS, "Payment received", PickUpType.COURIER, order.orderType, order.source)
|
| 1316 |
else:
|
1319 |
else:
|
| 1317 |
raise TransactionServiceException(115, "Payment capture failed.")
|
1320 |
raise TransactionServiceException(115, "Payment capture failed.")
|