企业付款相关类更名
This commit is contained in:
@@ -14,9 +14,9 @@ import com.foxinmy.weixin4j.http.weixin.WeixinResponse;
|
||||
import com.foxinmy.weixin4j.http.weixin.WeixinSSLRequestExecutor;
|
||||
import com.foxinmy.weixin4j.model.WeixinPayAccount;
|
||||
import com.foxinmy.weixin4j.payment.PayURLConsts;
|
||||
import com.foxinmy.weixin4j.payment.mch.MPPayment;
|
||||
import com.foxinmy.weixin4j.payment.mch.MPPaymentRecord;
|
||||
import com.foxinmy.weixin4j.payment.mch.MPPaymentResult;
|
||||
import com.foxinmy.weixin4j.payment.mch.CorpPayment;
|
||||
import com.foxinmy.weixin4j.payment.mch.CorpPaymentRecord;
|
||||
import com.foxinmy.weixin4j.payment.mch.CorpPaymentResult;
|
||||
import com.foxinmy.weixin4j.payment.mch.Redpacket;
|
||||
import com.foxinmy.weixin4j.payment.mch.RedpacketRecord;
|
||||
import com.foxinmy.weixin4j.payment.mch.RedpacketSendResult;
|
||||
@@ -140,15 +140,15 @@ public class CashApi {
|
||||
* @param mpPayment
|
||||
* 付款信息
|
||||
* @return 付款结果
|
||||
* @see com.foxinmy.weixin4j.payment.mch.MPPayment
|
||||
* @see com.foxinmy.weixin4j.payment.mch.MPPaymentResult
|
||||
* @see com.foxinmy.weixin4j.payment.mch.CorpPayment
|
||||
* @see com.foxinmy.weixin4j.payment.mch.CorpPaymentResult
|
||||
* @see <a
|
||||
* href="http://pay.weixin.qq.com/wiki/doc/api/mch_pay.php?chapter=14_1">企业付款</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public MPPaymentResult mchPayment(InputStream ca, MPPayment mpPayment)
|
||||
public CorpPaymentResult corpPayment(InputStream ca, CorpPayment payment)
|
||||
throws WeixinException {
|
||||
JSONObject obj = (JSONObject) JSON.toJSON(mpPayment);
|
||||
JSONObject obj = (JSONObject) JSON.toJSON(payment);
|
||||
obj.put("nonce_str", RandomUtil.generateString(16));
|
||||
obj.put("mchid", weixinAccount.getMchId());
|
||||
obj.put("sub_mch_id", weixinAccount.getSubMchId());
|
||||
@@ -177,7 +177,7 @@ public class CashApi {
|
||||
.replaceFirst("</mch_appid>", "</appid>")
|
||||
.replaceFirst("<mchid>", "<mch_id>")
|
||||
.replaceFirst("</mchid>", "</mch_id>");
|
||||
return XmlStream.fromXML(text, MPPaymentResult.class);
|
||||
return XmlStream.fromXML(text, CorpPaymentResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -188,12 +188,12 @@ public class CashApi {
|
||||
* @param outTradeNo
|
||||
* 商户调用企业付款API时使用的商户订单号
|
||||
* @return 付款记录
|
||||
* @see com.foxinmy.weixin4j.payment.mch.MPPaymentRecord
|
||||
* @see com.foxinmy.weixin4j.payment.mch.CorpPaymentRecord
|
||||
* @see <a
|
||||
* href="http://pay.weixin.qq.com/wiki/doc/api/mch_pay.php?chapter=14_3">企业付款查询</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public MPPaymentRecord mchPaymentQuery(InputStream ca, String outTradeNo)
|
||||
public CorpPaymentRecord queryCorpPayment(InputStream ca, String outTradeNo)
|
||||
throws WeixinException {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("nonce_str", RandomUtil.generateString(16));
|
||||
@@ -218,7 +218,7 @@ public class CashApi {
|
||||
}
|
||||
}
|
||||
}
|
||||
return response.getAsObject(new TypeReference<MPPaymentRecord>() {
|
||||
return response.getAsObject(new TypeReference<CorpPaymentRecord>() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ import com.foxinmy.weixin4j.payment.coupon.CouponDetail;
|
||||
import com.foxinmy.weixin4j.payment.coupon.CouponResult;
|
||||
import com.foxinmy.weixin4j.payment.coupon.CouponStock;
|
||||
import com.foxinmy.weixin4j.payment.mch.ApiResult;
|
||||
import com.foxinmy.weixin4j.payment.mch.MPPayment;
|
||||
import com.foxinmy.weixin4j.payment.mch.MPPaymentRecord;
|
||||
import com.foxinmy.weixin4j.payment.mch.MPPaymentResult;
|
||||
import com.foxinmy.weixin4j.payment.mch.CorpPayment;
|
||||
import com.foxinmy.weixin4j.payment.mch.CorpPaymentRecord;
|
||||
import com.foxinmy.weixin4j.payment.mch.CorpPaymentResult;
|
||||
import com.foxinmy.weixin4j.payment.mch.MchPayPackage;
|
||||
import com.foxinmy.weixin4j.payment.mch.MchPayRequest;
|
||||
import com.foxinmy.weixin4j.payment.mch.NativePayResponse;
|
||||
@@ -773,26 +773,26 @@ public class WeixinPayProxy {
|
||||
* 付款信息
|
||||
* @return 付款结果
|
||||
* @see com.foxinmy.weixin4j.api.CashApi
|
||||
* @see com.foxinmy.weixin4j.payment.mch.MPPayment
|
||||
* @see com.foxinmy.weixin4j.payment.mch.MPPaymentResult
|
||||
* @see com.foxinmy.weixin4j.payment.mch.CorpPayment
|
||||
* @see com.foxinmy.weixin4j.payment.mch.CorpPaymentResult
|
||||
* @see <a
|
||||
* href="http://pay.weixin.qq.com/wiki/doc/api/mch_pay.php?chapter=14_1">企业付款</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public MPPaymentResult mpPayment(InputStream ca, MPPayment mpPayment)
|
||||
public CorpPaymentResult corpPayment(InputStream ca, CorpPayment payment)
|
||||
throws WeixinException {
|
||||
return cashApi.mchPayment(ca, mpPayment);
|
||||
return cashApi.corpPayment(ca, payment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业付款
|
||||
*
|
||||
* @see {@link com.foxinmy.weixin4j.payment.WeixinPayProxy#mpPayment(InputStream, MPPayment)}
|
||||
* @see {@link com.foxinmy.weixin4j.payment.WeixinPayProxy#corpPayment(InputStream, CorpPayment)}
|
||||
*/
|
||||
public MPPaymentResult mpPayment(MPPayment mpPayment)
|
||||
public CorpPaymentResult corpPayment(CorpPayment payment)
|
||||
throws WeixinException, IOException {
|
||||
return cashApi.mchPayment(
|
||||
new FileInputStream(settings.getCertificateFile0()), mpPayment);
|
||||
return cashApi.corpPayment(
|
||||
new FileInputStream(settings.getCertificateFile0()), payment);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -804,25 +804,25 @@ public class WeixinPayProxy {
|
||||
* 商户调用企业付款API时使用的商户订单号
|
||||
* @return 付款记录
|
||||
* @see com.foxinmy.weixin4j.api.CashApi
|
||||
* @see com.foxinmy.weixin4j.payment.mch.MPPaymentRecord
|
||||
* @see com.foxinmy.weixin4j.payment.mch.CorpPaymentRecord
|
||||
* @see <a
|
||||
* href="http://pay.weixin.qq.com/wiki/doc/api/mch_pay.php?chapter=14_3">企业付款查询</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public MPPaymentRecord mpPaymentQuery(InputStream ca, String outTradeNo)
|
||||
public CorpPaymentRecord queryCorpPayment(InputStream ca, String outTradeNo)
|
||||
throws WeixinException {
|
||||
return cashApi.mchPaymentQuery(ca, outTradeNo);
|
||||
return cashApi.queryCorpPayment(ca, outTradeNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业付款查询
|
||||
*
|
||||
* @see {@link com.foxinmy.weixin4j.payment.WeixinPayProxy#mpPaymentQuery(InputStream, String)}
|
||||
* @see {@link com.foxinmy.weixin4j.payment.WeixinPayProxy#CorpPaymentRecord(InputStream, String)}
|
||||
*/
|
||||
public MPPaymentRecord mpPaymentQuery(String outTradeNo)
|
||||
public CorpPaymentRecord queryCorpPayment(String outTradeNo)
|
||||
throws WeixinException, IOException {
|
||||
return cashApi
|
||||
.mchPaymentQuery(
|
||||
.queryCorpPayment(
|
||||
new FileInputStream(settings.getCertificateFile0()),
|
||||
outTradeNo);
|
||||
}
|
||||
|
||||
+5
-5
@@ -14,7 +14,7 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
/**
|
||||
* 企业付款
|
||||
*
|
||||
* @className MPPayment
|
||||
* @className CorpPayment
|
||||
* @author jy
|
||||
* @date 2015年4月1日
|
||||
* @since JDK 1.6
|
||||
@@ -22,7 +22,7 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
*/
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class MPPayment implements Serializable {
|
||||
public class CorpPayment implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3734639674346425312L;
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ public class MPPayment implements Serializable {
|
||||
@JSONField(name = "spbill_create_ip")
|
||||
private String clientIp;
|
||||
|
||||
protected MPPayment() {
|
||||
protected CorpPayment() {
|
||||
// jaxb required
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class MPPayment implements Serializable {
|
||||
* @param amount 金额
|
||||
* @param clientIp 调用接口IP
|
||||
*/
|
||||
public MPPayment(String outTradeNo, String openId,
|
||||
public CorpPayment(String outTradeNo, String openId,
|
||||
MPPaymentCheckNameType checkNameType, String desc, double amount,
|
||||
String clientIp) {
|
||||
this.outTradeNo = outTradeNo;
|
||||
@@ -124,7 +124,7 @@ public class MPPayment implements Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MPPayment [outTradeNo=" + outTradeNo + ", openId=" + openId
|
||||
return "CorpPayment [outTradeNo=" + outTradeNo + ", openId=" + openId
|
||||
+ ", checkNameType=" + checkNameType + ", userName=" + userName
|
||||
+ ", desc=" + desc + ", amount=" + amount + ", clientIp="
|
||||
+ clientIp + "]";
|
||||
+4
-4
@@ -14,7 +14,7 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
/**
|
||||
* 企业付款记录
|
||||
*
|
||||
* @className MPPaymentRecord
|
||||
* @className CorpPaymentRecord
|
||||
* @author jy
|
||||
* @date 2015年6月23日
|
||||
* @since JDK 1.6
|
||||
@@ -22,7 +22,7 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
*/
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class MPPaymentRecord extends ApiResult {
|
||||
public class CorpPaymentRecord extends ApiResult {
|
||||
|
||||
private static final long serialVersionUID = -1926873539419750498L;
|
||||
|
||||
@@ -94,7 +94,7 @@ public class MPPaymentRecord extends ApiResult {
|
||||
@XmlElement(name = "check_name_result")
|
||||
private String checkNameResult;
|
||||
|
||||
protected MPPaymentRecord() {
|
||||
protected CorpPaymentRecord() {
|
||||
// jaxb required
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public class MPPaymentRecord extends ApiResult {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MPPaymentRecord [transactionId=" + transactionId
|
||||
return "CorpPaymentRecord [transactionId=" + transactionId
|
||||
+ ", outTradeNo=" + outTradeNo + ", transactionStatus="
|
||||
+ getFormatTransactionStatus() + ", failureReason="
|
||||
+ failureReason + ", openId=" + openId + ", transferName="
|
||||
+4
-4
@@ -10,7 +10,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
/**
|
||||
* 企业付款结果
|
||||
*
|
||||
* @className MPPaymentResult
|
||||
* @className CorpPaymentResult
|
||||
* @author jy
|
||||
* @date 2015年4月1日
|
||||
* @since JDK 1.6
|
||||
@@ -18,7 +18,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
*/
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class MPPaymentResult extends ApiResult {
|
||||
public class CorpPaymentResult extends ApiResult {
|
||||
|
||||
private static final long serialVersionUID = 1110472826089211646L;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class MPPaymentResult extends ApiResult {
|
||||
@XmlElement(name = "payment_time")
|
||||
private String paymentTime;
|
||||
|
||||
protected MPPaymentResult() {
|
||||
protected CorpPaymentResult() {
|
||||
// jaxb required
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class MPPaymentResult extends ApiResult {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MPPaymentResult [transactionId=" + transactionId
|
||||
return "CorpPaymentResult [transactionId=" + transactionId
|
||||
+ ", outTradeNo=" + outTradeNo + ", paymentTime=" + paymentTime
|
||||
+ "]";
|
||||
}
|
||||
Reference in New Issue
Block a user