用户
 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,登录网站

1

主题

4

帖子

25

积分

攻城狮

Rank: 2

积分
25
2018-11-29 17:36:08 china_hbiii 攻城狮 楼主 3324
==========支付请求
//支付请求对象
ServiceRequestPay pay = new ServiceRequestPay{}
//调用组件业务
BaseServiceResponse res_pay = SingleWeChatService.OnTransfer(pay);
//失败处理
if (res_pay.state != ServiceState.SUCCESS) return new ResponseError { code = SwapState.T_CHAT_PAY_REQUEST_RETURN_FAIL, error = string.Concat(res_pay.state, "|", res_pay.returnMessage) };
//成功处理
ServiceResponsePay pay_response = (ServiceResponsePay)res_pay;
//系统存储此次交易的请求数据

//返回
return new ResponseObject
{
        code = SwapState.SUCCESS,
        result = new
        {
                package = pay_response.package,
                paySign = pay_response.paySign,
                nonceStr = pay_response.nonceStr,
                timeStamp = pay_response.timeStamp,
                prepayId = pay_response.prepayId,
                id = tranId,
                signType = "MD5"
        }
};     

==========支付异步通知
//交易处理
BaseServiceResponse res_notify = SingleWeChatService.OnTransfer(new ServiceRequestPayNotice { body = "通知返回的原文" });
//
if (res_notify.state != ServiceState.SUCCESS)
{
        //失败处理
}
//转换成功对象
ServiceResponsePayNotice notice = (ServiceResponsePayNotice)res_notify;
//成功处理




===========退款处理
//退款请求对象
ServiceRequestRefund serviceRefund = new ServiceRequestRefund{};
//调用退款接口
BaseServiceResponse apiBussess = SingleWeChatService.OnTransfer(serviceRefund);
//构建退款记录
//失败处理
if (apiBussess.state != ServiceState.SUCCESS)
{
        //
}
//转换成功对象
ServiceResponseRefund resRefund = (ServiceResponseRefund)apiBussess;
//成功业务处理

SAAS.Business.WeChat.Service.zip

490.69 KB, 下载次数: 15

没人评论吗..
学习学习

有什么问题吗.?
发新帖
您需要登录后才可以回帖 登录 | 立即注册