package com.jlfex.hermes.service.cfca;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jlfex.hermes.common.Logger;
import cfca.payment.api.system.TxMessenger;
import cfca.payment.api.tx.Tx1361Request;
import cfca.payment.api.tx.Tx1361Response;
import cfca.payment.api.tx.Tx1362Request;
import cfca.payment.api.tx.Tx1362Response;

/**
 * 中金支付接口实现
 * 
 * @author wujinsong
 *
 */
@Service
@Transactional
public class ThirdPPServiceImpl implements ThirdPPService {

	@Override
	public Tx1361Response invokeTx1361(Tx1361Request request) {
		try {
			Logger.info("调用中金支付接口，请求消息："+"订单流水号："+request.getTxSN()+"金额："+request.getAmount()+"账户名称："+request.getAccountName());
			request.process();

			TxMessenger messenger = new TxMessenger();
			String[] respMsg = messenger.send(request.getRequestMessage(), request.getRequestSignature());

			Tx1361Response response = new Tx1361Response(respMsg[0], respMsg[1]);
			Logger.info("中金支付返回信息："+ response.getResponsePlainText());

			return response;
		} catch (Exception e) {
			return null;
		}
	}

	@Override
	public Tx1362Response invokeTx1362(Tx1362Request request) {
		try {
			request.process();

			TxMessenger messenger = new TxMessenger();
			String[] respMsg;
			respMsg = messenger.send(request.getRequestMessage(), request.getRequestSignature());
			Tx1362Response response = new Tx1362Response(respMsg[0], respMsg[1]);

			return response;
		} catch (Exception e) {
			return null;
		}
	}
}

@@ -1074,32 +1074,73 @@
 (Exception e) %7B%0A
+%09%09%09Logger.error(%22%E4%B8%AD%E9%87%91%E5%B8%82%E5%9C%BA%E8%AE%A2%E5%8D%95%E4%BB%A3%E6%89%A31361%E6%8E%A5%E5%8F%A3%E5%BC%82%E5%B8%B8%EF%BC%9A%22, e);%0A
 %09%09%09return null;%0A

添加 1361异常日志输出