545 lines
24 KiB
C#
545 lines
24 KiB
C#
//======================================================================
|
||
// InterfaceController
|
||
// ZMF_Demo.ZMF
|
||
//
|
||
// Created by Chen Jialuo on 3/2/2017 4:45:40 PM.
|
||
// Copyright © 2017 ZHONGMAKEJI. All rights reserved.
|
||
// http://www.zhongmakj.com/
|
||
//
|
||
//======================================================================
|
||
//------版本-----------更新日期-----------------适用接口文档版本----------
|
||
//------v1.0-----------2017.03.03--------------v2.0---------------------
|
||
//======================================================================
|
||
|
||
/*
|
||
* 注释下方define语句以禁用JSON解析
|
||
* 若要启用JSON解析,使用前须先将第三方组件Newtonsoft.Json.dll导入至工程。 Newtonsoft.Json网址: http://www.newtonsoft.com/json
|
||
* 此Demo工程业已包含上述第三方组件
|
||
* 禁用JSON解析则无需导入上述组件
|
||
* 启用JSON解析时 各个接口调用方法返回JObject对象
|
||
* 禁用JSON解析时 各个接口调用方法返回string变量
|
||
*/
|
||
#define ZMF_SHOULD_USE_JSON
|
||
|
||
using System;
|
||
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using System.Collections.Specialized;
|
||
using System.Linq;
|
||
using System.Reflection;
|
||
using System.Security.Cryptography;
|
||
using System.Text;
|
||
|
||
#if ZMF_SHOULD_USE_JSON
|
||
using Newtonsoft.Json;
|
||
using Newtonsoft.Json.Linq;
|
||
#endif
|
||
|
||
namespace MobileServicePlatform.Common
|
||
{
|
||
/// <summary>
|
||
/// API接口控制器
|
||
/// </summary>
|
||
public sealed class InterfaceController {
|
||
|
||
#region 接口配置
|
||
// TODO: 配置填写,请先将合作方的APP_ID和KEY在此处填写完整
|
||
/// <summary>
|
||
/// 服务器地址
|
||
/// </summary>
|
||
private const string ZMF_SERVER_HOST = "http://118.178.235.230/open-api";
|
||
/// <summary>
|
||
/// APP ID
|
||
/// </summary>
|
||
private const string ZMF_CONFIG_APPID = "G0000032";
|
||
/// <summary>
|
||
/// KEY
|
||
/// </summary>
|
||
private const string ZMF_CONFIG_KEY = "8163372a618170ae27d91772c62117d1";
|
||
#endregion
|
||
|
||
#region 构造方法
|
||
/// <summary>
|
||
/// 不需要新建对象,构造函数为私有
|
||
/// </summary>
|
||
private InterfaceController() {
|
||
;
|
||
}
|
||
#endregion
|
||
|
||
#region 公共方法
|
||
/// <summary>
|
||
/// 获取签名
|
||
/// </summary>
|
||
/// <param name="param">键值对内容</param>
|
||
/// <returns>签名值</returns>
|
||
private static string GetSign(Hashtable param) {
|
||
/*
|
||
* *******这段注释的内容运行结果与下方代码相同*******
|
||
//结果字符串
|
||
string finalString = "";
|
||
//键名排序
|
||
ArrayList al = new ArrayList(param.Keys);
|
||
al.Sort();
|
||
//加入字符串
|
||
foreach (string key in al) {
|
||
if (param[key] != null && param[key].ToString() != "")
|
||
finalString += key + "=" + param[key].ToString() + "&";
|
||
}
|
||
//最后加入appid和key
|
||
finalString += string.Format("appId={0}&key={1}", ZMF_CONFIG_APPID, ZMF_CONFIG_KEY);
|
||
//MD5
|
||
MD5 md5 = new MD5CryptoServiceProvider();
|
||
byte[] result = md5.ComputeHash(Encoding.UTF8.GetBytes(finalString));
|
||
finalString = BitConverter.ToString(result).Replace("-", "").ToLower();
|
||
return finalString;
|
||
*/
|
||
|
||
return BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(string.Join("&", param.Cast<DictionaryEntry>().Where(x => x.Value != null && x.Value.ToString() != "").OrderBy(x => x.Key).Union(new List<DictionaryEntry> { new DictionaryEntry("appId", ZMF_CONFIG_APPID), new DictionaryEntry("key", ZMF_CONFIG_KEY) }).Select(x => string.Format("{0}={1}", x.Key, x.Value)))))).Replace("-", "").ToLower();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 同步方式发送请求
|
||
/// </summary>
|
||
/// <param name="method">方法名,使用System.Reflection.MethodBase.GetCurrentMethod().Name来传入</param>
|
||
/// <param name="ifName">接口url具体名称</param>
|
||
/// <param name="list">参数</param>
|
||
/// <returns>调用成功则返回接口返回内容;失败时返回null</returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
private static JObject Access(string method, string ifName, params object[] list) {
|
||
#else
|
||
private static string Access(string method, string ifName, params object[] list) {
|
||
#endif
|
||
//建立参数字典
|
||
Hashtable param = new Hashtable();
|
||
//参数名列表
|
||
ParameterInfo[] pis = typeof(InterfaceController).GetMethod(method).GetParameters();
|
||
//传入有误
|
||
if (pis == null || (list != null && pis.Length != list.Length)) {
|
||
// TODO: 传入参数有误,错误日志写入
|
||
|
||
return null;
|
||
}
|
||
//键值对加入
|
||
for (var i = 0; i < pis.Length; i++) {
|
||
param.Add(pis[i].Name, list[i].ToString());
|
||
}
|
||
//加入签名
|
||
param.Add("signature", GetSign(param));
|
||
//加入APP ID
|
||
param.Add("appId", ZMF_CONFIG_APPID);
|
||
//转为NameValueCollection
|
||
NameValueCollection nvc = new NameValueCollection();
|
||
foreach (DictionaryEntry entry in param) {
|
||
nvc.Add(entry.Key.ToString(), entry.Value.ToString());
|
||
}
|
||
//完整URL
|
||
string url = ZMF_SERVER_HOST + ifName;
|
||
#if ZMF_SHOULD_USE_JSON
|
||
//调用HTTP POST 并进行JSON解析
|
||
try {
|
||
return JsonConvert.DeserializeObject<JObject>(HttpHelper.Post(url, nvc));
|
||
} catch {
|
||
// TODO: JSON解析失败,错误日志写入
|
||
|
||
return null;
|
||
}
|
||
#else
|
||
return HttpHelper.Post(url, nvc);
|
||
#endif
|
||
}
|
||
#endregion
|
||
|
||
#region 各个接口
|
||
|
||
/// <summary>
|
||
/// 商户注册
|
||
/// </summary>
|
||
/// <param name="merchantName">商户名称</param>
|
||
/// <param name="address">商家地址</param>
|
||
/// <param name="mobile">商家手机号</param>
|
||
/// <param name="applicantName">商家姓名</param>
|
||
/// <param name="applicantIdno">商家身份证号</param>
|
||
/// <param name="notifyUrl">商家审核状态回调接口</param>
|
||
/// <param name="businessCatagory1">业务类别1</param>
|
||
/// <param name="businessCatagory2">业务类别2</param>
|
||
/// <param name="mcc">MCC码</param>
|
||
/// <param name="area">区编号</param>
|
||
/// <param name="prov">省编号</param>
|
||
/// <param name="city">市编号</param>
|
||
/// <param name="licenseno">营业执照号</param>
|
||
/// <param name="licensedate">营业执照有效期</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject StoreAdd(string merchantName, string address, string mobile, string applicantName, string applicantIdno, string notifyUrl, string businessCatagory1, string businessCatagory2, string mcc, string area, string prov, string city, string licenseno, string licensedate) {
|
||
#else
|
||
public static string StoreAdd(string merchantName, string address, string mobile, string applicantName, string applicantIdno, string notifyUrl, string businessCatagory1, string businessCatagory2, string mcc, string area, string prov, string city, string licenseno, string licensedate) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/storeInfo/add", merchantName, address, mobile, applicantName, applicantIdno, notifyUrl, businessCatagory1, businessCatagory2, mcc, area, prov, city, licenseno, licensedate);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 商户基本信息更新
|
||
/// </summary>
|
||
/// <param name="memberCode">商户编码</param>
|
||
/// <param name="merchantName">商户名称</param>
|
||
/// <param name="address">商家地址</param>
|
||
/// <param name="mobile">商家手机号</param>
|
||
/// <param name="applicantName">商家姓名</param>
|
||
/// <param name="applicantIdno">商家身份证号</param>
|
||
/// <param name="notifyUrl">商家审核状态回调接口</param>
|
||
/// <param name="businessCatagory1">业务类别1</param>
|
||
/// <param name="businessCatagory2">业务类别2</param>
|
||
/// <param name="mcc">MCC码</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject StoreModify(string memberCode, string merchantName, string address, string mobile, string applicantName, string applicantIdno, string notifyUrl, string businessCatagory1, string businessCatagory2, string mcc) {
|
||
#else
|
||
public static string StoreModify(string memberCode, string merchantName, string address, string mobile, string applicantName, string applicantIdno, string notifyUrl, string businessCatagory1, string businessCatagory2, string mcc) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/storeInfo/modify", memberCode, merchantName, address, mobile, applicantName, applicantIdno, notifyUrl, businessCatagory1, businessCatagory2, mcc);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 设置申请人结算卡信息
|
||
/// </summary>
|
||
/// <param name="name">商户名称</param>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <param name="mobile">手机号</param>
|
||
/// <param name="branchName">支行名称</param>
|
||
/// <param name="branchNo">支行号</param>
|
||
/// <param name="cardNo">卡号</param>
|
||
/// <param name="bankName">银行名</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject SetCard(string name, string memberCode, string mobile, string branchName, string branchNo, string cardNo, string bankName) {
|
||
#else
|
||
public static string SetCard(string name, string memberCode, string mobile, string branchName, string branchNo, string cardNo, string bankName) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/applicant/setCard", name, memberCode, mobile, branchName, branchNo, cardNo, bankName);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 商户绑定
|
||
/// </summary>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <param name="partnerUser">合作商号</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject StoreBand(string memberCode, string partnerUser) {
|
||
#else
|
||
public static string StoreBand(string memberCode, string partnerUser) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/store/band", memberCode, partnerUser);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 交易订单详情
|
||
/// </summary>
|
||
/// <param name="orderNo">订单号</param>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject BillDetail(string orderNo, string memberCode) {
|
||
#else
|
||
public static string BillDetail(string orderNo, string memberCode) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/bill/detail", orderNo, memberCode);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 交易记录列表
|
||
/// </summary>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <param name="start">起始时间</param>
|
||
/// <param name="end">结束时间</param>
|
||
/// <param name="page">页索引号</param>
|
||
/// <param name="rows">行数</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject BillLists(string memberCode, string start, string end, string page, string rows) {
|
||
#else
|
||
public static string BillLists(string memberCode, string start, string end, string page, string rows) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/bill/lists", memberCode, start, end, page, rows);
|
||
}
|
||
|
||
/// <summary>
|
||
/// MCC码列表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject MccLists() {
|
||
#else
|
||
public static string MccLists() {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/mcc/lists", null);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 商户一级类别列表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject MccLevel1() {
|
||
#else
|
||
public static string MccLevel1() {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/mcc/level1", null);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 商户二级类别列表
|
||
/// </summary>
|
||
/// <param name="level1Id">商户一级类别id</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject MccLevel2(string level1Id) {
|
||
#else
|
||
public static string MccLevel2(string level1Id) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/mcc/level2", level1Id);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 图片上传
|
||
/// </summary>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <param name="storeInnerImageUrl">商店内部照片URL</param>
|
||
/// <param name="storeBankCardImageUrl">银行卡照片URL</param>
|
||
/// <param name="storeBusinessImageUrl">营业执照URL</param>
|
||
/// <param name="idCardFontImageUrl">身份证正面照URL</param>
|
||
/// <param name="idCardBackImageUrl">身份证反面照URL</param>
|
||
/// <param name="holdCardImageUrl">手持身份证半身照URL</param>
|
||
/// <param name="storeImageUrl">申请人与门店合照URL</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject UploadImage(string memberCode, string storeInnerImageUrl, string storeBankCardImageUrl, string storeBusinessImageUrl, string idCardFontImageUrl, string idCardBackImageUrl, string holdCardImageUrl, string storeImageUrl) {
|
||
#else
|
||
public static string UploadImage(string memberCode, string storeInnerImageUrl, string storeBankCardImageUrl, string storeBusinessImageUrl, string idCardFontImageUrl, string idCardBackImageUrl, string holdCardImageUrl, string storeImageUrl) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/storeInfo/imageUpload", memberCode, storeInnerImageUrl, storeBankCardImageUrl, storeBusinessImageUrl, idCardFontImageUrl, idCardBackImageUrl, holdCardImageUrl, storeImageUrl);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 商家信息获取
|
||
/// </summary>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject StoreInfo(string memberCode) {
|
||
#else
|
||
public static string StoreInfo(string memberCode) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/storeInfo/get", memberCode);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 省份列表获取
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject Province() {
|
||
#else
|
||
public static string Province() {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/card/province", null);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 省份下城市列表获取
|
||
/// </summary>
|
||
/// <param name="provinceId">省份编号</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject City(string provinceId) {
|
||
#else
|
||
public static string City(string provinceId) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/card/city", provinceId);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 卡信息获取
|
||
/// </summary>
|
||
/// <param name="cardNo">卡号</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject CardInfo(string cardNo) {
|
||
#else
|
||
public static string CardInfo(string cardNo) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/card/cardinfo", cardNo);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 卡所在支行信息获取
|
||
/// </summary>
|
||
/// <param name="cardNo">卡号</param>
|
||
/// <param name="city">城市名称</param>
|
||
/// <param name="keyWord">查询关键字</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject CardBranch(string cardNo, string city, string keyWord) {
|
||
#else
|
||
public static string CardBranch(string cardNo, string city, string keyWord) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/card/cardbranchNo", cardNo, city, keyWord);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 用户扫商家(正扫支付)微信
|
||
/// </summary>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <param name="subject">交易对象</param>
|
||
/// <param name="notifyUrl">交易结果通知接口Url</param>
|
||
/// <param name="discountAmt">优惠金额</param>
|
||
/// <param name="transAmt">实收金额</param>
|
||
/// <param name="orderNo">外部订单号</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject QRCodePayWechat(string memberCode, string subject, string notifyUrl, string discountAmt, string transAmt, string orderNo) {
|
||
#else
|
||
public static string QRCodePayWechat(string memberCode, string subject, string notifyUrl, string discountAmt, string transAmt, string orderNo) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/unionpay/customerscan/type/wechat", memberCode, subject, notifyUrl, discountAmt, transAmt, orderNo);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 用户扫商家(正扫支付)支付宝
|
||
/// </summary>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <param name="subject">交易对象</param>
|
||
/// <param name="notifyUrl">交易结果通知接口Url</param>
|
||
/// <param name="discountAmt">优惠金额</param>
|
||
/// <param name="transAmt">实收金额</param>
|
||
/// <param name="orderNo">外部订单号</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject QRCodePayAlipay(string memberCode, string subject, string notifyUrl, string discountAmt, string transAmt, string orderNo) {
|
||
#else
|
||
public static string QRCodePayAlipay(string memberCode, string subject, string notifyUrl, string discountAmt, string transAmt, string orderNo) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/unionpay/customerscan/type/alipay", memberCode, subject, notifyUrl, discountAmt, transAmt, orderNo);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 商家扫用户(反扫支付)
|
||
/// </summary>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <param name="subject">交易对象</param>
|
||
/// <param name="notifyUrl">交易结果通知接口Url</param>
|
||
/// <param name="discountAmt">优惠金额</param>
|
||
/// <param name="transAmt">实收金额</param>
|
||
/// <param name="qrcode">用户支付码</param>
|
||
/// <param name="orderNo">交易订单号</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject BarcodePay(string memberCode, string subject, string notifyUrl, string discountAmt, string transAmt, string qrcode, string orderNo) {
|
||
#else
|
||
public static string BarcodePay(string memberCode, string subject, string notifyUrl, string discountAmt, string transAmt, string qrcode, string orderNo) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/unionpay/merchantscan/type/" + (qrcode.StartsWith("1") ? "wechat" : "alipay"), memberCode, subject, notifyUrl, discountAmt, transAmt, qrcode, orderNo);
|
||
}
|
||
|
||
/// <summary>
|
||
/// JS支付 微信
|
||
/// </summary>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <param name="notifyUrl">交易结果通知接口Url</param>
|
||
/// <param name="discountAmt">优惠金额</param>
|
||
/// <param name="transAmt">实收金额</param>
|
||
/// <param name="userid">用户支付ID</param>
|
||
/// <param name="orderNo">外部订单号</param>
|
||
/// <param name="subject">交易对象</param>
|
||
/// <param name="returnUrl">跳转页面</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject WebPayWechat(string memberCode, string notifyUrl, string discountAmt, string transAmt, string userid, string orderNo, string subject, string returnUrl) {
|
||
#else
|
||
public static string WebPayWechat(string memberCode, string notifyUrl, string discountAmt, string transAmt, string userid, string orderNo, string subject, string returnUrl) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/unionpay/webpay/type/wechat", memberCode, notifyUrl, discountAmt, transAmt, userid, orderNo, subject, returnUrl);
|
||
}
|
||
|
||
/// <summary>
|
||
/// JS支付 支付宝
|
||
/// </summary>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <param name="notifyUrl">交易结果通知接口Url</param>
|
||
/// <param name="discountAmt">优惠金额</param>
|
||
/// <param name="transAmt">实收金额</param>
|
||
/// <param name="userid">用户支付ID</param>
|
||
/// <param name="orderNo">外部订单号</param>
|
||
/// <param name="subject">交易对象</param>
|
||
/// <param name="returnUrl">跳转页面</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject WebPayAlipay(string memberCode, string notifyUrl, string discountAmt, string transAmt, string userid, string orderNo, string subject, string returnUrl) {
|
||
#else
|
||
public static string WebPayAlipay(string memberCode, string notifyUrl, string discountAmt, string transAmt, string userid, string orderNo, string subject, string returnUrl) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/unionpay/webpay/type/alipay", memberCode, notifyUrl, discountAmt, transAmt, userid, orderNo, subject, returnUrl);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 退款
|
||
/// </summary>
|
||
/// <param name="authcode">退款单号</param>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject Refund(string authcode, string memberCode) {
|
||
#else
|
||
public static string Refund(string authcode, string memberCode) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/refund/authcode", authcode, memberCode);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 扣率初始化
|
||
/// </summary>
|
||
/// <param name="memberCode">商家编号</param>
|
||
/// <param name="rate">扣率</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject SetRate(string memberCode, string rate) {
|
||
#else
|
||
public static string SetRate(string memberCode, string rate) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/store/setRate", memberCode, rate);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询省市区列表
|
||
/// </summary>
|
||
/// <param name="type">查询对象</param>
|
||
/// <param name="code">查询编码</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject AdministrativeDivisions(string type, string code) {
|
||
#else
|
||
public static string AdministrativeDivisions(string type, string code) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/channeladdr/lists", type, code);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询退款单号
|
||
/// </summary>
|
||
/// <param name="authcode">退款单号</param>
|
||
/// <returns></returns>
|
||
#if ZMF_SHOULD_USE_JSON
|
||
public static JObject QueryRefund(string authcode) {
|
||
#else
|
||
public static JObject QueryRefund(string authcode) {
|
||
#endif
|
||
return Access(MethodBase.GetCurrentMethod().Name, "/refund/query", authcode);
|
||
}
|
||
|
||
|
||
#endregion
|
||
}
|
||
|
||
}
|