repo
stringclasses
1k values
file_url
stringlengths
96
373
file_path
stringlengths
11
294
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
6 values
commit_sha
stringclasses
1k values
retrieved_at
stringdate
2026-01-04 14:45:56
2026-01-04 18:30:23
truncated
bool
2 classes
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ProfitSharingServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ProfitSharingServiceImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.notify.SignatureHeader; import com.github.binarywang.wxpay.bean.profitsharing.notify.ProfitSharingNotifyV3Response; import com.github.binarywang.wxpay.bean.profitsharing.notify.ProfitSharingNotifyV3Result; import com.github.binarywang.wxpay.bean.profitsharing.request.*; import com.github.binarywang.wxpay.bean.profitsharing.result.*; import com.github.binarywang.wxpay.bean.result.BaseWxPayResult; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.exception.WxSignTestException; import com.github.binarywang.wxpay.service.ProfitSharingService; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.v3.auth.Verifier; import com.github.binarywang.wxpay.v3.util.AesUtils; import com.github.binarywang.wxpay.v3.util.RsaCryptoUtil; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.commons.lang3.StringUtils; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.security.GeneralSecurityException; import java.util.Objects; /** * @author Wang GuangXin 2019/10/22 10:13 * @version 1.0 */ public class ProfitSharingServiceImpl implements ProfitSharingService { private WxPayService payService; private static final Gson GSON = new GsonBuilder().create(); public ProfitSharingServiceImpl(WxPayService payService) { this.payService = payService; } @Override public ProfitSharingResult profitSharing(ProfitSharingRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/secapi/pay/profitsharing"; String responseContent = this.payService.post(url, request.toXML(), true); ProfitSharingResult result = BaseWxPayResult.fromXML(responseContent, ProfitSharingResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; } @Override public ProfitSharingResult multiProfitSharing(ProfitSharingRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/secapi/pay/multiprofitsharing"; String responseContent = this.payService.post(url, request.toXML(), true); ProfitSharingResult result = BaseWxPayResult.fromXML(responseContent, ProfitSharingResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; } @Override public ProfitSharingV3Result profitSharingV3(ProfitSharingV3Request request) throws WxPayException { String url = String.format("%s/v3/profitsharing/orders", this.payService.getPayBaseUrl()); RsaCryptoUtil.encryptFields(request, this.payService.getConfig().getVerifier().getValidCertificate()); String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(result, ProfitSharingV3Result.class); } @Override public ProfitSharingResult profitSharingFinish(ProfitSharingUnfreezeRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/secapi/pay/profitsharingfinish"; String responseContent = this.payService.post(url, request.toXML(), true); ProfitSharingResult result = BaseWxPayResult.fromXML(responseContent, ProfitSharingResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; } @Override public ProfitSharingReceiverResult addReceiver(ProfitSharingReceiverRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/pay/profitsharingaddreceiver"; String responseContent = this.payService.post(url, request.toXML(), true); ProfitSharingReceiverResult result = BaseWxPayResult.fromXML(responseContent, ProfitSharingReceiverResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; } @Override public ProfitSharingReceiverResult removeReceiver(ProfitSharingReceiverRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/pay/profitsharingremovereceiver"; String responseContent = this.payService.post(url, request.toXML(), true); ProfitSharingReceiverResult result = BaseWxPayResult.fromXML(responseContent, ProfitSharingReceiverResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; } @Override public ProfitSharingReceiverV3Result addReceiverV3(ProfitSharingReceiverV3Request request) throws WxPayException { String url = String.format("%s/v3/profitsharing/receivers/add", this.payService.getPayBaseUrl()); RsaCryptoUtil.encryptFields(request, this.payService.getConfig().getVerifier().getValidCertificate()); String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(result, ProfitSharingReceiverV3Result.class); } @Override public ProfitSharingReceiverV3Result removeReceiverV3(ProfitSharingReceiverV3Request request) throws WxPayException { String url = String.format("%s/v3/profitsharing/receivers/delete", this.payService.getPayBaseUrl()); RsaCryptoUtil.encryptFields(request, this.payService.getConfig().getVerifier().getValidCertificate()); String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(result, ProfitSharingReceiverV3Result.class); } @Override public ProfitSharingQueryResult profitSharingQuery(ProfitSharingQueryRequest request) throws WxPayException { request.setAppid(null); request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/pay/profitsharingquery"; String responseContent = this.payService.post(url, request.toXML(), true); ProfitSharingQueryResult result = BaseWxPayResult.fromXML(responseContent, ProfitSharingQueryResult.class); result.formatReceivers(); result.checkResult(this.payService, request.getSignType(), true); return result; } @Override public ProfitSharingV3Result profitSharingQueryV3(String outOrderNo, String transactionId) throws WxPayException { String url = String.format("%s/v3/profitsharing/orders/%s?transaction_id=%s", this.payService.getPayBaseUrl(), outOrderNo, transactionId); String result = this.payService.getV3(url); return GSON.fromJson(result, ProfitSharingV3Result.class); } @Override public ProfitSharingV3Result profitSharingQueryV3(String outOrderNo, String transactionId, String subMchId) throws WxPayException { String url = String.format("%s/v3/profitsharing/orders/%s?sub_mchid=%s&transaction_id=%s", this.payService.getPayBaseUrl(), outOrderNo, subMchId, transactionId); String result = this.payService.getV3(url); return GSON.fromJson(result, ProfitSharingV3Result.class); } @Override public ProfitSharingV3Result profitSharingQueryV3(ProfitSharingQueryV3Request request) throws WxPayException { String url = String.format("%s/v3/profitsharing/orders/%s?transaction_id=%s", this.payService.getPayBaseUrl(), request.getOutOrderNo(), request.getTransactionId()); if(StringUtils.isNotEmpty(request.getSubMchId())){ url += "&sub_mchid=" + request.getSubMchId(); } String result = this.payService.getV3(url); return GSON.fromJson(result, ProfitSharingV3Result.class); } @Override public ProfitSharingOrderAmountQueryResult profitSharingOrderAmountQuery(ProfitSharingOrderAmountQueryRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/pay/profitsharingorderamountquery"; final String responseContent = payService.post(url, request.toXML(), true); ProfitSharingOrderAmountQueryResult result = BaseWxPayResult.fromXML(responseContent, ProfitSharingOrderAmountQueryResult.class); result.checkResult(payService, request.getSignType(), true); return result; } @Override public ProfitSharingOrderAmountQueryV3Result profitSharingUnsplitAmountQueryV3(String transactionId) throws WxPayException { String url = String.format("%s/v3/profitsharing/transactions/%s/amounts", this.payService.getPayBaseUrl(), transactionId); String result = this.payService.getV3(url); return GSON.fromJson(result, ProfitSharingOrderAmountQueryV3Result.class); } @Override public ProfitSharingMerchantRatioQueryResult profitSharingMerchantRatioQuery(ProfitSharingMerchantRatioQueryRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/pay/profitsharingmerchantratioquery"; final String responseContent = payService.post(url, request.toXML(), true); ProfitSharingMerchantRatioQueryResult result = BaseWxPayResult.fromXML(responseContent, ProfitSharingMerchantRatioQueryResult.class); result.checkResult(payService, request.getSignType(), true); return result; } @Override public ProfitSharingMerchantRatioQueryV3Result profitSharingMerchantRatioQueryV3(String subMchId) throws WxPayException { String url = String.format("%s/v3/profitsharing/merchant-configs/%s", this.payService.getPayBaseUrl(), subMchId); String result = this.payService.getV3(url); return GSON.fromJson(result, ProfitSharingMerchantRatioQueryV3Result.class); } @Override public ProfitSharingReturnResult profitSharingReturn(ProfitSharingReturnRequest returnRequest) throws WxPayException { returnRequest.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/secapi/pay/profitsharingreturn"; String responseContent = this.payService.post(url, returnRequest.toXML(), true); ProfitSharingReturnResult result = BaseWxPayResult.fromXML(responseContent, ProfitSharingReturnResult.class); result.checkResult(this.payService, returnRequest.getSignType(), true); return result; } @Override public ProfitSharingReturnV3Result profitSharingReturnV3(ProfitSharingReturnV3Request request) throws WxPayException { String url = String.format("%s/v3/profitsharing/return-orders", this.payService.getPayBaseUrl()); RsaCryptoUtil.encryptFields(request, this.payService.getConfig().getVerifier().getValidCertificate()); String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(result, ProfitSharingReturnV3Result.class); } @Override public ProfitSharingReturnResult profitSharingReturnQuery(ProfitSharingReturnQueryRequest queryRequest) throws WxPayException { queryRequest.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/pay/profitsharingreturnquery"; String responseContent = this.payService.post(url, queryRequest.toXML(), true); ProfitSharingReturnResult result = BaseWxPayResult.fromXML(responseContent, ProfitSharingReturnResult.class); result.checkResult(this.payService, queryRequest.getSignType(), true); return result; } @Override public ProfitSharingReturnV3Result profitSharingReturnQueryV3(String outOrderNo, String outReturnNo) throws WxPayException { String url = String.format("%s/v3/profitsharing/return-orders/%s?out_order_no=%s", this.payService.getPayBaseUrl(), outReturnNo, outOrderNo); String result = this.payService.getV3(url); return GSON.fromJson(result, ProfitSharingReturnV3Result.class); } @Override public ProfitSharingReturnV3Result profitSharingReturnQueryV3(String outOrderNo, String outReturnNo, String subMchId) throws WxPayException { String url = String.format("%s/v3/profitsharing/return-orders/%s?sub_mchid=%s&out_order_no=%s", this.payService.getPayBaseUrl(), outReturnNo, subMchId, outOrderNo); String result = this.payService.getV3(url); return GSON.fromJson(result, ProfitSharingReturnV3Result.class); } @Override public ProfitSharingUnfreezeV3Result profitSharingUnfreeze(ProfitSharingUnfreezeV3Request request) throws WxPayException { String url = String.format("%s/v3/profitsharing/orders/unfreeze", this.payService.getPayBaseUrl()); RsaCryptoUtil.encryptFields(request, this.payService.getConfig().getVerifier().getValidCertificate()); String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(result, ProfitSharingUnfreezeV3Result.class); } @Override public ProfitSharingNotifyV3Result parseProfitSharingNotifyResult(String notifyData, SignatureHeader header) throws WxPayException { ProfitSharingNotifyV3Response response = parseNotifyData(notifyData, header); ProfitSharingNotifyV3Response.Resource resource = response.getResource(); String cipherText = resource.getCipherText(); String associatedData = resource.getAssociatedData(); String nonce = resource.getNonce(); String apiV3Key = this.payService.getConfig().getApiV3Key(); try { String result = AesUtils.decryptToString(associatedData, nonce, cipherText, apiV3Key); return GSON.fromJson(result, ProfitSharingNotifyV3Result.class); } catch (GeneralSecurityException | IOException e) { throw new WxPayException("解析报文异常!", e); } } @Override public ProfitSharingBillV3Result profitSharingBill(ProfitSharingBillV3Request request) throws WxPayException { String url = String.format("%s/v3/profitsharing/bills?bill_date=%s", this.payService.getPayBaseUrl(), request.getBillDate()); if (StringUtils.isNotBlank(request.getSubMchId())) { url = String.format("%s&sub_mchid=%s", url, request.getSubMchId()); } if (StringUtils.isNotBlank(request.getTarType())) { url = String.format("%s&tar_type=%s", url, request.getTarType()); } String result = this.payService.getV3(url); return GSON.fromJson(result, ProfitSharingBillV3Result.class); } private ProfitSharingNotifyV3Response parseNotifyData(String data, SignatureHeader header) throws WxPayException { if (Objects.nonNull(header) && !this.verifyNotifySign(header, data)) { throw new WxPayException("非法请求,头部信息验证失败"); } return GSON.fromJson(data, ProfitSharingNotifyV3Response.class); } /** * 校验通知签名 * * @param header 通知头信息 * @param data 通知数据 * @return true:校验通过 false:校验不通过 */ private boolean verifyNotifySign(SignatureHeader header, String data) throws WxPayException { String wxPaySign = header.getSignature(); if (wxPaySign.startsWith("WECHATPAY/SIGNTEST/")) { throw new WxSignTestException("微信支付签名探测流量"); } String beforeSign = String.format("%s\n%s\n%s\n", header.getTimeStamp(), header.getNonce(), data); Verifier verifier = this.payService.getConfig().getVerifier(); if (verifier == null) { throw new WxPayException("证书检验对象为空"); } return verifier.verify(header.getSerial(), beforeSign.getBytes(StandardCharsets.UTF_8), header.getSignature()); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
package com.github.binarywang.wxpay.service.impl; import static com.github.binarywang.wxpay.constant.WxPayConstants.QUERY_COMMENT_DATE_FORMAT; import static com.github.binarywang.wxpay.constant.WxPayConstants.TarType; import com.github.binarywang.wxpay.bean.coupon.*; import com.github.binarywang.wxpay.bean.notify.*; import com.github.binarywang.wxpay.bean.request.*; import com.github.binarywang.wxpay.bean.result.*; import com.github.binarywang.wxpay.service.*; import java.util.*; import com.github.binarywang.wxpay.bean.result.enums.GlobalTradeTypeEnum; import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum; import com.github.binarywang.utils.qrcode.QrcodeUtils; import com.github.binarywang.wxpay.bean.WxPayApiData; import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult; import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; import com.github.binarywang.wxpay.bean.order.WxPayMwebOrderResult; import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult; import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult; import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.config.WxPayConfigHolder; import com.github.binarywang.wxpay.constant.WxPayConstants.SignType; import com.github.binarywang.wxpay.constant.WxPayConstants.TradeType; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.exception.WxSignTestException; import com.github.binarywang.wxpay.util.SignUtils; import com.github.binarywang.wxpay.util.XmlConfig; import com.github.binarywang.wxpay.util.ZipUtils; import com.github.binarywang.wxpay.v3.util.AesUtils; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.security.GeneralSecurityException; import java.util.concurrent.ConcurrentHashMap; import java.util.zip.ZipException; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxRuntimeException; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.reflect.ConstructorUtils; import org.apache.http.entity.ContentType; /** * <pre> * 微信支付接口请求抽象实现类 * Created by Binary Wang on 2017-7-8. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Slf4j public abstract class BaseWxPayServiceImpl implements WxPayService { private static final String TOTAL_FUND_COUNT = "资金流水总笔数"; private static final Gson GSON = new GsonBuilder().create(); static final ThreadLocal<WxPayApiData> wxApiData = new ThreadLocal<>(); @Setter @Getter private EntPayService entPayService = new EntPayServiceImpl(this); @Getter private final ProfitSharingService profitSharingService = new ProfitSharingServiceImpl(this); @Getter private final RedpackService redpackService = new RedpackServiceImpl(this); @Getter private final PayScoreService payScoreService = new PayScoreServiceImpl(this); @Getter private final EcommerceService ecommerceService = new EcommerceServiceImpl(this); @Getter private final BusinessCircleService businessCircleService = new BusinessCircleServiceImpl(this); @Getter private final MerchantMediaService merchantMediaService = new MerchantMediaServiceImpl(this); @Getter private final MarketingMediaService marketingMediaService = new MarketingMediaServiceImpl(this); @Getter private final MarketingFavorService marketingFavorService = new MarketingFavorServiceImpl(this); @Getter private final MarketingBusiFavorService marketingBusiFavorService = new MarketingBusiFavorServiceImpl(this); @Getter private final WxEntrustPapService wxEntrustPapService = new WxEntrustPapServiceImpl(this); @Getter private final WxDepositService wxDepositService = new WxDepositServiceImpl(this); @Getter private final PartnerTransferService partnerTransferService = new PartnerTransferServiceImpl(this); @Getter private final PayrollService payrollService = new PayrollServiceImpl(this); @Getter private final ComplaintService complaintsService = new ComplaintServiceImpl(this); @Getter private final BankService bankService = new BankServiceImpl(this); @Getter private final TransferService transferService = new TransferServiceImpl(this); @Getter private final PartnerPayScoreService partnerPayScoreService = new PartnerPayScoreServiceImpl(this); @Getter private final PartnerPayScoreSignPlanService partnerPayScoreSignPlanService = new PartnerPayScoreSignPlanServiceImpl(this); @Getter private final MerchantTransferService merchantTransferService = new MerchantTransferServiceImpl(this); @Getter private final BrandMerchantTransferService brandMerchantTransferService = new BrandMerchantTransferServiceImpl(this); @Getter private final SubscriptionBillingService subscriptionBillingService = new SubscriptionBillingServiceImpl(this); @Getter private final BusinessOperationTransferService businessOperationTransferService = new BusinessOperationTransferServiceImpl(this); @Getter private final RealNameService realNameService = new RealNameServiceImpl(this); @Getter private final MiPayService miPayService = new MiPayServiceImpl(this); protected Map<String, WxPayConfig> configMap = new ConcurrentHashMap<>(); @Override public WxPayConfig getConfig() { if (this.configMap.size() == 1) { // 只有一个商户号,直接返回其配置即可 return this.configMap.values().iterator().next(); } return this.configMap.get(WxPayConfigHolder.get()); } @Override public void setConfig(WxPayConfig config) { final String defaultKey = this.getConfigKey(config.getMchId(), config.getAppId()); this.setMultiConfig(ImmutableMap.of(defaultKey, config), defaultKey); } @Override public void addConfig(String mchId, String appId, WxPayConfig wxPayConfig) { synchronized (this) { if (this.configMap == null) { this.setConfig(wxPayConfig); } else { String configKey = this.getConfigKey(mchId, appId); WxPayConfigHolder.set(configKey); this.configMap.put(configKey, wxPayConfig); } } } @Override public void removeConfig(String mchId, String appId) { synchronized (this) { String configKey = this.getConfigKey(mchId, appId); this.configMap.remove(configKey); if (this.configMap.isEmpty()) { log.warn("已删除最后一个商户号配置:mchId[{}],appid[{}],须立即使用setConfig或setMultiConfig添加配置", mchId, appId); return; } if (WxPayConfigHolder.get().equals(configKey)) { final String nextConfigKey = this.configMap.keySet().iterator().next(); WxPayConfigHolder.set(nextConfigKey); log.warn("已删除默认商户号配置,商户号【{}】被设为默认配置", nextConfigKey); } } } @Override public void setMultiConfig(Map<String, WxPayConfig> wxPayConfigs) { this.setMultiConfig(wxPayConfigs, wxPayConfigs.keySet().iterator().next()); } @Override public void setMultiConfig(Map<String, WxPayConfig> wxPayConfigs, String defaultConfigKey) { this.configMap = Maps.newHashMap(wxPayConfigs); WxPayConfigHolder.set(defaultConfigKey); } @Override public boolean switchover(String mchId, String appId) { String configKey = this.getConfigKey(mchId, appId); if (this.configMap.containsKey(configKey)) { WxPayConfigHolder.set(configKey); return true; } log.error("无法找到对应mchId=【{}】,appId=【{}】的商户号配置信息,请核实!", mchId, appId); return false; } @Override public WxPayService switchoverTo(String mchId, String appId) { String configKey = this.getConfigKey(mchId, appId); if (this.configMap.containsKey(configKey)) { WxPayConfigHolder.set(configKey); return this; } throw new WxRuntimeException(String.format("无法找到对应mchId=【%s】,appId=【%s】的商户号配置信息,请核实!", mchId, appId)); } public String getConfigKey(String mchId, String appId) { return mchId + "_" + appId; } @Override public String getPayBaseUrl() { if (this.getConfig().isUseSandboxEnv()) { if (StringUtils.isNotBlank(this.getConfig().getApiV3Key())) { throw new WxRuntimeException("微信支付V3 目前不支持沙箱模式!"); } return this.getConfig().getApiHostUrl() + "/xdc/apiv2sandbox"; } return this.getConfig().getApiHostUrl(); } @Override public WxPayRefundResult refund(WxPayRefundRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/secapi/pay/refund"; String responseContent = this.post(url, request.toXML(), true); WxPayRefundResult result = BaseWxPayResult.fromXML(responseContent, WxPayRefundResult.class); result.composeRefundCoupons(); result.checkResult(this, request.getSignType(), true); return result; } @Override public WxPayRefundResult refundV2(WxPayRefundRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/secapi/pay/refundv2"; String responseContent = this.post(url, request.toXML(), true); WxPayRefundResult result = BaseWxPayResult.fromXML(responseContent, WxPayRefundResult.class); result.composePromotionDetails(); result.checkResult(this, request.getSignType(), true); return result; } @Override public WxPayRefundV3Result refundV3(WxPayRefundV3Request request) throws WxPayException { String url = String.format("%s/v3/refund/domestic/refunds", this.getPayBaseUrl()); String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(response, WxPayRefundV3Result.class); } @Override public WxPayRefundV3Result partnerRefundV3(WxPayPartnerRefundV3Request request) throws WxPayException { if (StringUtils.isBlank(request.getSubMchid())) { request.setSubMchid(this.getConfig().getSubMchId()); } String url = String.format("%s/v3/refund/domestic/refunds", this.getPayBaseUrl()); String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(response, WxPayRefundV3Result.class); } @Override public WxPayRefundQueryResult refundQuery(String transactionId, String outTradeNo, String outRefundNo, String refundId) throws WxPayException { WxPayRefundQueryRequest request = new WxPayRefundQueryRequest(); request.setOutTradeNo(StringUtils.trimToNull(outTradeNo)); request.setTransactionId(StringUtils.trimToNull(transactionId)); request.setOutRefundNo(StringUtils.trimToNull(outRefundNo)); request.setRefundId(StringUtils.trimToNull(refundId)); return this.refundQuery(request); } @Override public WxPayRefundQueryResult refundQuery(WxPayRefundQueryRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/pay/refundquery"; String responseContent = this.post(url, request.toXML(), false); WxPayRefundQueryResult result = BaseWxPayResult.fromXML(responseContent, WxPayRefundQueryResult.class); result.composeRefundRecords(); result.checkResult(this, request.getSignType(), true); return result; } @Override public WxPayRefundQueryResult refundQueryV2(WxPayRefundQueryRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/pay/refundqueryv2"; String responseContent = this.post(url, request.toXML(), false); WxPayRefundQueryResult result = BaseWxPayResult.fromXML(responseContent, WxPayRefundQueryResult.class); result.composePromotionDetails(); result.checkResult(this, request.getSignType(), true); return result; } @Override public WxPayRefundQueryV3Result refundQueryV3(String outRefundNo) throws WxPayException { String url = String.format("%s/v3/refund/domestic/refunds/%s", this.getPayBaseUrl(), outRefundNo); String response = this.getV3WithWechatPaySerial(url); return GSON.fromJson(response, WxPayRefundQueryV3Result.class); } @Override public WxPayRefundQueryV3Result refundQueryV3(WxPayRefundQueryV3Request request) throws WxPayException { String url = String.format("%s/v3/refund/domestic/refunds/%s", this.getPayBaseUrl(), request.getOutRefundNo()); String response = this.getV3WithWechatPaySerial(url); return GSON.fromJson(response, WxPayRefundQueryV3Result.class); } @Override public WxPayRefundQueryV3Result refundPartnerQueryV3(WxPayRefundQueryV3Request request) throws WxPayException { String url = String.format("%s/v3/refund/domestic/refunds/%s?sub_mchid=%s", this.getPayBaseUrl(), request.getOutRefundNo(), request.getSubMchid()); String response = this.getV3WithWechatPaySerial(url); return GSON.fromJson(response, WxPayRefundQueryV3Result.class); } @Override public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData) throws WxPayException { return this.parseOrderNotifyResult(xmlData, null); } @Override public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String signType) throws WxPayException { try { log.debug("微信支付异步通知请求参数:{}", xmlData); // 检测数据格式并给出适当的处理建议 if (xmlData != null && xmlData.trim().startsWith("{")) { throw new WxPayException("检测到V3版本的JSON格式通知数据,请使用parseOrderNotifyV3Result方法解析。" + " V3 API需要传入SignatureHeader参数进行签名验证。"); } WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlData); if (signType == null) { this.switchover(result.getMchId(), result.getAppid()); if (result.getSignType() != null) { // 如果解析的通知对象中signType有值,则使用它进行验签 signType = result.getSignType(); } else if (this.getConfig().getSignType() != null) { // 如果配置中signType有值,则使用它进行验签 signType = this.getConfig().getSignType(); } } log.debug("微信支付异步通知请求解析后的对象:{}", result); result.checkResult(this, signType, false); return result; } catch (WxPayException e) { throw e; } catch (Exception e) { throw new WxPayException("发生异常!", e); } } /** * 校验通知签名 * * @param header 通知头信息 * @param data 通知数据 * @return true:校验通过 false:校验不通过 */ private boolean verifyNotifySign(SignatureHeader header, String data) throws WxSignTestException { String wxPaySign = header.getSignature(); if (wxPaySign.startsWith("WECHATPAY/SIGNTEST/")) { throw new WxSignTestException("微信支付签名探测流量"); } String beforeSign = String.format("%s\n%s\n%s\n", header.getTimeStamp(), header.getNonce(), data); return this.getConfig().getVerifier().verify(header.getSerial(), beforeSign.getBytes(StandardCharsets.UTF_8), header.getSignature()); } @Override public WxPayNotifyV3Result parseOrderNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException { return baseParseOrderNotifyV3Result(notifyData, header, WxPayNotifyV3Result.class, WxPayNotifyV3Result.DecryptNotifyResult.class); } @Override public WxPayPartnerNotifyV3Result parsePartnerOrderNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException { return this.baseParseOrderNotifyV3Result(notifyData, header, WxPayPartnerNotifyV3Result.class, WxPayPartnerNotifyV3Result.DecryptNotifyResult.class); } @Override public <T extends WxPayBaseNotifyV3Result<E>, E> T baseParseOrderNotifyV3Result(String notifyData, SignatureHeader header, Class<T> resultType, Class<E> dataType) throws WxPayException { if (Objects.nonNull(header) && !this.verifyNotifySign(header, notifyData)) { throw new WxPayException("非法请求,头部信息验证失败"); } OriginNotifyResponse response = GSON.fromJson(notifyData, OriginNotifyResponse.class); OriginNotifyResponse.Resource resource = response.getResource(); String cipherText = resource.getCiphertext(); String associatedData = resource.getAssociatedData(); String nonce = resource.getNonce(); String apiV3Key = this.getConfig().getApiV3Key(); try { String result = AesUtils.decryptToString(associatedData, nonce, cipherText, apiV3Key); E decryptNotifyResult = GSON.fromJson(result, dataType); T notifyResult = ConstructorUtils.invokeConstructor(resultType); notifyResult.setRawData(response); notifyResult.setResult(decryptNotifyResult); return notifyResult; } catch (Exception e) { throw new WxPayException("解析报文异常!", e); } } @Override public CombineNotifyResult parseCombineNotifyResult(String notifyData, SignatureHeader header) throws WxPayException { if (Objects.nonNull(header) && !this.verifyNotifySign(header, notifyData)) { throw new WxPayException("非法请求,头部信息验证失败"); } OriginNotifyResponse response = GSON.fromJson(notifyData, OriginNotifyResponse.class); OriginNotifyResponse.Resource resource = response.getResource(); String cipherText = resource.getCiphertext(); String associatedData = resource.getAssociatedData(); String nonce = resource.getNonce(); String apiV3Key = this.getConfig().getApiV3Key(); try { String result = AesUtils.decryptToString(associatedData, nonce, cipherText, apiV3Key); CombineNotifyResult.DecryptNotifyResult decryptNotifyResult = GSON.fromJson(result, CombineNotifyResult.DecryptNotifyResult.class); CombineNotifyResult notifyResult = new CombineNotifyResult(); notifyResult.setRawData(response); notifyResult.setResult(decryptNotifyResult); return notifyResult; } catch (GeneralSecurityException | IOException e) { throw new WxPayException("解析报文异常!", e); } } @Override public WxPayRefundNotifyResult parseRefundNotifyResult(String xmlData) throws WxPayException { try { log.debug("微信支付退款异步通知参数:{}", xmlData); WxPayRefundNotifyResult result; if (XmlConfig.fastMode) { result = BaseWxPayResult.fromXML(xmlData, WxPayRefundNotifyResult.class); this.switchover(result.getMchId(), result.getAppid()); result.decryptReqInfo(this.getConfig().getMchKey()); } else { result = WxPayRefundNotifyResult.fromXML(xmlData, this.getConfig().getMchKey()); } log.debug("微信支付退款异步通知解析后的对象:{}", result); return result; } catch (Exception e) { throw new WxPayException("发生异常," + e.getMessage(), e); } } @Override public WxPayRefundNotifyV3Result parseRefundNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException { return this.baseParseOrderNotifyV3Result(notifyData, header, WxPayRefundNotifyV3Result.class, WxPayRefundNotifyV3Result.DecryptNotifyResult.class); } @Override public WxPayTransferBatchesNotifyV3Result parseTransferBatchesNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException { return this.baseParseOrderNotifyV3Result(notifyData, header, WxPayTransferBatchesNotifyV3Result.class, WxPayTransferBatchesNotifyV3Result.DecryptNotifyResult.class); } @Override public TransferBillsNotifyResult parseTransferBillsNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException { return this.baseParseOrderNotifyV3Result(notifyData, header, TransferBillsNotifyResult.class, TransferBillsNotifyResult.DecryptNotifyResult.class); } @Override public WxPayPartnerRefundNotifyV3Result parsePartnerRefundNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException { return this.baseParseOrderNotifyV3Result(notifyData, header, WxPayPartnerRefundNotifyV3Result.class, WxPayPartnerRefundNotifyV3Result.DecryptNotifyResult.class); } @Override public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData, @Deprecated String signType) throws WxPayException { try { log.debug("扫码支付回调通知请求参数:{}", xmlData); WxScanPayNotifyResult result = BaseWxPayResult.fromXML(xmlData, WxScanPayNotifyResult.class); this.switchover(result.getMchId(), result.getAppid()); log.debug("扫码支付回调通知解析后的对象:{}", result); result.checkResult(this, this.getConfig().getSignType(), false); return result; } catch (WxPayException e) { throw e; } catch (Exception e) { throw new WxPayException("发生异常," + e.getMessage(), e); } } @Override public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData) throws WxPayException { // final String signType = this.getConfig().getSignType(); return this.parseScanPayNotifyResult(xmlData, null); } @Override public WxPayOrderQueryResult queryOrder(String transactionId, String outTradeNo) throws WxPayException { WxPayOrderQueryRequest request = new WxPayOrderQueryRequest(); request.setOutTradeNo(StringUtils.trimToNull(outTradeNo)); request.setTransactionId(StringUtils.trimToNull(transactionId)); return this.queryOrder(request); } @Override public WxPayOrderQueryResult queryOrder(WxPayOrderQueryRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/pay/orderquery"; String responseContent = this.post(url, request.toXML(), false); if (StringUtils.isBlank(responseContent)) { throw new WxPayException("无响应结果"); } WxPayOrderQueryResult result = BaseWxPayResult.fromXML(responseContent, WxPayOrderQueryResult.class); result.composeCoupons(); result.checkResult(this, request.getSignType(), true); return result; } @Override public WxPayOrderQueryV3Result queryOrderV3(String transactionId, String outTradeNo) throws WxPayException { WxPayOrderQueryV3Request request = new WxPayOrderQueryV3Request(); request.setOutTradeNo(StringUtils.trimToNull(outTradeNo)); request.setTransactionId(StringUtils.trimToNull(transactionId)); return this.queryOrderV3(request); } @Override public WxPayOrderQueryV3Result queryOrderV3(WxPayOrderQueryV3Request request) throws WxPayException { if (StringUtils.isBlank(request.getMchid())) { request.setMchid(this.getConfig().getMchId()); } String url = String.format("%s/v3/pay/transactions/out-trade-no/%s", this.getPayBaseUrl(), request.getOutTradeNo()); if (Objects.isNull(request.getOutTradeNo())) { url = String.format("%s/v3/pay/transactions/id/%s", this.getPayBaseUrl(), request.getTransactionId()); } String query = String.format("?mchid=%s", request.getMchid()); String response = this.getV3WithWechatPaySerial(url + query); return GSON.fromJson(response, WxPayOrderQueryV3Result.class); } @Override public WxPayPartnerOrderQueryV3Result queryPartnerOrderV3(String transactionId, String outTradeNo) throws WxPayException { WxPayPartnerOrderQueryV3Request request = new WxPayPartnerOrderQueryV3Request(); request.setOutTradeNo(StringUtils.trimToNull(outTradeNo)); request.setTransactionId(StringUtils.trimToNull(transactionId)); return this.queryPartnerOrderV3(request); } @Override public WxPayPartnerOrderQueryV3Result queryPartnerOrderV3(WxPayPartnerOrderQueryV3Request request) throws WxPayException { if (StringUtils.isBlank(request.getSpMchId())) { request.setSpMchId(this.getConfig().getMchId()); } if (StringUtils.isBlank(request.getSubMchId())) { request.setSubMchId(this.getConfig().getSubMchId()); } String url = String.format("%s/v3/pay/partner/transactions/out-trade-no/%s", this.getPayBaseUrl(), request.getOutTradeNo()); if (Objects.isNull(request.getOutTradeNo())) { url = String.format("%s/v3/pay/partner/transactions/id/%s", this.getPayBaseUrl(), request.getTransactionId()); } String query = String.format("?sp_mchid=%s&sub_mchid=%s", request.getSpMchId(), request.getSubMchId()); String response = this.getV3WithWechatPaySerial(url + query); return GSON.fromJson(response, WxPayPartnerOrderQueryV3Result.class); } @Override public CombineQueryResult queryCombine(String combineOutTradeNo) throws WxPayException { String url = String.format("%s/v3/combine-transactions/out-trade-no/%s", this.getPayBaseUrl(), combineOutTradeNo); String response = this.getV3WithWechatPaySerial(url); return GSON.fromJson(response, CombineQueryResult.class); } @Override public WxPayOrderCloseResult closeOrder(String outTradeNo) throws WxPayException { if (StringUtils.isBlank(outTradeNo)) { throw new WxPayException("out_trade_no不能为空"); } WxPayOrderCloseRequest request = new WxPayOrderCloseRequest(); request.setOutTradeNo(StringUtils.trimToNull(outTradeNo)); return this.closeOrder(request); } @Override public WxPayOrderCloseResult closeOrder(WxPayOrderCloseRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/pay/closeorder"; String responseContent = this.post(url, request.toXML(), false); WxPayOrderCloseResult result = BaseWxPayResult.fromXML(responseContent, WxPayOrderCloseResult.class); result.checkResult(this, request.getSignType(), true); return result; } @Override public void closeOrderV3(String outTradeNo) throws WxPayException { if (StringUtils.isBlank(outTradeNo)) { throw new WxPayException("out_trade_no不能为空"); } WxPayOrderCloseV3Request request = new WxPayOrderCloseV3Request(); request.setOutTradeNo(StringUtils.trimToNull(outTradeNo)); this.closeOrderV3(request); } @Override public void closePartnerOrderV3(String outTradeNo) throws WxPayException { if (StringUtils.isBlank(outTradeNo)) { throw new WxPayException("out_trade_no不能为空"); } WxPayPartnerOrderCloseV3Request request = new WxPayPartnerOrderCloseV3Request(); request.setOutTradeNo(StringUtils.trimToNull(outTradeNo)); this.closePartnerOrderV3(request); } @Override public void closeOrderV3(WxPayOrderCloseV3Request request) throws WxPayException { if (StringUtils.isBlank(request.getMchid())) { request.setMchid(this.getConfig().getMchId()); } String url = String.format("%s/v3/pay/transactions/out-trade-no/%s/close", this.getPayBaseUrl(), request.getOutTradeNo()); this.postV3WithWechatpaySerial(url, GSON.toJson(request)); } @Override public void closePartnerOrderV3(WxPayPartnerOrderCloseV3Request request) throws WxPayException { if (StringUtils.isBlank(request.getSpMchId())) { request.setSpMchId(this.getConfig().getMchId()); } if (StringUtils.isBlank(request.getSubMchId())) { request.setSubMchId(this.getConfig().getSubMchId()); } String url = String.format("%s/v3/pay/partner/transactions/out-trade-no/%s/close", this.getPayBaseUrl(), request.getOutTradeNo()); this.postV3WithWechatpaySerial(url, GSON.toJson(request)); } @Override public void closeCombine(CombineCloseRequest request) throws WxPayException { String url = String.format("%s/v3/combine-transactions/out-trade-no/%s/close", this.getPayBaseUrl(), request.getCombineOutTradeNo()); this.postV3WithWechatpaySerial(url, GSON.toJson(request)); } @Override public <T> T createOrder(WxPayUnifiedOrderRequest request) throws WxPayException { WxPayUnifiedOrderResult unifiedOrderResult = this.unifiedOrder(request); String prepayId = unifiedOrderResult.getPrepayId(); if (StringUtils.isBlank(prepayId)) { throw new WxPayException(String.format("无法获取prepay id,错误代码: '%s',信息:%s。", unifiedOrderResult.getErrCode(), unifiedOrderResult.getErrCodeDes())); } String timestamp = String.valueOf(System.currentTimeMillis() / 1000); String nonceStr = unifiedOrderResult.getNonceStr(); switch (request.getTradeType()) { case TradeType.MWEB: { return (T) new WxPayMwebOrderResult(unifiedOrderResult.getMwebUrl()); } case TradeType.NATIVE: { return (T) new WxPayNativeOrderResult(unifiedOrderResult.getCodeURL()); } case TradeType.APP: { // APP支付绑定的是微信开放平台上的账号,APPID为开放平台上绑定APP后发放的参数 String appId = unifiedOrderResult.getAppid(); if (StringUtils.isNotEmpty(unifiedOrderResult.getSubAppId())) { appId = unifiedOrderResult.getSubAppId(); } Map<String, String> configMap = new HashMap<>(8); // 此map用于参与调起sdk支付的二次签名,格式全小写,timestamp只能是10位,格式固定,切勿修改 String partnerId = unifiedOrderResult.getMchId(); if (StringUtils.isNotEmpty(unifiedOrderResult.getSubMchId())) { partnerId = unifiedOrderResult.getSubMchId(); } configMap.put("prepayid", prepayId); configMap.put("partnerid", partnerId); String packageValue = "Sign=WXPay"; configMap.put("package", packageValue); configMap.put("timestamp", timestamp); configMap.put("noncestr", nonceStr); configMap.put("appid", appId); final WxPayAppOrderResult result = WxPayAppOrderResult.builder() .sign(SignUtils.createSign(configMap, request.getSignType(), this.getConfig().getMchKey(), null)) .prepayId(prepayId) .partnerId(partnerId) .appId(appId) .packageValue(packageValue) .timeStamp(timestamp) .nonceStr(nonceStr) .build(); return (T) result; } case TradeType.JSAPI: { String signType = request.getSignType(); if (signType == null) { signType = SignType.MD5; } String appid = unifiedOrderResult.getAppid(); if (StringUtils.isNotEmpty(unifiedOrderResult.getSubAppId())) { appid = unifiedOrderResult.getSubAppId(); } WxPayMpOrderResult payResult = WxPayMpOrderResult.builder() .appId(appid) .timeStamp(timestamp) .nonceStr(nonceStr) .packageValue("prepay_id=" + prepayId) .signType(signType) .build(); payResult.setPaySign(SignUtils.createSign(payResult, signType, this.getConfig().getMchKey(), null)); return (T) payResult; } default: { throw new WxPayException("该交易类型暂不支持"); } } } @Override public <T> T createOrder(TradeType.Specific<T> specificTradeType, WxPayUnifiedOrderRequest request) throws WxPayException { if (specificTradeType == null) { throw new IllegalArgumentException("specificTradeType 不能为 null"); } request.setTradeType(specificTradeType.getType()); return createOrder(request); } @Override public WxPayUnifiedOrderResult unifiedOrder(WxPayUnifiedOrderRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/pay/unifiedorder"; String responseContent = this.post(url, request.toXML(), false); WxPayUnifiedOrderResult result = BaseWxPayResult.fromXML(responseContent, WxPayUnifiedOrderResult.class); result.checkResult(this, request.getSignType(), true); return result; } @Override public <T> T createOrderV3(TradeTypeEnum tradeType, WxPayUnifiedOrderV3Request request) throws WxPayException { WxPayUnifiedOrderV3Result result = this.unifiedOrderV3(tradeType, request); return result.getPayInfo(tradeType, request.getAppid(), request.getMchid(), this.getConfig().getPrivateKey()); } @Override public <T> T createPartnerOrderV3(TradeTypeEnum tradeType, WxPayPartnerUnifiedOrderV3Request request) throws WxPayException { WxPayUnifiedOrderV3Result result = this.unifiedPartnerOrderV3(tradeType, request);
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
true
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MerchantMediaServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MerchantMediaServiceImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.media.ImageUploadResult; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.MerchantMediaService; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.v3.WechatPayUploadHttpPost; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.digest.DigestUtils; import java.io.*; import java.net.URI; /** * 微信支付-媒体文件上传service * @author zhouyongshen */ @Slf4j @RequiredArgsConstructor public class MerchantMediaServiceImpl implements MerchantMediaService { private final WxPayService payService; @Override public ImageUploadResult imageUploadV3(File imageFile) throws WxPayException,IOException { String url = String.format("%s/v3/merchant/media/upload", this.payService.getPayBaseUrl()); try (FileInputStream s1 = new FileInputStream(imageFile)) { String sha256 = DigestUtils.sha256Hex(s1); try (InputStream s2 = new FileInputStream(imageFile)) { WechatPayUploadHttpPost request = new WechatPayUploadHttpPost.Builder(URI.create(url)) .withImage(imageFile.getName(), sha256, s2) .build(); String result = this.payService.postV3(url, request); return ImageUploadResult.fromJson(result); } } } @Override public ImageUploadResult imageUploadV3(InputStream inputStream, String fileName) throws WxPayException, IOException { String url = String.format("%s/v3/merchant/media/upload", this.payService.getPayBaseUrl()); try(ByteArrayOutputStream bos = new ByteArrayOutputStream()) { byte[] buffer = new byte[2048]; int len; while ((len = inputStream.read(buffer)) > -1) { bos.write(buffer, 0, len); } bos.flush(); byte[] data = bos.toByteArray(); String sha256 = DigestUtils.sha256Hex(data); WechatPayUploadHttpPost request = new WechatPayUploadHttpPost.Builder(URI.create(url)) .withImage(fileName, sha256, new ByteArrayInputStream(data)) .build(); String result = this.payService.postV3(url, request); return ImageUploadResult.fromJson(result); } } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BusinessOperationTransferServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BusinessOperationTransferServiceImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.transfer.*; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.BusinessOperationTransferService; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.v3.util.RsaCryptoUtil; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import java.security.cert.X509Certificate; /** * 运营工具-商家转账API实现 * * @author WxJava Team * @see <a href="https://pay.weixin.qq.com/doc/v3/merchant/4012711988">运营工具-商家转账API</a> */ @Slf4j @RequiredArgsConstructor public class BusinessOperationTransferServiceImpl implements BusinessOperationTransferService { private static final Gson GSON = new GsonBuilder().create(); private final WxPayService wxPayService; @Override public BusinessOperationTransferResult createOperationTransfer(BusinessOperationTransferRequest request) throws WxPayException { // 设置默认appid if (StringUtils.isEmpty(request.getAppid())) { request.setAppid(this.wxPayService.getConfig().getAppId()); } String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills", this.wxPayService.getPayBaseUrl()); // 如果传入了用户姓名,需要进行RSA加密 if (StringUtils.isNotEmpty(request.getUserName())) { X509Certificate validCertificate = this.wxPayService.getConfig().getVerifier().getValidCertificate(); RsaCryptoUtil.encryptFields(request, validCertificate); } String response = wxPayService.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(response, BusinessOperationTransferResult.class); } @Override public BusinessOperationTransferQueryResult queryOperationTransfer(BusinessOperationTransferQueryRequest request) throws WxPayException { if (StringUtils.isNotEmpty(request.getOutBillNo())) { return queryOperationTransferByOutBillNo(request.getOutBillNo()); } else if (StringUtils.isNotEmpty(request.getTransferBillNo())) { return queryOperationTransferByTransferBillNo(request.getTransferBillNo()); } else { throw new WxPayException("商户单号(out_bill_no)和微信转账单号(transfer_bill_no)必须提供其中一个"); } } @Override public BusinessOperationTransferQueryResult queryOperationTransferByOutBillNo(String outBillNo) throws WxPayException { String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills/out-bill-no/%s", this.wxPayService.getPayBaseUrl(), outBillNo); String response = wxPayService.getV3(url); return GSON.fromJson(response, BusinessOperationTransferQueryResult.class); } @Override public BusinessOperationTransferQueryResult queryOperationTransferByTransferBillNo(String transferBillNo) throws WxPayException { String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills/transfer-bill-no/%s", this.wxPayService.getPayBaseUrl(), transferBillNo); String response = wxPayService.getV3(url); return GSON.fromJson(response, BusinessOperationTransferQueryResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerPayScoreServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PartnerPayScoreServiceImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader; import com.github.binarywang.wxpay.bean.payscore.*; import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.PartnerPayScoreService; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.v3.util.AesUtils; import com.google.common.collect.Maps; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import lombok.RequiredArgsConstructor; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import org.apache.commons.lang3.StringUtils; import org.apache.http.client.utils.URIBuilder; import java.io.IOException; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import java.security.GeneralSecurityException; import java.util.HashMap; import java.util.Map; import java.util.Objects; /** * @author hallkk * created on 2022/05/18 */ @RequiredArgsConstructor public class PartnerPayScoreServiceImpl implements PartnerPayScoreService { private static final Gson GSON = new GsonBuilder().create(); private final WxPayService payService; @Override public WxPartnerPayScoreResult permissions(WxPartnerPayScoreRequest request) throws WxPayException { String url = this.payService.getPayBaseUrl() + "/v3/payscore/partner/permissions"; request.setAppid(request.getAppid()); request.setServiceId(request.getServiceId()); WxPayConfig config = this.payService.getConfig(); if(StringUtils.isBlank(request.getAppid())){ request.setAppid(config.getAppId()); } if(StringUtils.isBlank((request.getServiceId()))){ request.setServiceId(config.getServiceId()); } if (StringUtils.isBlank(request.getNotifyUrl())) { request.setNotifyUrl(config.getPayScorePermissionNotifyUrl()); } if (StringUtils.isBlank(request.getAuthorizationCode())) { throw new WxPayException("authorizationCode不允许为空"); } String result = this.payService.postV3(url, request.toJson()); return WxPartnerPayScoreResult.fromJson(result); } @Override public WxPartnerPayScoreResult permissionsQueryByAuthorizationCode(String serviceId, String subMchid, String authorizationCode) throws WxPayException { if (StringUtils.isBlank(authorizationCode)) { throw new WxPayException("authorizationCode不允许为空"); } String url = String.format("%s/v3/payscore/partner/permissions/authorization-code/%s", this.payService.getPayBaseUrl(), authorizationCode); URIBuilder uriBuilder; try { uriBuilder = new URIBuilder(url); } catch (URISyntaxException e) { throw new WxPayException("未知异常!", e); } uriBuilder.setParameter("service_id", serviceId); uriBuilder.setParameter("sub_mchid", subMchid); try { String result = payService.getV3(uriBuilder.build().toString()); return WxPartnerPayScoreResult.fromJson(result); } catch (URISyntaxException e) { throw new WxPayException("未知异常!", e); } } @Override public WxPartnerPayScoreResult permissionsTerminateByAuthorizationCode(String serviceId, String subMchid, String authorizationCode, String reason) throws WxPayException { if (StringUtils.isBlank(authorizationCode)) { throw new WxPayException("authorizationCode不允许为空"); } String url = String.format( "%s/v3/payscore/partner/permissions/authorization-code/%s/terminate", this.payService.getPayBaseUrl(), authorizationCode ); Map<String, Object> map = new HashMap<>(4); map.put("service_id", serviceId); map.put("sub_mchid", subMchid); map.put("reason", reason); String result = payService.postV3(url, WxGsonBuilder.create().toJson(map)); return WxPartnerPayScoreResult.fromJson(result); } @Override public WxPartnerPayScoreResult permissionsQueryByOpenId(String serviceId, String appId, String subMchid, String subAppid, String openId, String subOpenid) throws WxPayException { if (StringUtils.isAllEmpty(openId, subOpenid) || !StringUtils.isAnyEmpty(openId, subOpenid)) { throw new WxPayException("open_id,sub_openid不允许都填写或都不填写"); } if (StringUtils.isBlank(subMchid)) { throw new WxPayException("sub_mchid不允许都为空"); } String url = String.format("%s/v3/payscore/partner/permissions/search?", this.payService.getPayBaseUrl(), openId); URIBuilder uriBuilder; try { uriBuilder = new URIBuilder(url); } catch (URISyntaxException e) { throw new WxPayException("未知异常!", e); } uriBuilder.setParameter("appid", appId); uriBuilder.setParameter("service_id", serviceId); uriBuilder.setParameter("sub_mchid", subMchid); uriBuilder.setParameter("sub_appid", subAppid); uriBuilder.setParameter("openid", openId); uriBuilder.setParameter("sub_openid", subOpenid); if (StringUtils.isNotEmpty(openId)) { uriBuilder.setParameter("openid", openId); } if (StringUtils.isNotEmpty(subOpenid)) { uriBuilder.setParameter("sub_openid", subOpenid); } try { String result = payService.getV3(uriBuilder.build().toString()); return WxPartnerPayScoreResult.fromJson(result); } catch (URISyntaxException e) { throw new WxPayException("未知异常!", e); } } @Override public WxPartnerPayScoreResult permissionsTerminateByOpenId(String serviceId, String appId, String subMchid, String subAppid, String openId, String subOpenid, String reason) throws WxPayException { if (StringUtils.isAllEmpty(openId, subOpenid) || !StringUtils.isAnyEmpty(openId, subOpenid)) { throw new WxPayException("open_id,sub_openid不允许都填写或都不填写"); } String url = String.format("%s/v3/payscore/partner/permissions/terminate", this.payService.getPayBaseUrl(), openId); Map<String, Object> map = new HashMap<>(4); map.put("appid", appId); map.put("sub_appid", subAppid); map.put("service_id", serviceId); if (StringUtils.isNotEmpty(openId)) { map.put("openid", openId); } if (StringUtils.isNotEmpty(subOpenid)) { map.put("sub_openid", subOpenid); } map.put("sub_mchid", subMchid); map.put("reason", reason); String result = payService.postV3(url, WxGsonBuilder.create().toJson(map)); return WxPartnerPayScoreResult.fromJson(result); } @Override public WxPartnerPayScoreResult createServiceOrder(WxPartnerPayScoreRequest request) throws WxPayException { String url = this.payService.getPayBaseUrl() + "/v3/payscore/partner/serviceorder"; WxPayConfig config = this.payService.getConfig(); if(StringUtils.isBlank(request.getAppid())){ request.setAppid(config.getAppId()); } if(StringUtils.isBlank((request.getServiceId()))){ request.setServiceId(config.getServiceId()); } if(StringUtils.isBlank((request.getNotifyUrl()))){ request.setNotifyUrl(config.getPayScoreNotifyUrl()); } String result = this.payService.postV3(url, request.toJson()); return WxPartnerPayScoreResult.fromJson(result); } @Override public WxPartnerPayScoreResult queryServiceOrder(String serviceId, String subMchid, String outOrderNo, String queryId) throws WxPayException { String url = this.payService.getPayBaseUrl() + "/v3/payscore/partner/serviceorder"; URIBuilder uriBuilder; try { uriBuilder = new URIBuilder(url); } catch (URISyntaxException e) { throw new WxPayException("未知异常!", e); } uriBuilder.setParameter("service_id", serviceId); uriBuilder.setParameter("sub_mchid", subMchid); if (StringUtils.isAllEmpty(outOrderNo, queryId) || !StringUtils.isAnyEmpty(outOrderNo, queryId)) { throw new WxPayException("out_order_no,query_id不允许都填写或都不填写"); } if (StringUtils.isNotEmpty(outOrderNo)) { uriBuilder.setParameter("out_order_no", outOrderNo); } if (StringUtils.isNotEmpty(queryId)) { uriBuilder.setParameter("query_id", queryId); } try { String result = payService.getV3(uriBuilder.build().toString()); return WxPartnerPayScoreResult.fromJson(result); } catch (URISyntaxException e) { throw new WxPayException("未知异常!", e); } } @Override public WxPartnerPayScoreResult cancelServiceOrder(String serviceId, String appId, String subMchid, String outOrderNo, String reason) throws WxPayException { String url = String.format("%s/v3/payscore/partner/serviceorder/%s/cancel", this.payService.getPayBaseUrl(), outOrderNo); Map<String, Object> map = new HashMap<>(4); map.put("appid", appId); map.put("service_id", serviceId); map.put("sub_mchid", subMchid); map.put("reason", reason); if (StringUtils.isAnyEmpty(appId, serviceId, subMchid, reason)) { throw new WxPayException("appid, service_id, sub_mchid, reason都不能为空"); } String result = payService.postV3(url, WxGsonBuilder.create().toJson(map)); return WxPartnerPayScoreResult.fromJson(result); } @Override public WxPartnerPayScoreResult modifyServiceOrder(WxPartnerPayScoreRequest request) throws WxPayException { String outOrderNo = request.getOutOrderNo(); String url = String.format("%s/v3/payscore/partner/serviceorder/%s/modify", this.payService.getPayBaseUrl(), outOrderNo); request.setAppid(this.payService.getConfig().getAppId()); request.setOutOrderNo(null); String result = payService.postV3(url, request.toJson()); return WxPartnerPayScoreResult.fromJson(result); } @Override public void completeServiceOrder(WxPartnerPayScoreRequest request) throws WxPayException { String outOrderNo = request.getOutOrderNo(); String url = String.format("%s/v3/payscore/partner/serviceorder/%s/complete", this.payService.getPayBaseUrl(), outOrderNo); WxPayConfig config = this.payService.getConfig(); if (StringUtils.isBlank(request.getServiceId())) { request.setServiceId(config.getServiceId()); } if (StringUtils.isBlank(request.getSubMchid())) { request.setSubMchid(config.getSubMchId()); } request.setOutOrderNo(null); this.payService.postV3(url, request.toJson()); } @Override public WxPartnerPayScoreResult payServiceOrder(String serviceId, String appId, String subMchid, String outOrderNo) throws WxPayException { String url = String.format("%s/v3/payscore/partner/serviceorder/%s/pay", this.payService.getPayBaseUrl(), outOrderNo); Map<String, Object> map = new HashMap<>(3); map.put("appid", appId); map.put("service_id", serviceId); map.put("sub_mchid", subMchid); if (StringUtils.isAnyEmpty(appId, serviceId, subMchid)) { throw new WxPayException("appid, service_id, sub_mchid都不能为空"); } String result = payService.postV3(url, WxGsonBuilder.create().toJson(map)); return WxPartnerPayScoreResult.fromJson(result); } @Override public WxPartnerPayScoreResult syncServiceOrder(WxPartnerPayScoreRequest request) throws WxPayException { String outOrderNo = request.getOutOrderNo(); String url = String.format("%s/v3/payscore/partner/serviceorder/%s/sync", this.payService.getPayBaseUrl(), outOrderNo); if (StringUtils.isBlank(request.getAppid())) { request.setAppid(this.payService.getConfig().getAppId()); } request.setOutOrderNo(null); String result = payService.postV3(url, request.toJson()); return WxPartnerPayScoreResult.fromJson(result); } @Override public WxPartnerPayScoreResult applyServiceAccount(WxPartnerPayScoreRequest request) throws WxPayException { String url = String.format("%s/v3/payscore/partner/service-account-applications", this.payService.getPayBaseUrl()); Map<String, String> params = Maps.newHashMap(); params.put("service_id", request.getServiceId()); params.put("appid", request.getAppid()); params.put("sub_mchid", request.getSubMchid()); params.put("sub_appid", request.getSubAppid()); params.put("out_apply_no", request.getOutApplyNo()); params.put("result_notify_url", request.getResultNotifyUrl()); String result = payService.postV3(url, WxGsonBuilder.create().toJson(params)); return WxPartnerPayScoreResult.fromJson(result); } @Override public WxPartnerPayScoreResult queryServiceAccountState(String outApplyNo) throws WxPayException { String url = String.format("%s/v3/payscore/partner/service-account-applications/%s", this.payService.getPayBaseUrl(), outApplyNo); String result = payService.getV3(url); return WxPartnerPayScoreResult.fromJson(result); } @Override public WxPartnerUserAuthorizationStatusNotifyResult parseUserAuthorizationStatusNotifyResult(String notifyData, SignatureHeader header) throws WxPayException { PayScoreNotifyData response = parseNotifyData(notifyData, header); PayScoreNotifyData.Resource resource = response.getResource(); String cipherText = resource.getCipherText(); String associatedData = resource.getAssociatedData(); String nonce = resource.getNonce(); String apiV3Key = this.payService.getConfig().getApiV3Key(); try { String result = AesUtils.decryptToString(associatedData, nonce, cipherText, apiV3Key); WxPartnerUserAuthorizationStatusNotifyResult notifyResult = GSON.fromJson(result, WxPartnerUserAuthorizationStatusNotifyResult.class); notifyResult.setRawData(response); return notifyResult; } catch (GeneralSecurityException | IOException e) { throw new WxPayException("解析报文异常!", e); } } @Override public PayScoreNotifyData parseNotifyData(String data, SignatureHeader header) throws WxPayException { if (Objects.nonNull(header) && !this.verifyNotifySign(header, data)) { throw new WxPayException("非法请求,头部信息验证失败"); } return GSON.fromJson(data, PayScoreNotifyData.class); } @Override public WxPartnerPayScoreResult decryptNotifyDataResource(PayScoreNotifyData data) throws WxPayException { PayScoreNotifyData.Resource resource = data.getResource(); String cipherText = resource.getCipherText(); String associatedData = resource.getAssociatedData(); String nonce = resource.getNonce(); String apiV3Key = this.payService.getConfig().getApiV3Key(); try { return WxPartnerPayScoreResult.fromJson(AesUtils.decryptToString(associatedData, nonce, cipherText, apiV3Key)); } catch (GeneralSecurityException | IOException e) { throw new WxPayException("解析报文异常!", e); } } /** * 校验通知签名 * * @param header 通知头信息 * @param data 通知数据 * @return true:校验通过 false:校验不通过 */ private boolean verifyNotifySign(SignatureHeader header, String data) { String beforeSign = String.format("%s\n%s\n%s\n", header.getTimeStamp(), header.getNonce(), data); return this.payService.getConfig().getVerifier().verify( header.getSerialNo(), beforeSign.getBytes(StandardCharsets.UTF_8), header.getSigned() ); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MerchantTransferServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MerchantTransferServiceImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.merchanttransfer.*; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.MerchantTransferService; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.v3.util.RsaCryptoUtil; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; /** * @author glz * created on 2022/6/11 */ @Slf4j @RequiredArgsConstructor public class MerchantTransferServiceImpl implements MerchantTransferService { private static final Gson GSON = (new GsonBuilder()).create(); private final WxPayService wxPayService; @Override public TransferCreateResult createTransfer(TransferCreateRequest request) throws WxPayException { if (StringUtils.isEmpty(request.getAppid())) { request.setAppid(this.wxPayService.getConfig().getAppId()); } String url = String.format("%s/v3/transfer/batches", this.wxPayService.getPayBaseUrl()); RsaCryptoUtil.encryptFields(request, this.wxPayService.getConfig().getVerifier().getValidCertificate()); String response = wxPayService.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(response, TransferCreateResult.class); } @Override public BatchesQueryResult queryWxBatches(WxBatchesQueryRequest request) throws WxPayException { String url = String.format("%s/v3/transfer/batches/batch-id/%s?need_query_detail=%b", this.wxPayService.getPayBaseUrl(), request.getBatchId(), request.getNeedQueryDetail()); if (request.getOffset() != null) { url = String.format("%s&offset=%d", url, request.getOffset()); } if (request.getLimit() != null) { url = String.format("%s&limit=%d", url, request.getLimit()); } if (request.getDetailStatus() != null && !request.getDetailStatus().isEmpty()) { url = String.format("%s&detail_status=%s", url, request.getDetailStatus()); } String response = wxPayService.getV3(url); return GSON.fromJson(response, BatchesQueryResult.class); } @Override public DetailsQueryResult queryWxDetails(WxDetailsQueryRequest request) throws WxPayException { String url = String.format("%s/v3/transfer/batches/batch-id/%s/details/detail-id/%s", this.wxPayService.getPayBaseUrl(), request.getBatchId(), request.getDetailId()); String response = wxPayService.getV3(url); return GSON.fromJson(response, DetailsQueryResult.class); } @Override public BatchesQueryResult queryMerchantBatches(MerchantBatchesQueryRequest request) throws WxPayException { String url = String.format("%s/v3/transfer/batches/out-batch-no/%s?need_query_detail=%b", this.wxPayService.getPayBaseUrl(), request.getOutBatchNo(), request.getNeedQueryDetail()); if (request.getOffset() != null) { url = String.format("%s&offset=%d", url, request.getOffset()); } if (request.getLimit() != null) { url = String.format("%s&limit=%d", url, request.getLimit()); } if (request.getDetailStatus() != null && !request.getDetailStatus().isEmpty()) { url = String.format("%s&detail_status=%s", url, request.getDetailStatus()); } String response = wxPayService.getV3(url); return GSON.fromJson(response, BatchesQueryResult.class); } @Override public DetailsQueryResult queryMerchantDetails(MerchantDetailsQueryRequest request) throws WxPayException { String url = String.format("%s/v3/transfer/batches/out-batch-no/%s/details/out-detail-no/%s", this.wxPayService.getPayBaseUrl(), request.getOutBatchNo(), request.getOutDetailNo()); String response = wxPayService.getV3(url); return GSON.fromJson(response, DetailsQueryResult.class); } @Override public ElectronicBillResult applyElectronicBill(ElectronicBillApplyRequest request) throws WxPayException { String url = String.format("%s/v3/transfer/bill-receipt", this.wxPayService.getPayBaseUrl()); String response = wxPayService.postV3(url, GSON.toJson(request)); return GSON.fromJson(response, ElectronicBillResult.class); } @Override public ElectronicBillResult queryElectronicBill(String outBatchNo) throws WxPayException { String url = String.format("%s/v3/transfer/bill-receipt/%s", this.wxPayService.getPayBaseUrl(), outBatchNo); String response = wxPayService.getV3(url); return GSON.fromJson(response, ElectronicBillResult.class); } @Override public DetailElectronicBillResult applyDetailElectronicBill(DetailElectronicBillRequest request) throws WxPayException { String url = String.format("%s/v3/transfer-detail/electronic-receipts", this.wxPayService.getPayBaseUrl()); String response = wxPayService.postV3(url, GSON.toJson(request)); return GSON.fromJson(response, DetailElectronicBillResult.class); } @Override public DetailElectronicBillResult queryDetailElectronicBill(DetailElectronicBillRequest request) throws WxPayException { String url = String.format("%s/v3/transfer-detail/electronic-receipts?accept_type=%s&out_detail_no=%s", this.wxPayService.getPayBaseUrl(), request.getAcceptType(), request.getOutDetailNo()); if (StringUtils.isNotEmpty(request.getOutBatchNo())) { url = String.format("%s&out_batch_no=%s", url, request.getOutBatchNo()); } String response = wxPayService.getV3(url); return GSON.fromJson(response, DetailElectronicBillResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.applyment.*; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.Applyment4SubService; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.v3.util.RsaCryptoUtil; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import java.security.cert.X509Certificate; @Slf4j @RequiredArgsConstructor public class Applyment4SubServiceImpl implements Applyment4SubService { private static final Gson GSON = new GsonBuilder().create(); private final WxPayService payService; private void encryptFiled(Object request) throws WxPayException { X509Certificate validCertificate = payService.getConfig().getVerifier().getValidCertificate(); RsaCryptoUtil.encryptFields(request, validCertificate); } @Override public WxPayApplymentCreateResult createApply(WxPayApplyment4SubCreateRequest request) throws WxPayException { String url = String.format("%s/v3/applyment4sub/applyment/", this.payService.getPayBaseUrl()); encryptFiled(request); String result = payService.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(result, WxPayApplymentCreateResult.class); } @Override public ApplymentStateQueryResult queryApplyStatusByBusinessCode(String businessCode) throws WxPayException { String url = String.format("%s/v3/applyment4sub/applyment/business_code/%s", this.payService.getPayBaseUrl(), businessCode); String result = payService.getV3(url); return GSON.fromJson(result, ApplymentStateQueryResult.class); } @Override public ApplymentStateQueryResult queryApplyStatusByApplymentId(String applymentId) throws WxPayException { String url = String.format("%s/v3/applyment4sub/applyment/applyment_id/%s", this.payService.getPayBaseUrl(), applymentId); String result = payService.getV3(url); return GSON.fromJson(result, ApplymentStateQueryResult.class); } @Override public SettlementInfoResult querySettlementBySubMchid(String subMchid) throws WxPayException { String url = String.format("%s/v3/apply4sub/sub_merchants/%s/settlement", this.payService.getPayBaseUrl(), subMchid); String result = payService.getV3(url); return GSON.fromJson(result, SettlementInfoResult.class); } @Override public String modifySettlement(String subMchid, ModifySettlementRequest request) throws WxPayException { String url = String.format("%s/v3/apply4sub/sub_merchants/%s/modify-settlement", this.payService.getPayBaseUrl(), subMchid); encryptFiled(request); return payService.postV3WithWechatpaySerial(url, GSON.toJson(request)); } @Override public SettlementModifyStateQueryResult querySettlementModifyStatusByApplicationNo(String subMchid, String applicationNo) throws WxPayException { String url = String.format("%s/v3/apply4sub/sub_merchants/%s/application/%s", this.payService.getPayBaseUrl(), subMchid, applicationNo); String result = payService.getV3(url); return GSON.fromJson(result, SettlementModifyStateQueryResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.WxPayApiData; import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.v3.WxPayV3DownloadHttpGet; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.util.http.apache.ByteArrayResponseHandler; import me.chanjar.weixin.common.util.json.GsonParser; import org.apache.commons.lang3.StringUtils; import org.apache.http.*; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.*; import org.apache.http.conn.ssl.DefaultHostnameVerifier; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import javax.net.ssl.SSLContext; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.Objects; import java.util.Optional; /** * <pre> * 微信支付请求实现类,apache httpclient实现. * Created by Binary Wang on 2016/7/28. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Slf4j public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl { private static final String ACCEPT = "Accept"; private static final String CONTENT_TYPE = "Content-Type"; private static final String APPLICATION_JSON = "application/json"; private static final String WECHAT_PAY_SERIAL = "Wechatpay-Serial"; @Override public byte[] postForBytes(String url, String requestStr, boolean useKey) throws WxPayException { try { HttpPost httpPost = this.createHttpPost(url, requestStr); CloseableHttpClient httpClient = this.createHttpClient(useKey); // 使用连接池的客户端,不需要手动关闭 final byte[] bytes = httpClient.execute(httpPost, ByteArrayResponseHandler.INSTANCE); final String responseData = Base64.getEncoder().encodeToString(bytes); this.logRequestAndResponse(url, requestStr, responseData); wxApiData.set(new WxPayApiData(url, requestStr, responseData, null)); return bytes; } catch (Exception e) { this.logError(url, requestStr, e); wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage())); throw new WxPayException(e.getMessage(), e); } } @Override public String post(String url, String requestStr, boolean useKey) throws WxPayException { try { HttpPost httpPost = this.createHttpPost(url, requestStr); CloseableHttpClient httpClient = this.createHttpClient(useKey); // 使用连接池的客户端,不需要手动关闭 try (CloseableHttpResponse response = httpClient.execute(httpPost)) { String responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); this.logRequestAndResponse(url, requestStr, responseString); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, responseString, null)); } return responseString; } finally { httpPost.releaseConnection(); } } catch (Exception e) { this.logError(url, requestStr, e); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage())); } throw new WxPayException(e.getMessage(), e); } } @Override public String post(String url, String requestStr, boolean useKey, String mimeType) throws WxPayException { try { HttpPost httpPost = this.createHttpPost(url, requestStr, mimeType); CloseableHttpClient httpClient = this.createHttpClient(useKey); // 使用连接池的客户端,不需要手动关闭 try (CloseableHttpResponse response = httpClient.execute(httpPost)) { String responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); this.logRequestAndResponse(url, requestStr, responseString); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, responseString, null)); } return responseString; } finally { httpPost.releaseConnection(); } } catch (Exception e) { this.logError(url, requestStr, e); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage())); } throw new WxPayException(e.getMessage(), e); } } @Override public String postV3(String url, String requestStr) throws WxPayException { HttpPost httpPost = this.createHttpPost(url, requestStr); this.configureRequest(httpPost); return this.requestV3(url, requestStr, httpPost); } private String requestV3(String url, String requestStr, HttpRequestBase httpRequestBase) throws WxPayException { CloseableHttpClient httpClient = this.createApiV3HttpClient(); try (CloseableHttpResponse response = httpClient.execute(httpRequestBase)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); //post方法有可能会没有返回值的情况 String responseString = null; if (response.getEntity() != null) { responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); } if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) { this.logRequestAndResponse(url, requestStr, responseString); return responseString; } //有错误提示信息返回 JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { this.logError(url, requestStr, e); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { httpRequestBase.releaseConnection(); } } @Override public String patchV3(String url, String requestStr) throws WxPayException { HttpPatch httpPatch = new HttpPatch(url); httpPatch.setEntity(createEntry(requestStr)); return this.requestV3(url, requestStr, httpPatch); } @Override public String postV3WithWechatpaySerial(String url, String requestStr) throws WxPayException { HttpPost httpPost = this.createHttpPost(url, requestStr); this.configureRequest(httpPost); CloseableHttpClient httpClient = this.createApiV3HttpClient(); try (CloseableHttpResponse response = httpClient.execute(httpPost)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); String responseString = "{}"; HttpEntity entity = response.getEntity(); if (entity != null) { responseString = EntityUtils.toString(entity, StandardCharsets.UTF_8); } if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) { this.logRequestAndResponse(url, requestStr, responseString); return responseString; } //有错误提示信息返回 JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { this.logError(url, requestStr, e); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { httpPost.releaseConnection(); } } @Override public String postV3(String url, HttpPost httpPost) throws WxPayException { return this.requestV3(url, httpPost); } @Override public String requestV3(String url, HttpRequestBase httpRequest) throws WxPayException { this.configureRequest(httpRequest); CloseableHttpClient httpClient = this.createApiV3HttpClient(); try (CloseableHttpResponse response = httpClient.execute(httpRequest)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); //post方法有可能会没有返回值的情况 String responseString = null; if (response.getEntity() != null) { responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); } if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) { log.info("\n【请求地址】:{}\n【响应数据】:{}", url, responseString); return responseString; } //有错误提示信息返回 JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage()); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { httpRequest.releaseConnection(); } } @Override public String getV3(String url) throws WxPayException { if (this.getConfig().isStrictlyNeedWechatPaySerial()) { return getV3WithWechatPaySerial(url); } HttpGet httpGet = new HttpGet(url); return this.requestV3(url, httpGet); } @Override public String getV3WithWechatPaySerial(String url) throws WxPayException { HttpGet httpGet = new HttpGet(url); return this.requestV3(url, httpGet); } @Override public InputStream downloadV3(String url) throws WxPayException { HttpGet httpGet = new WxPayV3DownloadHttpGet(url); this.configureRequest(httpGet); CloseableHttpClient httpClient = this.createApiV3HttpClient(); try (CloseableHttpResponse response = httpClient.execute(httpGet)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); Header contentType = response.getFirstHeader(HttpHeaders.CONTENT_TYPE); boolean isJsonContentType = Objects.nonNull(contentType) && ContentType.APPLICATION_JSON.getMimeType() .equals(ContentType.parse(String.valueOf(contentType.getValue())).getMimeType()); if ((HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) && !isJsonContentType) { log.info("\n【请求地址】:{}\n", url); return response.getEntity().getContent(); } //response里的header有content-type=json说明返回了错误信息 //有错误提示信息返回 String responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage()); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { httpGet.releaseConnection(); } } @Override public String putV3(String url, String requestStr) throws WxPayException { HttpPut httpPut = new HttpPut(url); StringEntity entity = createEntry(requestStr); httpPut.setEntity(entity); return requestV3(url, httpPut); } @Override public String deleteV3(String url) throws WxPayException { HttpDelete httpDelete = new HttpDelete(url); return requestV3(url, httpDelete); } private void configureRequest(HttpRequestBase request) { String serialNumber = getWechatPaySerial(getConfig()); String method = request.getMethod(); request.addHeader(ACCEPT, APPLICATION_JSON); if (!method.equals("POST")) { request.addHeader(CONTENT_TYPE, APPLICATION_JSON); } request.addHeader(WECHAT_PAY_SERIAL, serialNumber); request.setConfig(RequestConfig.custom() .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout()) .setConnectTimeout(this.getConfig().getHttpConnectionTimeout()) .setSocketTimeout(this.getConfig().getHttpTimeout()) .build()); } private CloseableHttpClient createApiV3HttpClient() throws WxPayException { CloseableHttpClient apiV3HttpClient = this.getConfig().getApiV3HttpClient(); if (null == apiV3HttpClient) { return this.getConfig().initApiV3HttpClient(); } return apiV3HttpClient; } CloseableHttpClient createHttpClient(boolean useKey) throws WxPayException { if (useKey) { // 使用SSL连接池客户端 CloseableHttpClient sslHttpClient = this.getConfig().getSslHttpClient(); if (null == sslHttpClient) { this.getConfig().initSslHttpClient(); sslHttpClient = this.getConfig().getSslHttpClient(); } return sslHttpClient; } else { // 使用普通连接池客户端 CloseableHttpClient httpClient = this.getConfig().getHttpClient(); if (null == httpClient) { this.getConfig().initHttpClient(); httpClient = this.getConfig().getHttpClient(); } return httpClient; } } private static StringEntity createEntry(String requestStr) { return new StringEntity(requestStr, ContentType.create(APPLICATION_JSON, StandardCharsets.UTF_8)); //return new StringEntity(new String(requestStr.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1)); } private static StringEntity createEntry(String requestStr, String mimeType) { return new StringEntity(requestStr, ContentType.create(mimeType, StandardCharsets.UTF_8)); //return new StringEntity(new String(requestStr.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1)); } private HttpClientBuilder createHttpClientBuilder(boolean useKey) throws WxPayException { HttpClientBuilder httpClientBuilder = HttpClients.custom(); if (useKey) { this.initSSLContext(httpClientBuilder); } if (StringUtils.isNotBlank(this.getConfig().getHttpProxyHost()) && this.getConfig().getHttpProxyPort() > 0) { if (StringUtils.isEmpty(this.getConfig().getHttpProxyUsername())) { this.getConfig().setHttpProxyUsername("whatever"); } // 使用代理服务器 需要用户认证的代理服务器 CredentialsProvider provider = new BasicCredentialsProvider(); provider.setCredentials(new AuthScope(this.getConfig().getHttpProxyHost(), this.getConfig().getHttpProxyPort()), new UsernamePasswordCredentials(this.getConfig().getHttpProxyUsername(), this.getConfig().getHttpProxyPassword())); httpClientBuilder.setDefaultCredentialsProvider(provider) .setProxy(new HttpHost(this.getConfig().getHttpProxyHost(), this.getConfig().getHttpProxyPort())); } // 提供自定义httpClientBuilder的能力 Optional.ofNullable(getConfig().getHttpClientBuilderCustomizer()).ifPresent(e -> { e.customize(httpClientBuilder); }); return httpClientBuilder; } private HttpPost createHttpPost(String url, String requestStr) { HttpPost httpPost = new HttpPost(url); httpPost.setEntity(createEntry(requestStr)); httpPost.setConfig(RequestConfig.custom() .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout()) .setConnectTimeout(this.getConfig().getHttpConnectionTimeout()) .setSocketTimeout(this.getConfig().getHttpTimeout()) .build()); return httpPost; } private HttpPost createHttpPost(String url, String requestStr, String mimeType) throws WxPayException { HttpPost httpPost = new HttpPost(url); httpPost.setEntity(createEntry(requestStr, mimeType)); httpPost.setConfig(RequestConfig.custom() .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout()) .setConnectTimeout(this.getConfig().getHttpConnectionTimeout()) .setSocketTimeout(this.getConfig().getHttpTimeout()) .build()); return httpPost; } private void initSSLContext(HttpClientBuilder httpClientBuilder) throws WxPayException { SSLContext sslContext = this.getConfig().getSslContext(); if (null == sslContext) { sslContext = this.getConfig().initSSLContext(); } httpClientBuilder.setSSLSocketFactory(new SSLConnectionSocketFactory(sslContext, new DefaultHostnameVerifier())); } private WxPayException convertException(JsonObject jsonObject) { //TODO 这里考虑使用新的适用于V3的异常 JsonElement codeElement = jsonObject.get("code"); String code = codeElement == null ? null : codeElement.getAsString(); String message = jsonObject.get("message").getAsString(); WxPayException wxPayException = new WxPayException(message); wxPayException.setErrCode(code); wxPayException.setErrCodeDes(message); return wxPayException; } /** * 兼容微信支付公钥模式 */ private String getWechatPaySerial(WxPayConfig wxPayConfig) { if (StringUtils.isNotBlank(wxPayConfig.getPublicKeyId())) { return wxPayConfig.getPublicKeyId(); } return wxPayConfig.getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase(); } private void logRequestAndResponse(String url, String requestStr, String responseStr) { log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseStr); } private void logError(String url, String requestStr, Exception e) { log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/SubscriptionBillingServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/SubscriptionBillingServiceImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.subscriptionbilling.*; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.SubscriptionBillingService; import com.github.binarywang.wxpay.service.WxPayService; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; /** * 微信支付-预约扣费服务实现 (连续包月功能) * <pre> * 微信支付预约扣费功能,支持商户在用户授权的情况下, * 按照约定的时间和金额,自动从用户的支付账户中扣取费用。 * 主要用于连续包月、订阅服务等场景。 * * 文档详见: https://pay.weixin.qq.com/doc/v3/merchant/4012161105 * </pre> * * @author Binary Wang * created on 2024-08-31 */ @Slf4j @RequiredArgsConstructor public class SubscriptionBillingServiceImpl implements SubscriptionBillingService { private static final Gson GSON = new GsonBuilder().create(); private final WxPayService payService; @Override public SubscriptionScheduleResult scheduleSubscription(SubscriptionScheduleRequest request) throws WxPayException { String url = String.format("%s/v3/subscription-billing/schedule", this.payService.getPayBaseUrl()); String response = this.payService.postV3(url, GSON.toJson(request)); return GSON.fromJson(response, SubscriptionScheduleResult.class); } @Override public SubscriptionQueryResult querySubscription(String subscriptionId) throws WxPayException { String url = String.format("%s/v3/subscription-billing/schedule/%s", this.payService.getPayBaseUrl(), subscriptionId); String response = this.payService.getV3(url); return GSON.fromJson(response, SubscriptionQueryResult.class); } @Override public SubscriptionCancelResult cancelSubscription(SubscriptionCancelRequest request) throws WxPayException { String url = String.format("%s/v3/subscription-billing/schedule/%s/cancel", this.payService.getPayBaseUrl(), request.getSubscriptionId()); String response = this.payService.postV3(url, GSON.toJson(request)); return GSON.fromJson(response, SubscriptionCancelResult.class); } @Override public SubscriptionInstantBillingResult instantBilling(SubscriptionInstantBillingRequest request) throws WxPayException { String url = String.format("%s/v3/subscription-billing/instant-billing", this.payService.getPayBaseUrl()); String response = this.payService.postV3(url, GSON.toJson(request)); return GSON.fromJson(response, SubscriptionInstantBillingResult.class); } @Override public SubscriptionTransactionQueryResult queryTransactions(SubscriptionTransactionQueryRequest request) throws WxPayException { String url = String.format("%s/v3/subscription-billing/transactions", this.payService.getPayBaseUrl()); StringBuilder queryString = new StringBuilder(); if (request.getOpenid() != null) { queryString.append("openid=").append(request.getOpenid()).append("&"); } if (request.getBeginTime() != null) { queryString.append("begin_time=").append(request.getBeginTime()).append("&"); } if (request.getEndTime() != null) { queryString.append("end_time=").append(request.getEndTime()).append("&"); } if (request.getLimit() != null) { queryString.append("limit=").append(request.getLimit()).append("&"); } if (request.getOffset() != null) { queryString.append("offset=").append(request.getOffset()).append("&"); } if (queryString.length() > 0) { // Remove trailing & queryString.setLength(queryString.length() - 1); url += "?" + queryString.toString(); } String response = this.payService.getV3(url); return GSON.fromJson(response, SubscriptionTransactionQueryResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceImpl.java
package com.github.binarywang.wxpay.service.impl; /** * <pre> * 微信支付接口请求实现类,默认使用Apache HttpClient实现 * Created by Binary Wang on 2017-7-8. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ public class WxPayServiceImpl extends WxPayServiceApacheHttpImpl { }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxEntrustPapServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxEntrustPapServiceImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.request.*; import com.github.binarywang.wxpay.bean.result.*; import com.github.binarywang.wxpay.constant.WxPayConstants; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.WxEntrustPapService; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.util.SignUtils; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import org.apache.commons.lang3.StringUtils; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; /** * @author chenliang * created on 2021-08-02 4:53 下午 */ @Slf4j @RequiredArgsConstructor public class WxEntrustPapServiceImpl implements WxEntrustPapService { private final WxPayService payService; @Override @SneakyThrows public String mpSign(WxMpEntrustRequest wxMpEntrustRequest) throws WxPayException { wxMpEntrustRequest.checkAndSign(payService.getConfig()); StringBuilder signStrTemp = new StringBuilder(payService.getPayBaseUrl() + "/papay/entrustweb"); signStrTemp.append("?appid=").append(wxMpEntrustRequest.getAppid()); signStrTemp.append("&contract_code=").append(wxMpEntrustRequest.getContractCode()); signStrTemp.append("&contract_display_account=") .append(URLEncoder.encode(wxMpEntrustRequest.getContractDisplayAccount(), StandardCharsets.UTF_8.name())); signStrTemp.append("&mch_id=").append(wxMpEntrustRequest.getMchId()).append("&notify_url=") .append(URLEncoder.encode(wxMpEntrustRequest.getNotifyUrl(), StandardCharsets.UTF_8.name())); signStrTemp.append("&plan_id=").append(wxMpEntrustRequest.getPlanId()); signStrTemp.append("&request_serial=").append(wxMpEntrustRequest.getRequestSerial()).append("&timestamp=") .append(wxMpEntrustRequest.getTimestamp()); // 根据微信支付文档,returnWeb字段只在值为1时需要添加到URL参数中,表示返回签约页面的referrer url if (wxMpEntrustRequest.getReturnWeb() != null && wxMpEntrustRequest.getReturnWeb() == 1) { signStrTemp.append("&return_web=").append(wxMpEntrustRequest.getReturnWeb()); } if (StringUtils.isNotEmpty(wxMpEntrustRequest.getOuterId())) { signStrTemp.append("&outerid=").append(URLEncoder.encode(wxMpEntrustRequest.getOuterId(), StandardCharsets.UTF_8.name())); } signStrTemp.append("&version=").append(wxMpEntrustRequest.getVersion()).append("&sign=") .append(wxMpEntrustRequest.getSign()); return signStrTemp.toString(); } @Override @SneakyThrows public String maSign(WxMaEntrustRequest wxMaEntrustRequest) throws WxPayException { wxMaEntrustRequest.checkAndSign(payService.getConfig()); wxMaEntrustRequest.setNotifyUrl(URLEncoder.encode(wxMaEntrustRequest.getNotifyUrl(), StandardCharsets.UTF_8.name())); return wxMaEntrustRequest.toString(); } @SneakyThrows @Override public WxH5EntrustResult h5Sign(WxH5EntrustRequest wxH5EntrustRequest) throws WxPayException { wxH5EntrustRequest.checkAndSign(payService.getConfig()); // 微信最新接口signType不能参与签名,否则报错:签约参数签名校验错误 wxH5EntrustRequest.setSignType(null); String sign = SignUtils.createSign(wxH5EntrustRequest, WxPayConstants.SignType.HMAC_SHA256, payService.getConfig().getMchKey(), null); /** * https://api.mch.weixin.qq.com/papay/h5entrustweb?appid=wxxxxx&contract_code=001 * &contract_display_account=name1&mch_id=1223816102&notify_url=www.qq.com%2Ftest%2Fpapay&plan_id=106 * &request_serial=123&return_appid= wxcbda96de0b165542&clientip=12.1.1.12&timestamp=1414488825 * &version=1.0&sign= 130C7B07DD3B8074F7BF8BEF5C9A86487A1C57478F8C55587876B9C782F72036 */ String url = payService.getPayBaseUrl() + "/papay/h5entrustweb"; StringBuilder strBuilder = new StringBuilder(url); strBuilder.append("?appid=").append(wxH5EntrustRequest.getAppid()); strBuilder.append("&contract_code=").append(wxH5EntrustRequest.getContractCode()); strBuilder.append("&contract_display_account=").append(URLEncoder.encode(wxH5EntrustRequest.getContractDisplayAccount(), StandardCharsets.UTF_8.name())); strBuilder.append("&mch_id=").append(wxH5EntrustRequest.getMchId()).append("&notify_url=").append(URLEncoder.encode(wxH5EntrustRequest.getNotifyUrl(), StandardCharsets.UTF_8.name())); strBuilder.append("&plan_id=").append(wxH5EntrustRequest.getPlanId()); if (StringUtils.isNotEmpty(wxH5EntrustRequest.getOuterId())) { strBuilder.append("&outerid=").append(URLEncoder.encode(wxH5EntrustRequest.getOuterId(), StandardCharsets.UTF_8.name())); } if (StringUtils.isNotEmpty(wxH5EntrustRequest.getReturnAppid())) { strBuilder.append("&return_appid=").append(wxH5EntrustRequest.getReturnAppid()); } strBuilder.append("&clientip=").append(wxH5EntrustRequest.getClientIp()); strBuilder.append("&request_serial=").append(wxH5EntrustRequest.getRequestSerial()).append("&timestamp=").append(wxH5EntrustRequest.getTimestamp()); strBuilder.append("&version=").append(wxH5EntrustRequest.getVersion()).append("&sign=").append(sign); log.debug("h5纯签约请求URL:{}", strBuilder.toString()); String responseContent = payService.getV3(strBuilder.toString()); WxH5EntrustResult result = BaseWxPayResult.fromXML(responseContent, WxH5EntrustResult.class); result.checkResult(payService, wxH5EntrustRequest.getSignType(), true); return result; } @Override public WxPayEntrustResult paySign(WxPayEntrustRequest wxPayEntrustRequest) throws WxPayException { wxPayEntrustRequest.checkAndSign(payService.getConfig()); String url = payService.getPayBaseUrl() + "/pay/contractorder"; String responseContent = payService.post(url, wxPayEntrustRequest.toXML(), false); WxPayEntrustResult result = BaseWxPayResult.fromXML(responseContent, WxPayEntrustResult.class); result.checkResult(payService, wxPayEntrustRequest.getSignType(), true); return result; } @Override public WxWithholdResult withhold(WxWithholdRequest wxWithholdRequest) throws WxPayException { wxWithholdRequest.checkAndSign(payService.getConfig()); String url = payService.getPayBaseUrl() + "/pay/pappayapply"; String responseContent = payService.post(url, wxWithholdRequest.toXML(), false); WxWithholdResult result = BaseWxPayResult.fromXML(responseContent, WxWithholdResult.class); result.checkResult(payService, wxWithholdRequest.getSignType(), true); return result; } @Override public WxPayCommonResult withholdPartner(WxWithholdRequest wxWithholdRequest) throws WxPayException { wxWithholdRequest.checkAndSign(payService.getConfig()); String url = payService.getPayBaseUrl() + "/pay/partner/pappayapply"; String responseContent = payService.post(url, wxWithholdRequest.toXML(), false); WxPayCommonResult result = BaseWxPayResult.fromXML(responseContent, WxPayCommonResult.class); result.checkResult(payService, wxWithholdRequest.getSignType(), true); return result; } @Override public String preWithhold(WxPreWithholdRequest wxPreWithholdRequest) throws WxPayException { String requestParam = WxGsonBuilder.create().toJson(wxPreWithholdRequest); String url = payService.getPayBaseUrl() + "/v3/papay/contracts/%s/notify"; // %s为{contract_id} String httpResponse = payService.postV3(String.format(url, wxPreWithholdRequest.getContractId()), requestParam); return httpResponse; } @Override public WxSignQueryResult querySign(WxSignQueryRequest wxSignQueryRequest) throws WxPayException { wxSignQueryRequest.checkAndSign(payService.getConfig()); String url = payService.getPayBaseUrl() + "/papay/querycontract"; String responseContent = payService.post(url, wxSignQueryRequest.toXML(), false); WxSignQueryResult result = BaseWxPayResult.fromXML(responseContent, WxSignQueryResult.class); result.checkResult(payService, wxSignQueryRequest.getSignType(), true); return result; } @Override public WxTerminationContractResult terminationContract(WxTerminatedContractRequest wxTerminatedContractRequest) throws WxPayException { wxTerminatedContractRequest.checkAndSign(payService.getConfig()); String url = payService.getPayBaseUrl() + "/papay/deletecontract"; String responseContent = payService.post(url, wxTerminatedContractRequest.toXML(), false); WxTerminationContractResult terminationContractResult = BaseWxPayResult.fromXML(responseContent, WxTerminationContractResult.class); terminationContractResult.checkResult(payService, wxTerminatedContractRequest.getSignType(), true); return terminationContractResult; } @Override public WxWithholdOrderQueryResult papOrderQuery(WxWithholdOrderQueryRequest wxWithholdOrderQueryRequest) throws WxPayException { wxWithholdOrderQueryRequest.checkAndSign(payService.getConfig()); String url = payService.getPayBaseUrl() + "/pay/paporderquery"; String responseContent = payService.post(url, wxWithholdOrderQueryRequest.toXML(), false); WxWithholdOrderQueryResult wxWithholdOrderQueryResult = BaseWxPayResult.fromXML(responseContent, WxWithholdOrderQueryResult.class); wxWithholdOrderQueryResult.checkResult(payService, wxWithholdOrderQueryRequest.getSignType(), true); return wxWithholdOrderQueryResult; } @Override public WxSignQueryResult parseSignNotifyResult(String xmlData) throws WxPayException { WxSignQueryResult result = BaseWxPayResult.fromXML(xmlData, WxSignQueryResult.class); result.checkResult(payService, WxPayConstants.SignType.MD5, true); return result; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/RealNameServiceImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/RealNameServiceImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.realname.RealNameRequest; import com.github.binarywang.wxpay.bean.realname.RealNameResult; import com.github.binarywang.wxpay.bean.result.BaseWxPayResult; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.RealNameService; import com.github.binarywang.wxpay.service.WxPayService; import lombok.RequiredArgsConstructor; /** * <pre> * 微信支付实名验证相关服务实现类. * 详见文档:https://pay.wechatpay.cn/doc/v2/merchant/4011987607 * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @RequiredArgsConstructor public class RealNameServiceImpl implements RealNameService { private final WxPayService payService; @Override public RealNameResult queryRealName(RealNameRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/userinfo/realnameauth/query"; String responseContent = this.payService.post(url, request.toXML(), true); RealNameResult result = BaseWxPayResult.fromXML(responseContent, RealNameResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; } @Override public RealNameResult queryRealName(String openid) throws WxPayException { RealNameRequest request = RealNameRequest.newBuilder() .openid(openid) .build(); return this.queryRealName(request); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceHttpComponentsImpl.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceHttpComponentsImpl.java
package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.WxPayApiData; import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.v3.WxPayV3DownloadHttpGet; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.util.http.apache.ByteArrayResponseHandler; import me.chanjar.weixin.common.util.json.GsonParser; import org.apache.commons.lang3.StringUtils; import org.apache.http.*; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.*; import org.apache.http.conn.ssl.DefaultHostnameVerifier; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import javax.net.ssl.SSLContext; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.Objects; import java.util.Optional; /** * 微信支付请求实现类,apache httpconponents 实现. * * @author altusea */ @Slf4j public class WxPayServiceHttpComponentsImpl extends BaseWxPayServiceImpl { private static final String ACCEPT = "Accept"; private static final String CONTENT_TYPE = "Content-Type"; private static final String APPLICATION_JSON = "application/json"; private static final String WECHAT_PAY_SERIAL = "Wechatpay-Serial"; @Override public byte[] postForBytes(String url, String requestStr, boolean useKey) throws WxPayException { try { HttpClientBuilder httpClientBuilder = createHttpClientBuilder(useKey); HttpPost httpPost = this.createHttpPost(url, requestStr); try (CloseableHttpClient httpClient = httpClientBuilder.build()) { final byte[] bytes = httpClient.execute(httpPost, ByteArrayResponseHandler.INSTANCE); final String responseData = Base64.getEncoder().encodeToString(bytes); this.logRequestAndResponse(url, requestStr, responseData); wxApiData.set(new WxPayApiData(url, requestStr, responseData, null)); return bytes; } } catch (Exception e) { this.logError(url, requestStr, e); wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage())); throw new WxPayException(e.getMessage(), e); } } @Override public String post(String url, String requestStr, boolean useKey) throws WxPayException { try { HttpClientBuilder httpClientBuilder = this.createHttpClientBuilder(useKey); HttpPost httpPost = this.createHttpPost(url, requestStr); try (CloseableHttpClient httpClient = httpClientBuilder.build()) { try (CloseableHttpResponse response = httpClient.execute(httpPost)) { String responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); this.logRequestAndResponse(url, requestStr, responseString); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, responseString, null)); } return responseString; } } finally { httpPost.releaseConnection(); } } catch (Exception e) { this.logError(url, requestStr, e); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage())); } throw new WxPayException(e.getMessage(), e); } } @Override public String post(String url, String requestStr, boolean useKey, String mimeType) throws WxPayException { try { HttpClientBuilder httpClientBuilder = this.createHttpClientBuilder(useKey); HttpPost httpPost = this.createHttpPost(url, requestStr, mimeType); try (CloseableHttpClient httpClient = httpClientBuilder.build()) { try (CloseableHttpResponse response = httpClient.execute(httpPost)) { String responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); this.logRequestAndResponse(url, requestStr, responseString); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, responseString, null)); } return responseString; } } finally { httpPost.releaseConnection(); } } catch (Exception e) { this.logError(url, requestStr, e); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage())); } throw new WxPayException(e.getMessage(), e); } } @Override public String postV3(String url, String requestStr) throws WxPayException { HttpPost httpPost = this.createHttpPost(url, requestStr); this.configureRequest(httpPost); return this.requestV3(url, requestStr, httpPost); } private String requestV3(String url, String requestStr, HttpRequestBase httpRequestBase) throws WxPayException { CloseableHttpClient httpClient = this.createApiV3HttpClient(); try (CloseableHttpResponse response = httpClient.execute(httpRequestBase)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); //post方法有可能会没有返回值的情况 String responseString = null; if (response.getEntity() != null) { responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); } if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) { this.logRequestAndResponse(url, requestStr, responseString); return responseString; } //有错误提示信息返回 JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { this.logError(url, requestStr, e); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { httpRequestBase.releaseConnection(); } } @Override public String patchV3(String url, String requestStr) throws WxPayException { HttpPatch httpPatch = new HttpPatch(url); httpPatch.setEntity(createEntry(requestStr)); return this.requestV3(url, requestStr, httpPatch); } @Override public String postV3WithWechatpaySerial(String url, String requestStr) throws WxPayException { HttpPost httpPost = this.createHttpPost(url, requestStr); this.configureRequest(httpPost); CloseableHttpClient httpClient = this.createApiV3HttpClient(); try (CloseableHttpResponse response = httpClient.execute(httpPost)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); String responseString = "{}"; HttpEntity entity = response.getEntity(); if (entity != null) { responseString = EntityUtils.toString(entity, StandardCharsets.UTF_8); } if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) { this.logRequestAndResponse(url, requestStr, responseString); return responseString; } //有错误提示信息返回 JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { this.logError(url, requestStr, e); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { httpPost.releaseConnection(); } } @Override public String postV3(String url, HttpPost httpPost) throws WxPayException { return this.requestV3(url, httpPost); } @Override public String requestV3(String url, HttpRequestBase httpRequest) throws WxPayException { this.configureRequest(httpRequest); CloseableHttpClient httpClient = this.createApiV3HttpClient(); try (CloseableHttpResponse response = httpClient.execute(httpRequest)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); //post方法有可能会没有返回值的情况 String responseString = null; if (response.getEntity() != null) { responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); } if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) { log.info("\n【请求地址】:{}\n【响应数据】:{}", url, responseString); return responseString; } //有错误提示信息返回 JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage()); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { httpRequest.releaseConnection(); } } @Override public String getV3(String url) throws WxPayException { if (this.getConfig().isStrictlyNeedWechatPaySerial()) { return getV3WithWechatPaySerial(url); } HttpGet httpGet = new HttpGet(url); return this.requestV3(url, httpGet); } @Override public String getV3WithWechatPaySerial(String url) throws WxPayException { HttpGet httpGet = new HttpGet(url); return this.requestV3(url, httpGet); } @Override public InputStream downloadV3(String url) throws WxPayException { HttpGet httpGet = new WxPayV3DownloadHttpGet(url); this.configureRequest(httpGet); CloseableHttpClient httpClient = this.createApiV3HttpClient(); try (CloseableHttpResponse response = httpClient.execute(httpGet)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); Header contentType = response.getFirstHeader(HttpHeaders.CONTENT_TYPE); boolean isJsonContentType = Objects.nonNull(contentType) && ContentType.APPLICATION_JSON.getMimeType() .equals(ContentType.parse(String.valueOf(contentType.getValue())).getMimeType()); if ((HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) && !isJsonContentType) { log.info("\n【请求地址】:{}\n", url); return response.getEntity().getContent(); } //response里的header有content-type=json说明返回了错误信息 //有错误提示信息返回 String responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage()); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { httpGet.releaseConnection(); } } @Override public String putV3(String url, String requestStr) throws WxPayException { HttpPut httpPut = new HttpPut(url); StringEntity entity = createEntry(requestStr); httpPut.setEntity(entity); return requestV3(url, httpPut); } @Override public String deleteV3(String url) throws WxPayException { HttpDelete httpDelete = new HttpDelete(url); return requestV3(url, httpDelete); } private void configureRequest(HttpRequestBase request) { String serialNumber = getWechatPaySerial(getConfig()); String method = request.getMethod(); request.addHeader(ACCEPT, APPLICATION_JSON); if (!method.equals("POST")) { request.addHeader(CONTENT_TYPE, APPLICATION_JSON); } request.addHeader(WECHAT_PAY_SERIAL, serialNumber); request.setConfig(RequestConfig.custom() .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout()) .setConnectTimeout(this.getConfig().getHttpConnectionTimeout()) .setSocketTimeout(this.getConfig().getHttpTimeout()) .build()); } private CloseableHttpClient createApiV3HttpClient() throws WxPayException { CloseableHttpClient apiV3HttpClient = this.getConfig().getApiV3HttpClient(); if (null == apiV3HttpClient) { return this.getConfig().initApiV3HttpClient(); } return apiV3HttpClient; } private static StringEntity createEntry(String requestStr) { return new StringEntity(requestStr, ContentType.create(APPLICATION_JSON, StandardCharsets.UTF_8)); //return new StringEntity(new String(requestStr.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1)); } private static StringEntity createEntry(String requestStr, String mimeType) { return new StringEntity(requestStr, ContentType.create(mimeType, StandardCharsets.UTF_8)); //return new StringEntity(new String(requestStr.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1)); } private HttpClientBuilder createHttpClientBuilder(boolean useKey) throws WxPayException { HttpClientBuilder httpClientBuilder = HttpClients.custom(); if (useKey) { this.initSSLContext(httpClientBuilder); } if (StringUtils.isNotBlank(this.getConfig().getHttpProxyHost()) && this.getConfig().getHttpProxyPort() > 0) { if (StringUtils.isEmpty(this.getConfig().getHttpProxyUsername())) { this.getConfig().setHttpProxyUsername("whatever"); } // 使用代理服务器 需要用户认证的代理服务器 CredentialsProvider provider = new BasicCredentialsProvider(); provider.setCredentials(new AuthScope(this.getConfig().getHttpProxyHost(), this.getConfig().getHttpProxyPort()), new UsernamePasswordCredentials(this.getConfig().getHttpProxyUsername(), this.getConfig().getHttpProxyPassword())); httpClientBuilder.setDefaultCredentialsProvider(provider) .setProxy(new HttpHost(this.getConfig().getHttpProxyHost(), this.getConfig().getHttpProxyPort())); } // 提供自定义httpClientBuilder的能力 Optional.ofNullable(getConfig().getHttpClientBuilderCustomizer()).ifPresent(e -> { e.customize(httpClientBuilder); }); return httpClientBuilder; } private HttpPost createHttpPost(String url, String requestStr) { HttpPost httpPost = new HttpPost(url); httpPost.setEntity(createEntry(requestStr)); httpPost.setConfig(RequestConfig.custom() .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout()) .setConnectTimeout(this.getConfig().getHttpConnectionTimeout()) .setSocketTimeout(this.getConfig().getHttpTimeout()) .build()); return httpPost; } private HttpPost createHttpPost(String url, String requestStr, String mimeType) throws WxPayException { HttpPost httpPost = new HttpPost(url); httpPost.setEntity(createEntry(requestStr, mimeType)); httpPost.setConfig(RequestConfig.custom() .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout()) .setConnectTimeout(this.getConfig().getHttpConnectionTimeout()) .setSocketTimeout(this.getConfig().getHttpTimeout()) .build()); return httpPost; } private void initSSLContext(HttpClientBuilder httpClientBuilder) throws WxPayException { SSLContext sslContext = this.getConfig().getSslContext(); if (null == sslContext) { sslContext = this.getConfig().initSSLContext(); } httpClientBuilder.setSSLSocketFactory(new SSLConnectionSocketFactory(sslContext, new DefaultHostnameVerifier())); } private WxPayException convertException(JsonObject jsonObject) { //TODO 这里考虑使用新的适用于V3的异常 JsonElement codeElement = jsonObject.get("code"); String code = codeElement == null ? null : codeElement.getAsString(); String message = jsonObject.get("message").getAsString(); WxPayException wxPayException = new WxPayException(message); wxPayException.setErrCode(code); wxPayException.setErrCodeDes(message); return wxPayException; } /** * 兼容微信支付公钥模式 */ private String getWechatPaySerial(WxPayConfig wxPayConfig) { if (StringUtils.isNotBlank(wxPayConfig.getPublicKeyId())) { return wxPayConfig.getPublicKeyId(); } return wxPayConfig.getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase(); } private void logRequestAndResponse(String url, String requestStr, String responseStr) { log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseStr); } private void logError(String url, String requestStr, Exception e) { log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/exception/WxSignTestException.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/exception/WxSignTestException.java
package com.github.binarywang.wxpay.exception; /** * <pre> * 微信支付签名探测异常类 * </pre> * @author je45 * @date 2024/11/27 9:35 */ public class WxSignTestException extends WxPayException { private static final long serialVersionUID = -303371909244098058L; /** * Instantiates a new Wx pay exception. * * @param customErrorMsg the custom error msg */ public WxSignTestException(String customErrorMsg) { super(customErrorMsg); } /** * Instantiates a new Wx pay exception. * * @param customErrorMsg the custom error msg * @param tr the tr */ public WxSignTestException(String customErrorMsg, Throwable tr) { super(customErrorMsg, tr); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/exception/WxPayException.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/exception/WxPayException.java
package com.github.binarywang.wxpay.exception; import com.github.binarywang.wxpay.bean.result.BaseWxPayResult; import com.google.common.base.Joiner; import lombok.Data; import lombok.EqualsAndHashCode; /** * <pre> * 微信支付异常结果类 * Created by Binary Wang on 2017-6-6. * </pre> * * @author BinaryWang */ @Data @EqualsAndHashCode(callSuper = false) public class WxPayException extends Exception { private static final long serialVersionUID = 2214381471513460742L; /** * 自定义错误讯息. */ private String customErrorMsg; /** * 返回状态码. */ private String returnCode; /** * 返回信息. */ private String returnMsg; /** * 业务结果. */ private String resultCode; /** * 错误代码. */ private String errCode; /** * 错误代码描述. */ private String errCodeDes; /** * 微信支付返回的结果xml字符串. */ private String xmlString; /** * Instantiates a new Wx pay exception. * * @param customErrorMsg the custom error msg */ public WxPayException(String customErrorMsg) { super(customErrorMsg); this.customErrorMsg = customErrorMsg; } /** * Instantiates a new Wx pay exception. * * @param customErrorMsg the custom error msg * @param tr the tr */ public WxPayException(String customErrorMsg, Throwable tr) { super(customErrorMsg, tr); this.customErrorMsg = customErrorMsg; } private WxPayException(Builder builder) { super(builder.buildErrorMsg()); returnCode = builder.returnCode; returnMsg = builder.returnMsg; resultCode = builder.resultCode; errCode = builder.errCode; errCodeDes = builder.errCodeDes; xmlString = builder.xmlString; } /** * 通过BaseWxPayResult生成异常对象. * * @param payBaseResult the pay base result * @return the wx pay exception */ public static WxPayException from(BaseWxPayResult payBaseResult) { WxPayException exception = WxPayException.newBuilder() .xmlString(payBaseResult.getXmlString()) .returnMsg(payBaseResult.getReturnMsg()) .returnCode(payBaseResult.getReturnCode()) .resultCode(payBaseResult.getResultCode()) .errCode(payBaseResult.getErrCode()) .errCodeDes(payBaseResult.getErrCodeDes()) .build(); if (payBaseResult.getErrorCode() != null) { exception.setErrCode(payBaseResult.getErrorCode()); } if (payBaseResult.getErrorMessage() != null) { exception.setErrCodeDes(payBaseResult.getErrorMessage()); } return exception; } /** * New builder builder. * * @return the builder */ public static Builder newBuilder() { return new Builder(); } /** * The type Builder. */ public static final class Builder { private String returnCode; private String returnMsg; private String resultCode; private String errCode; private String errCodeDes; private String xmlString; private Builder() { } /** * Return code builder. * * @param returnCode the return code * @return the builder */ public Builder returnCode(String returnCode) { this.returnCode = returnCode; return this; } /** * Return msg builder. * * @param returnMsg the return msg * @return the builder */ public Builder returnMsg(String returnMsg) { this.returnMsg = returnMsg; return this; } /** * Result code builder. * * @param resultCode the result code * @return the builder */ public Builder resultCode(String resultCode) { this.resultCode = resultCode; return this; } /** * Err code builder. * * @param errCode the err code * @return the builder */ public Builder errCode(String errCode) { this.errCode = errCode; return this; } /** * Err code des builder. * * @param errCodeDes the err code des * @return the builder */ public Builder errCodeDes(String errCodeDes) { this.errCodeDes = errCodeDes; return this; } /** * Xml string builder. * * @param xmlString the xml string * @return the builder */ public Builder xmlString(String xmlString) { this.xmlString = xmlString; return this; } /** * Build wx pay exception. * * @return the wx pay exception */ public WxPayException build() { return new WxPayException(this); } /** * Build error msg string. * * @return the string */ public String buildErrorMsg() { return Joiner.on(",").skipNulls().join( returnCode == null ? null : String.format("返回代码:[%s]", returnCode), returnMsg == null ? null : String.format("返回信息:[%s]", returnMsg), resultCode == null ? null : String.format("结果代码:[%s]", resultCode), errCode == null ? null : String.format("错误代码:[%s]", errCode), errCodeDes == null ? null : String.format("错误详情:[%s]", errCodeDes), xmlString == null ? null : "微信返回的原始报文:\n" + xmlString ); } } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/converter/WxPayOrderNotifyResultConverter.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/converter/WxPayOrderNotifyResultConverter.java
package com.github.binarywang.wxpay.converter; import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyCoupon; import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.converters.MarshallingContext; import com.thoughtworks.xstream.converters.UnmarshallingContext; import com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter; import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; import com.thoughtworks.xstream.io.HierarchicalStreamReader; import com.thoughtworks.xstream.io.HierarchicalStreamWriter; import com.thoughtworks.xstream.mapper.Mapper; import org.apache.commons.lang3.StringUtils; import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; /** * The type Wxpay order notify result converter. * * @author aimilin */ public class WxPayOrderNotifyResultConverter extends AbstractReflectionConverter { /** * Instantiates a new Wx pay order notify result converter. * * @param mapper the mapper * @param reflectionProvider the reflection provider */ public WxPayOrderNotifyResultConverter(Mapper mapper, ReflectionProvider reflectionProvider) { super(mapper, reflectionProvider); } @Override public boolean canConvert(Class type) { return type.equals(WxPayOrderNotifyResult.class); } @Override public void marshal(Object original, HierarchicalStreamWriter writer, MarshallingContext context) { super.marshal(original, writer, context); WxPayOrderNotifyResult obj = (WxPayOrderNotifyResult) original; List<WxPayOrderNotifyCoupon> list = obj.getCouponList(); if (list == null || list.isEmpty()) { return; } for (int i = 0; i < list.size(); i++) { WxPayOrderNotifyCoupon coupon = list.get(i); writer.startNode("coupon_id_" + i); writer.setValue(coupon.getCouponId()); writer.endNode(); writer.startNode("coupon_type_" + i); writer.setValue(coupon.getCouponType()); writer.endNode(); writer.startNode("coupon_fee_" + i); writer.setValue(String.valueOf(coupon.getCouponFee())); writer.endNode(); } } @Override protected void marshallField(MarshallingContext context, Object newObj, Field field) { if ("couponList".equals(field.getName())) { return; } super.marshallField(context, newObj, field); } @Override public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { WxPayOrderNotifyResult obj = new WxPayOrderNotifyResult(); List<Field> fields = new ArrayList<>(Arrays.asList(obj.getClass().getDeclaredFields())); fields.addAll(Arrays.asList(obj.getClass().getSuperclass().getDeclaredFields())); Map<String, Field> fieldMap = getFieldMap(fields); Map<Integer, WxPayOrderNotifyCoupon> coupons = Maps.newTreeMap(); while (reader.hasMoreChildren()) { reader.moveDown(); if (fieldMap.containsKey(reader.getNodeName())) { Field field = fieldMap.get(reader.getNodeName()); this.setFieldValue(context, obj, field); } else if (StringUtils.startsWith(reader.getNodeName(), "coupon_id_")) { String id = (String) context.convertAnother(obj, String.class); this.getElement(coupons, reader.getNodeName()).setCouponId(id); } else if (StringUtils.startsWith(reader.getNodeName(), "coupon_type_")) { String type = (String) context.convertAnother(obj, String.class); this.getElement(coupons, reader.getNodeName()).setCouponType(type); } else if (StringUtils.startsWith(reader.getNodeName(), "coupon_fee_")) { Integer fee = (Integer) context.convertAnother(obj, Integer.class); this.getElement(coupons, reader.getNodeName()).setCouponFee(fee); } reader.moveUp(); } obj.setCouponList(Lists.newArrayList(coupons.values())); return obj; } private void setFieldValue(UnmarshallingContext context, WxPayOrderNotifyResult obj, Field field) { Object val = context.convertAnother(obj, field.getType()); try { if (val != null) { /* 这里加一个看似多余的(String)强转可解决高jdk版本下的编译报错问题, 详情见讨论https://github.com/vaadin/framework/issues/10737 */ PropertyDescriptor pd = new PropertyDescriptor((String) field.getName(), obj.getClass()); pd.getWriteMethod().invoke(obj, val); } } catch (Exception ignored) { } } private Map<String, Field> getFieldMap(List<Field> fields) { return Maps.uniqueIndex(fields, field -> { if (field.isAnnotationPresent(XStreamAlias.class)) { return field.getAnnotation(XStreamAlias.class).value(); } return field.getName(); }); } private WxPayOrderNotifyCoupon getElement(Map<Integer, WxPayOrderNotifyCoupon> coupons, String nodeName) { Integer index = Integer.valueOf(StringUtils.substringAfterLast(nodeName, "_")); coupons.computeIfAbsent(index, k -> new WxPayOrderNotifyCoupon()); return coupons.get(index); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/example/NewTransferApiExample.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/example/NewTransferApiExample.java
package com.github.binarywang.wxpay.example; import com.github.binarywang.wxpay.bean.notify.SignatureHeader; import com.github.binarywang.wxpay.bean.transfer.*; import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.constant.WxPayConstants; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.TransferService; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl; /** * 新版商户转账API使用示例 * * 从2025年1月15日开始,微信支付推出了新版的商户转账API * 新开通的商户号只能使用最新版本的商户转账接口 * * @author WxJava Team * @since 2025-01-15 */ public class NewTransferApiExample { private final TransferService transferService; public NewTransferApiExample(WxPayConfig config) { // 初始化微信支付服务 WxPayService wxPayService = new WxPayServiceImpl(); wxPayService.setConfig(config); // 获取新版转账服务 this.transferService = wxPayService.getTransferService(); } /** * 发起单笔转账示例 * 新版API使用 /v3/fund-app/mch-transfer/transfer-bills 接口 */ public void transferExample() { try { // 构建转账请求 TransferBillsRequest request = TransferBillsRequest.newBuilder() .appid("wx1234567890123456") // 应用ID .outBillNo("TRANSFER_" + System.currentTimeMillis()) // 商户转账单号,确保唯一 .transferSceneId("1005") // 转账场景ID(1005=佣金报酬) .openid("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o") // 收款用户的openid .userName("张三") // 收款用户真实姓名(可选,会自动加密) .transferAmount(100) // 转账金额,单位:分(此处为1元) .transferRemark("佣金报酬") // 转账备注,用户可见 .notifyUrl("https://your-domain.com/transfer/notify") // 异步通知地址(可选) .userRecvPerception("Y") // 用户收款感知:Y=会收到通知,N=不会收到通知 .build(); // 发起转账 TransferBillsResult result = transferService.transferBills(request); // 输出结果 System.out.println("=== 转账发起成功 ==="); System.out.println("商户单号: " + result.getOutBillNo()); System.out.println("微信转账单号: " + result.getTransferBillNo()); System.out.println("创建时间: " + result.getCreateTime()); System.out.println("状态: " + result.getState()); System.out.println("跳转领取页面信息: " + result.getPackageInfo()); } catch (WxPayException e) { System.err.println("转账失败: " + e.getMessage()); System.err.println("错误代码: " + e.getErrCode()); System.err.println("错误描述: " + e.getErrCodeDes()); } } /** * 通过商户单号查询转账结果 */ public void queryByOutBillNoExample() { try { String outBillNo = "TRANSFER_1642567890123"; TransferBillsGetResult result = transferService.getBillsByOutBillNo(outBillNo); System.out.println("=== 查询转账结果(商户单号)==="); System.out.println("商户单号: " + result.getOutBillNo()); System.out.println("微信转账单号: " + result.getTransferBillNo()); System.out.println("状态: " + result.getState()); System.out.println("转账金额: " + result.getTransferAmount() + "分"); System.out.println("用户openid: " + result.getOpenid()); System.out.println("转账备注: " + result.getTransferRemark()); } catch (WxPayException e) { System.err.println("查询失败: " + e.getMessage()); } } /** * 通过微信转账单号查询转账结果 */ public void queryByTransferBillNoExample() { try { String transferBillNo = "1000000000000000000000000001"; TransferBillsGetResult result = transferService.getBillsByTransferBillNo(transferBillNo); System.out.println("=== 查询转账结果(微信单号)==="); System.out.println("微信转账单号: " + result.getTransferBillNo()); System.out.println("状态: " + result.getState()); System.out.println("失败原因: " + result.getFailReason()); } catch (WxPayException e) { System.err.println("查询失败: " + e.getMessage()); } } /** * 撤销转账示例 * 注意:只有在特定状态下才能撤销 */ public void cancelTransferExample() { try { String outBillNo = "TRANSFER_1642567890123"; TransferBillsCancelResult result = transferService.transformBillsCancel(outBillNo); System.out.println("=== 撤销转账结果 ==="); System.out.println("商户单号: " + result.getOutBillNo()); System.out.println("状态: " + result.getState()); System.out.println("更新时间: " + result.getUpdateTime()); } catch (WxPayException e) { System.err.println("撤销失败: " + e.getMessage()); } } /** * 处理转账回调通知示例 * 这个方法通常在您的Web服务器的回调接口中调用 */ public void handleNotifyExample(String notifyData, String timestamp, String nonce, String signature, String serial) { try { // 构建签名头信息 SignatureHeader header = new SignatureHeader(); header.setTimeStamp(timestamp); header.setNonce(nonce); header.setSignature(signature); header.setSerial(serial); // 解析并验签回调数据 TransferBillsNotifyResult notifyResult = transferService.parseTransferBillsNotifyResult(notifyData, header); System.out.println("=== 处理转账回调通知 ==="); System.out.println("商户单号: " + notifyResult.getResult().getOutBillNo()); System.out.println("微信转账单号: " + notifyResult.getResult().getTransferBillNo()); System.out.println("状态: " + notifyResult.getResult().getState()); System.out.println("转账金额: " + notifyResult.getResult().getTransferAmount() + "分"); System.out.println("更新时间: " + notifyResult.getResult().getUpdateTime()); // 根据状态处理业务逻辑 switch (notifyResult.getResult().getState()) { case "SUCCESS": System.out.println("转账成功,进行业务处理..."); // 更新订单状态、发送通知等 break; case "FAIL": System.out.println("转账失败,失败原因: " + notifyResult.getResult().getFailReason()); // 处理失败逻辑 break; default: System.out.println("其他状态: " + notifyResult.getResult().getState()); } } catch (WxPayException e) { System.err.println("回调处理失败: " + e.getMessage()); } } /** * 批量转账示例(使用传统API) * 注意:新商户可能无法使用此API,建议使用新版单笔转账API */ public void batchTransferExample() { try { // 构建转账明细列表 TransferBatchesRequest.TransferDetail detail1 = TransferBatchesRequest.TransferDetail.newBuilder() .outDetailNo("DETAIL_" + System.currentTimeMillis() + "_1") .transferAmount(100) // 1元 .transferRemark("佣金1") .openid("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o") .userName("张三") .build(); TransferBatchesRequest.TransferDetail detail2 = TransferBatchesRequest.TransferDetail.newBuilder() .outDetailNo("DETAIL_" + System.currentTimeMillis() + "_2") .transferAmount(200) // 2元 .transferRemark("佣金2") .openid("oUpF8uMuAJO_M2pxb1Q9zNjWeS6p") .userName("李四") .build(); // 构建批量转账请求 TransferBatchesRequest batchRequest = TransferBatchesRequest.newBuilder() .appid("wx1234567890123456") .outBatchNo("BATCH_" + System.currentTimeMillis()) .batchName("佣金批量发放") .batchRemark("2024年1月佣金") .totalAmount(300) // 总金额:3元 .totalNum(2) // 总笔数:2笔 .transferDetailList(java.util.Arrays.asList(detail1, detail2)) .transferSceneId("1005") // 转账场景ID .build(); // 发起批量转账 TransferBatchesResult batchResult = transferService.transferBatches(batchRequest); System.out.println("=== 批量转账发起成功 ==="); System.out.println("商户批次单号: " + batchResult.getOutBatchNo()); System.out.println("微信批次单号: " + batchResult.getBatchId()); System.out.println("批次状态: " + batchResult.getBatchStatus()); } catch (WxPayException e) { System.err.println("批量转账失败: " + e.getMessage()); } } /** * 使用免确认收款授权模式进行转账示例 * 注意:使用此模式前,用户需要先进行授权 */ public void transferWithNoConfirmAuthModeExample() { try { // 构建转账请求,使用免确认收款授权模式 TransferBillsRequest request = TransferBillsRequest.newBuilder() .appid("wx1234567890123456") .outBillNo("NO_CONFIRM_" + System.currentTimeMillis()) // 商户转账单号 .transferSceneId("1005") // 转账场景ID(佣金报酬) .openid("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o") // 收款用户的openid .transferAmount(200) // 转账金额,单位:分(此处为2元) .transferRemark("免确认收款转账") // 转账备注 .receiptAuthorizationMode(WxPayConstants.ReceiptAuthorizationMode.NO_CONFIRM_RECEIPT_AUTHORIZATION) .userRecvPerception("Y") // 用户收款感知 .build(); // 发起转账 TransferBillsResult result = transferService.transferBills(request); System.out.println("=== 免确认授权模式转账成功 ==="); System.out.println("商户单号: " + result.getOutBillNo()); System.out.println("微信转账单号: " + result.getTransferBillNo()); System.out.println("状态: " + result.getState()); System.out.println("说明: 使用免确认授权模式,转账直接到账,无需用户确认"); } catch (WxPayException e) { System.err.println("免确认授权转账失败: " + e.getMessage()); System.err.println("错误代码: " + e.getErrCode()); // 可能的错误原因 if ("USER_NOT_AUTHORIZED".equals(e.getErrCode())) { System.err.println("用户未授权免确认收款,请先引导用户进行授权"); } } } /** * 使用需确认收款授权模式进行转账示例(默认模式) */ public void transferWithConfirmAuthModeExample() { try { // 构建转账请求,显式设置为需确认收款授权模式 TransferBillsRequest request = TransferBillsRequest.newBuilder() .appid("wx1234567890123456") .outBillNo("CONFIRM_" + System.currentTimeMillis()) // 商户转账单号 .transferSceneId("1005") // 转账场景ID .openid("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o") // 收款用户的openid .transferAmount(150) // 转账金额,单位:分(此处为1.5元) .transferRemark("需确认收款转账") // 转账备注 .receiptAuthorizationMode(WxPayConstants.ReceiptAuthorizationMode.CONFIRM_RECEIPT_AUTHORIZATION) .userRecvPerception("Y") // 用户收款感知 .build(); // 发起转账 TransferBillsResult result = transferService.transferBills(request); System.out.println("=== 需确认授权模式转账成功 ==="); System.out.println("商户单号: " + result.getOutBillNo()); System.out.println("微信转账单号: " + result.getTransferBillNo()); System.out.println("状态: " + result.getState()); System.out.println("packageInfo: " + result.getPackageInfo()); System.out.println("说明: 使用需确认授权模式,用户需要手动确认才能收款"); } catch (WxPayException e) { System.err.println("需确认授权转账失败: " + e.getMessage()); } } /** * 权限模式对比示例 * 展示两种权限模式的区别和使用场景 */ public void authModeComparisonExample() { System.out.println("\n=== 收款授权模式对比 ==="); System.out.println("1. 需确认收款授权模式 (CONFIRM_RECEIPT_AUTHORIZATION):"); System.out.println(" - 这是默认模式"); System.out.println(" - 用户收到转账后需要手动点击确认才能到账"); System.out.println(" - 适用于一般的转账场景"); System.out.println(" - 转账状态可能包含 WAIT_USER_CONFIRM 等待确认状态"); System.out.println("\n2. 免确认收款授权模式 (NO_CONFIRM_RECEIPT_AUTHORIZATION):"); System.out.println(" - 用户事先授权后,转账直接到账,无需确认"); System.out.println(" - 提升用户体验,减少操作步骤"); System.out.println(" - 适用于高频转账场景,如佣金发放等"); System.out.println(" - 需要用户先进行授权,否则会返回授权错误"); System.out.println("\n使用建议:"); System.out.println("- 高频业务场景推荐使用免确认模式,提升用户体验"); System.out.println("- 首次使用需引导用户进行授权"); System.out.println("- 处理授权相关异常,提供友好的错误提示"); } /** * 使用配置示例 */ public static void main(String[] args) { // 配置微信支付参数 WxPayConfig config = new WxPayConfig(); config.setAppId("wx1234567890123456"); // 应用ID config.setMchId("1234567890"); // 商户ID config.setApiV3Key("your_api_v3_key_32_chars"); // APIv3密钥 config.setPrivateKeyPath("path/to/private.pem"); // 商户私钥文件路径 config.setCertSerialNo("your_certificate_serial"); // 商户证书序列号 // 创建示例实例 NewTransferApiExample example = new NewTransferApiExample(config); // 权限模式对比说明 example.authModeComparisonExample(); // 运行示例 System.out.println("新版商户转账API使用示例"); System.out.println("==============================="); // 1. 发起转账(使用免确认授权模式) // example.transferWithNoConfirmAuthModeExample(); // 2. 发起转账(使用需确认授权模式) // example.transferWithConfirmAuthModeExample(); // 3. 发起单笔转账(默认模式) example.transferExample(); // 4. 查询转账结果 // example.queryByOutBillNoExample(); // 5. 撤销转账 // example.cancelTransferExample(); // 6. 批量转账(传统API) // example.batchTransferExample(); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/example/BusinessOperationTransferExample.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/example/BusinessOperationTransferExample.java
package com.github.binarywang.wxpay.example; import com.github.binarywang.wxpay.bean.transfer.*; import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.constant.WxPayConstants; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.BusinessOperationTransferService; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl; /** * 运营工具-商家转账API使用示例 * * 微信支付为商户提供的运营工具转账能力,用于商户的日常运营活动中进行转账操作 * * @author WxJava Team * @see <a href="https://pay.weixin.qq.com/doc/v3/merchant/4012711988">运营工具-商家转账API</a> */ public class BusinessOperationTransferExample { private WxPayService wxPayService; private BusinessOperationTransferService businessOperationTransferService; public void init() { // 初始化配置 WxPayConfig config = new WxPayConfig(); config.setAppId("your_app_id"); config.setMchId("your_mch_id"); config.setMchKey("your_mch_key"); config.setKeyPath("path_to_your_cert.p12"); // 初始化服务 wxPayService = new WxPayServiceImpl(); wxPayService.setConfig(config); businessOperationTransferService = wxPayService.getBusinessOperationTransferService(); } /** * 发起运营工具转账示例 */ public void createOperationTransferExample() { try { // 构建转账请求 BusinessOperationTransferRequest request = BusinessOperationTransferRequest.newBuilder() .appid("your_app_id") // 应用ID .outBillNo("OT" + System.currentTimeMillis()) // 商户转账单号 .operationSceneId(WxPayConstants.OperationSceneId.OPERATION_CASH_MARKETING) // 运营工具转账场景ID .openid("user_openid") // 用户openid .userName("张三") // 用户姓名(可选) .transferAmount(100) // 转账金额,单位分 .transferRemark("运营活动奖励") // 转账备注 .userRecvPerception(WxPayConstants.UserRecvPerception.CASH_MARKETING.CASH) // 用户收款感知 .notifyUrl("https://your-domain.com/notify") // 回调通知地址 .build(); // 发起转账 BusinessOperationTransferResult result = businessOperationTransferService.createOperationTransfer(request); System.out.println("转账成功!"); System.out.println("商户单号: " + result.getOutBillNo()); System.out.println("微信转账单号: " + result.getTransferBillNo()); System.out.println("转账状态: " + result.getTransferState()); System.out.println("创建时间: " + result.getCreateTime()); } catch (WxPayException e) { System.err.println("转账失败: " + e.getMessage()); e.printStackTrace(); } } /** * 通过商户单号查询转账结果示例 */ public void queryByOutBillNoExample() { try { String outBillNo = "OT1640995200000"; // 商户转账单号 BusinessOperationTransferQueryResult result = businessOperationTransferService .queryOperationTransferByOutBillNo(outBillNo); System.out.println("查询成功!"); System.out.println("商户单号: " + result.getOutBillNo()); System.out.println("微信转账单号: " + result.getTransferBillNo()); System.out.println("转账状态: " + result.getTransferState()); System.out.println("转账金额: " + result.getTransferAmount() + "分"); System.out.println("创建时间: " + result.getCreateTime()); System.out.println("更新时间: " + result.getUpdateTime()); } catch (WxPayException e) { System.err.println("查询失败: " + e.getMessage()); e.printStackTrace(); } } /** * 通过微信转账单号查询转账结果示例 */ public void queryByTransferBillNoExample() { try { String transferBillNo = "1040000071100999991182020050700019480001"; // 微信转账单号 BusinessOperationTransferQueryResult result = businessOperationTransferService .queryOperationTransferByTransferBillNo(transferBillNo); System.out.println("查询成功!"); System.out.println("商户单号: " + result.getOutBillNo()); System.out.println("微信转账单号: " + result.getTransferBillNo()); System.out.println("运营场景ID: " + result.getOperationSceneId()); System.out.println("转账状态: " + result.getTransferState()); } catch (WxPayException e) { System.err.println("查询失败: " + e.getMessage()); e.printStackTrace(); } } /** * 使用配置示例 */ public static void main(String[] args) { BusinessOperationTransferExample example = new BusinessOperationTransferExample(); // 初始化配置 example.init(); // 1. 发起运营工具转账 example.createOperationTransferExample(); // 2. 查询转账结果 // example.queryByOutBillNoExample(); // 3. 通过微信转账单号查询 // example.queryByTransferBillNoExample(); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/WxPayApiData.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/WxPayApiData.java
package com.github.binarywang.wxpay.bean; import lombok.Data; import lombok.NoArgsConstructor; /** * <pre> * 微信支付接口请求数据封装对象 * Created by Binary Wang on 2017-8-25. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data @NoArgsConstructor public class WxPayApiData { /** * 接口请求地址 */ private String url; /** * 请求数据 */ private String requestData; /** * 响应数据 */ private String responseData; /** * 接口请求异常信息 */ private String exceptionMsg; /** * Instantiates a new Wx pay api data. * * @param url 接口请求地址 * @param requestData 请求数据 * @param responseData 响应数据 * @param exceptionMsg 接口请求异常信息 */ public WxPayApiData(String url, String requestData, String responseData, String exceptionMsg) { this.url = url; this.requestData = requestData; this.responseData = responseData; this.exceptionMsg = exceptionMsg; } @Override public String toString() { if (this.exceptionMsg != null) { return String.format("\n【请求地址】:%s\n【请求数据】:%s\n【异常信息】:%s", this.url, this.requestData, this.exceptionMsg); } return String.format("\n【请求地址】:%s\n【请求数据】:%s\n【响应数据】:%s", this.url, this.requestData, this.responseData); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreSignPlanRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreSignPlanRequest.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import lombok.experimental.SuperBuilder; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import java.util.List; /** * @author UltramanNoa * @className WxPartnerPayScoreSignPlanRequest * @description 支付分计划请求参数 * @createTime 2023/11/3 09:54 **/ @Data @SuperBuilder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) @EqualsAndHashCode(callSuper = true) public class WxPartnerPayScoreSignPlanRequest extends WxPayScoreRequest { private static final long serialVersionUID = 6269843192878112955L; public String toJson() { return WxGsonBuilder.create().toJson(this); } /** * 子商户appid */ @SerializedName("sub_appid") private String subAppid; /** * 子商户mchid */ @SerializedName("sub_mchid") private String subMchid; /** * 子商户公众号下的用户标识 */ @SerializedName("sub_openid") private String subOpenid; /** * 支付分计划名称 */ @SerializedName("plan_name") private String planName; /** * 支付分计划有效期(单位天) */ @SerializedName("plan_duration") private Integer planDuration; /** * 支付分计划扣费次数 */ @SerializedName("deduction_quantity") private Integer deductionQuantity; /** * 支付分计划原总金额(单位分) */ @SerializedName("total_original_price") private Integer totalOriginalPrice; /** * 支付分计划实际扣费总金额(单位分) */ @SerializedName("total_actual_price") private Integer totalActualPrice; /** * 支付分计划明细列表 */ @SerializedName("plan_detail_list") private List<PayScorePlanDetailRequest> planDetailList; /** * 商户侧计划号 */ @SerializedName("merchant_plan_no") private String merchantPlanNo; /** * 待创建服务订单对应的用户的签约计划 */ @SerializedName("sign_plan_id") private String signPlanId; /** * 待创建服务订单对应的用户的签约计划详情序号 */ @SerializedName("plan_detail_no") private Integer planDetailNo; /** * 商户侧订单号 */ @SerializedName("out_trade_no") private String outTradeNo; /** * 支付分计划ID */ @SerializedName("plan_id") private String planId; /** * 商户签约计划单号 */ @SerializedName("merchant_sign_plan_no") private String merchantSignPlanNo; /** * 签约计划对应的计划详情列表的商户侧单号信息 */ @SerializedName("sign_plan_detail") private List<UserSignPlanDetailMerchatNo> signPlanDetail; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerUserAuthorizationStatusNotifyResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerUserAuthorizationStatusNotifyResult.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 授权/解除授权服务回调通知结果 * <pre> * 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/Offline/apis/chapter6_2_23.shtml * </pre> */ @Data @NoArgsConstructor @EqualsAndHashCode(callSuper = true) public class WxPartnerUserAuthorizationStatusNotifyResult extends UserAuthorizationStatusNotifyResult implements Serializable { private static final long serialVersionUID = 8809250065540275783L; /** * <pre> * 字段名:子商户应用ID * 变量名:sub_appid * 是否必填:是 * 类型:string[1,32] * 描述: * 子商户申请的公众号或移动应用APPID。 * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "sub_appid") private String subAppId; /** * <pre> * 字段名:子商户的商户号 * 变量名:sub_mchid * 是否必填:是 * 类型:string[1,32] * 描述: * 子商户商户号,由微信支付生成并下发。 * 示例值:1230000109 * </pre> */ @SerializedName(value = "sub_mchid") private String subMchId; /** * <pre> * 字段名:子商户公众号下openid * 变量名:sub_mchid * 是否必填:是 * 类型:string[1,32] * 描述: * 微信用户在商户对应sub_appid下的唯一标识。(传了sub_appid的情况下则只返回sub_openid)。 * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o * </pre> */ @SerializedName(value = "sub_openid") private String subOpenid; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreResult.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.common.util.json.WxGsonBuilder; /** * @author hallkk * created on 2022/05/18 */ @Data @NoArgsConstructor public class WxPartnerPayScoreResult extends WxPayScoreResult { private static final long serialVersionUID = 718267574622164410L; public static WxPartnerPayScoreResult fromJson(String json) { return WxGsonBuilder.create().fromJson(json, WxPartnerPayScoreResult.class); } @SerializedName("sub_appid") private String subAppid; @SerializedName("sub_mchid") private String subMchid; /** * 子商户公众号下的用户标识 */ @SerializedName("sub_openid") private String subOpenId; @SerializedName("out_apply_no") private String outApplyNo; @SerializedName("result_notify_url") private String resultNotifyUrl; @SerializedName("apply_state") private String applyState; @SerializedName("reject_reason") private String rejectReason; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/RiskFund.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/RiskFund.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 订单风险金信息. * * @author doger.wang * created on 2020-05-19 */ @Data @NoArgsConstructor public class RiskFund implements Serializable { private static final long serialVersionUID = -3583406084396059152L; /** * name : ESTIMATE_ORDER_COST * amount : 10000 * description : 就餐的预估费用 */ @SerializedName("name") private String name; @SerializedName("amount") private int amount; @SerializedName("description") private String description; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Location.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Location.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 服务位置信息. * * @author doger.wang * created on 2020-05-19 */ @Data @NoArgsConstructor public class Location implements Serializable { private static final long serialVersionUID = -4510224826631515344L; /** * start_location : 嗨客时尚主题展餐厅 * end_location : 嗨客时尚主题展餐厅 */ @SerializedName("start_location") private String startLocation; @SerializedName("end_location") private String endLocation; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreResult.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import java.io.Serializable; import java.util.List; import java.util.Map; /** * @author doger.wang * created on 2020/5/12 17:05 */ @NoArgsConstructor @Data public class WxPayScoreResult implements Serializable { private static final long serialVersionUID = 8809250065540275770L; public static WxPayScoreResult fromJson(String json) { return WxGsonBuilder.create().fromJson(json, WxPayScoreResult.class); } /** * appid : wxd678efh567hg6787 * mchid : 1230000109 * out_order_no : 1234323JKHDFE1243252 * service_id : 500001 * service_introduction : 某某酒店 * state : CREATED * state_description : MCH_COMPLETE * post_payments : [{"name":"就餐费用服务费","amount":4000,"description":"就餐人均100元服务费:100/小时","count":1}] * post_discounts : [{"name":"满20减1元","description":"不与其他优惠叠加"}] * risk_fund : {"name":" ESTIMATE_ORDER_COST","amount":10000,"description":"就餐的预估费用"} * time_range : {"start_time":"20091225091010","end_time":"20091225121010"} * location : {"start_location":"嗨客时尚主题展餐厅","end_location":"嗨客时尚主题展餐厅"} * attach : Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald * notify_url : https://api.test.com * order_id : 15646546545165651651 * package : DJIOSQPYWDxsjdldeuwhdodwxasd_dDiodnwjh9we */ @SerializedName("appid") private String appid; @SerializedName("mchid") private String mchid; @SerializedName("out_order_no") private String outOrderNo; @SerializedName("service_id") private String serviceId; @SerializedName("service_introduction") private String serviceIntroduction; @SerializedName("state") private String state; @SerializedName("state_description") private String stateDescription; @SerializedName("risk_fund") private RiskFund riskFund; @SerializedName("time_range") private TimeRange timeRange; @SerializedName("location") private Location location; @SerializedName("attach") private String attach; @SerializedName("notify_url") private String notifyUrl; @SerializedName("order_id") private String orderId; @SerializedName("package") private String packageX; @SerializedName("post_payments") private List<PostPayment> postPayments; @SerializedName("post_discounts") private List<PostDiscount> postDiscounts; @SerializedName("need_collection") private boolean needCollection; /** * 收款信息 */ @SerializedName("collection") private Collection collection; /** * 用于跳转的sign注意区分需确认模式和无需确认模式的数据差别。创单接口会返回,查询请自行组装 */ @SerializedName("payScoreSignInfo") private Map<String, String> payScoreSignInfo; @SerializedName("openid") private String openid; @SerializedName("apply_permissions_token") private String applyPermissionsToken; @SerializedName("authorization_code") private String authorizationCode; @SerializedName("authorization_state") private String authorizationState; @SerializedName("cancel_authorization_time") private String cancelAuthorizationTime; @SerializedName("authorization_success_time") private String authorizationSuccessTime; /** * 用户分层 */ @SerializedName("user_risk_level") private Integer userRiskLevel; /** * 分层版本 */ @SerializedName("risk_level_version") private Integer riskLevelVersion; /** * 总金额 */ @SerializedName("total_amount") private Integer totalAmount; /** * 渠道商商户号 */ @SerializedName("channel_id") private String channelId; /** * 收款信息 */ @Data @NoArgsConstructor public static class Collection implements Serializable { private static final long serialVersionUID = 2279516555276133086L; /** * state : USER_PAID * total_amount : 3900 * paying_amount : 3000 * paid_amount : 900 * details : [{"seq":1,"amount":900,"paid_type":"NEWTON","paid_time":"20091225091210","transaction_id":"15646546545165651651"}] */ @SerializedName("state") private String state; @SerializedName("total_amount") private int totalAmount; @SerializedName("paying_amount") private int payingAmount; @SerializedName("paid_amount") private int paidAmount; @SerializedName("details") private List<Detail> details; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PostDiscount.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PostDiscount.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 后付费商户优惠. * * @author doger.wang * created on 2020-05-19 */ @Data @NoArgsConstructor public class PostDiscount implements Serializable { private static final long serialVersionUID = 2764537888242763379L; /** * name : 满20减1元 * description : 不与其他优惠叠加 */ @SerializedName("name") private String name; @SerializedName("description") private String description; @SerializedName("count") private int count; @SerializedName("amount") private int amount; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreRequest.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import lombok.experimental.SuperBuilder; import me.chanjar.weixin.common.util.json.WxGsonBuilder; @Data @SuperBuilder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) @EqualsAndHashCode(callSuper = true) public class WxPartnerPayScoreRequest extends WxPayScoreRequest { private static final long serialVersionUID = 6269843192878112955L; public String toJson() { return WxGsonBuilder.create().toJson(this); } /** * 子商户appid */ @SerializedName("sub_appid") private String subAppid; /** * 子商户mchid */ @SerializedName("sub_mchid") private String subMchid; /** * 子商户公众号下的用户表示sub_openid * 微信用户在子商户公众号sub_appid下的唯一标识; * need_user_confirm为false时,1. openid与sub_openid必须填写并且只能填写一个 2. 如果填写了sub_openid,那么sub_appid必填 */ @SerializedName("sub_openid") private String subOpenid; /** * [收付通子商户申请绑定支付分服务]的商户系统内部服务订单号 */ @SerializedName("out_apply_no") private String outApplyNo; /** * [收付通子商户申请绑定支付分服务]的绑定结果通知地址 */ @SerializedName("result_notify_url") private String resultNotifyUrl; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PartnerUserSignPlanEntity.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PartnerUserSignPlanEntity.java
package com.github.binarywang.wxpay.bean.payscore; import com.github.binarywang.wxpay.bean.payscore.enums.SignPlanServiceOrderStateEnum; import com.github.binarywang.wxpay.bean.payscore.enums.UserSignPlanCancelSignTypeEnum; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import java.io.Serializable; import java.util.List; /** * @author UltramanNoa * @className PartnerUserSignPlanEntity * @description 用户的签约计划 * @createTime 2023/11/3 16:05 **/ @Data @NoArgsConstructor public class PartnerUserSignPlanEntity implements Serializable { private static final long serialVersionUID = -662901613603698430L; public static PartnerUserSignPlanEntity fromJson(String json) { return WxGsonBuilder.create().fromJson(json, PartnerUserSignPlanEntity.class); } /** * 待创建服务订单对应的用户的签约计划 */ @SerializedName("sign_plan_id") private String signPlanId; @SerializedName("openid") private String openid; /** * <pre> * 字段名:二级商户用户标识 * 变量名:sub_openid * 是否必填:否 * 类型:string(128) * 描述: * 用户在二级商户appid下的唯一标识。 * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o * </pre> */ @SerializedName(value = "sub_openid") private String subOpenid; @SerializedName("service_id") private String serviceId; @SerializedName("mchid") private String mchid; /** * 子商户商户号 */ @SerializedName("sub_mchid") private String subMchid; @SerializedName("appid") private String appid; /** * 子商户AppID */ @SerializedName("sub_appid") private String subAppid; /** * 商户签约计划单号 */ @SerializedName("merchant_sign_plan_no") private String merchantSignPlanNo; /** * 商户回调地址 */ @SerializedName("merchant_callback_url") private String merchantCallbackUrl; /** * 支付分计划ID */ @SerializedName("plan_id") private String planId; /** * 目前用户进行到的计划详情序号 */ @SerializedName("going_detail_no") private Integer goingDetailNo; /** * 计划签约状态 * * @see SignPlanServiceOrderStateEnum */ @SerializedName("sign_state") private String signState; /** * 签约计划取消时间 */ @SerializedName("cancel_sign_time") private String cancelSignTime; /** * 签约计划取消类型 * * @see UserSignPlanCancelSignTypeEnum */ @SerializedName("cancel_sign_type") private String cancelSignType; /** * 签约计划取消原因 */ @SerializedName("cancel_reason") private String cancelReason; /** * 签约计划的名称 */ @SerializedName("plan_name") private String planName; /** * 签约计划的过期时间 */ @SerializedName("plan_over_time") private String planOverTime; /** * 签约计划原总金额(单位分) */ @SerializedName("total_origin_price") private Integer totalOriginPrice; /** * 签约计划扣费次数 */ @SerializedName("deduction_quantity") private Integer deductionQuantity; /** * 签约计划实际总金额(单位分) */ @SerializedName("total_actual_price") private Integer totalActualPrice; @SerializedName("signed_detail_list") private List<PartnerUserSignPlanDetail> signedDetailList; /** * 签约时间 */ @SerializedName("sign_time") private String signTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreUserSignPlanResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreUserSignPlanResult.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import java.io.Serializable; /** * @author UltramanNoa * @className WxPartnerUserSignPlanResult * @description 微信支付分用户签约计划返回 * @createTime 2023/11/3 16:38 **/ @Data @NoArgsConstructor public class WxPartnerPayScoreUserSignPlanResult implements Serializable { private static final long serialVersionUID = 4148075707018175845L; public static WxPartnerPayScoreUserSignPlanResult fromJson(String json) { return WxGsonBuilder.create().fromJson(json, WxPartnerPayScoreUserSignPlanResult.class); } @SerializedName("sign_plan") private PartnerUserSignPlanEntity signPlan; @SerializedName("package") private String pack; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/UserAuthorizationStatusNotifyResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/UserAuthorizationStatusNotifyResult.java
package com.github.binarywang.wxpay.bean.payscore; import java.io.Serializable; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * 授权/解除授权服务回调通知结果 * <pre> * 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter4_4.shtml * </pre> */ @Data @NoArgsConstructor public class UserAuthorizationStatusNotifyResult implements Serializable { /** * 源数据 */ private PayScoreNotifyData rawData; /** * <pre> * 字段名:公众账号ID * 变量名:appid * 是否必填:是 * 类型:string[1,32] * 描述: * 调用授权服务接口提交的公众账号ID。 * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "appid") private String appid; /** * <pre> * 字段名:商户号 * 变量名:mchid * 是否必填:是 * 类型:string[1,32] * 描述: * 调用授权服务接口提交的商户号。 * 示例值:1230000109 * </pre> */ @SerializedName(value = "mchid") private String mchid; /** * <pre> * 字段名:商户签约单号 * 变量名:out_request_no * 是否必填:否 * 类型: string[1,64] * 描述: * 调用授权服务接口提交的商户请求唯一标识(新签约的用户,且在授权签约中上传了该字段,则在解约授权回调通知中有返回)。 * 示例值:1234323JKHDFE1243252 * </pre> */ @SerializedName(value = "out_request_no") private String outRequestNo; /** * <pre> * 字段名:服务ID * 变量名:service_id * 是否必填:是 * 类型: string[1,32] * 描述: * 调用授权服务接口提交的服务ID。 * 示例值:1234323JKHDFE1243252 * </pre> */ @SerializedName(value = "service_id") private String serviceId; /** * <pre> * 字段名:用户标识 * 变量名:openid * 是否必填:是 * 类型: string[1,128] * 描述: * 微信用户在商户对应appid下的唯一标识。 * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o * </pre> */ @SerializedName(value = "openid") private String openid; /** * <pre> * 字段名:回调状态 * 变量名:user_service_status * 是否必填:否 * 类型: string[1,32] * 描述: * 1、USER_OPEN_SERVICE:授权成功 * 2、USER_CLOSE_SERVICE:解除授权成功 * 示例值:USER_OPEN_SERVICE * </pre> */ @SerializedName(value = "user_service_status") private String userServiceStatus; /** * <pre> * 字段名:服务授权/解除授权时间 * 变量名:openorclose_time * 是否必填:否 * 类型: string[1,32] * 描述: * 服务授权/解除授权成功时间。 * 示例值:20180225112233 * </pre> */ @SerializedName(value = "openorclose_time") private String openOrCloseTime; /** * <pre> * 字段名:授权协议号 * 变量名:authorization_code * 是否必填:否 * 类型: string[1,32] * 描述: * 授权协议号,预授权时返回,非预授权不返回 * 示例值:1275342195190894594 * </pre> */ @SerializedName(value = "authorization_code") private String authorizationCode; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Detail.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Detail.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; /** * 明细. * * @author doger.wang * created on 2020-05-19 */ @Data @NoArgsConstructor public class Detail implements Serializable { private static final long serialVersionUID = -3901373259400050385L; /** * seq : 1 * amount : 900 * paid_type : NEWTON * paid_time : 20091225091210 * transaction_id : 15646546545165651651 */ @SerializedName("seq") private int seq; @SerializedName("amount") private int amount; @SerializedName("paid_type") private String paidType; @SerializedName("paid_time") private String paidTime; @SerializedName("transaction_id") private String transactionId; @SerializedName("promotion_detail") private List<PromotionDetail> promotionDetail; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScoreNotifyData.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScoreNotifyData.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 微信支付分确认订单跟支付回调对象 * * @author doger.wang * created on 2020/5/14 12:18 */ @NoArgsConstructor @Data public class PayScoreNotifyData implements Serializable { private static final long serialVersionUID = -8538014389773390989L; /** * 通知ID */ @SerializedName("id") private String id; /** * 通知创建时间 */ @SerializedName("create_time") private String createTime; /** * 通知类型 * <p>1、授权成功通知的类型为PAYSCORE.USER_OPEN_SERVICE</p> * <p>2、解除授权成功通知的类型为PAYSCORE.USER_CLOSE_SERVICE</p> * <p>3、用户确认成功通知的类型为PAYSCORE.USER_CONFIRM</p> * <p>4、支付成功通知的类型为PAYSCORE.USER_PAID</p> * <p>5、取消签约成功通知类型为PAYSCORE.USER_CANCEL_SIGN_PLAN</p> * <p>6、签约计划成功通知类型为PAYSCORE.USER_SIGN_PLAN</p> */ @SerializedName("event_type") private String eventType; /** * 通知数据类型 */ @SerializedName("resource_type") private String resourceType; /** * 通知数据 */ @SerializedName("resource") private Resource resource; /** * 回调摘要 * summary */ @SerializedName("summary") private String summary; @Data public static class Resource implements Serializable { private static final long serialVersionUID = 8530711804335261449L; /** * 加密算法类型 */ @SerializedName("algorithm") private String algorithm; /** * 数据密文 */ @SerializedName("ciphertext") private String cipherText; /** * 附加数据 */ @SerializedName("nonce") private String nonce; /** * 随机串 */ @SerializedName("associated_data") private String associatedData; /** * 原始回调类型,支付分的原始回调类型为payscore */ @SerializedName("original_type") private String originalType; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PostPayment.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PostPayment.java
package com.github.binarywang.wxpay.bean.payscore; import java.io.Serializable; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * 后付费项目. * * @author doger.wang * created on 2020-05-19 */ @Data @NoArgsConstructor public class PostPayment implements Serializable { private static final long serialVersionUID = 2007722927556382895L; /** * name : 就餐费用服务费 * amount : 4000 * description : 就餐人均100元服务费:100/小时 * count : 1 */ @SerializedName("name") private String name; @SerializedName("amount") private Integer amount; @SerializedName("description") private String description; @SerializedName("count") private Integer count; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Device.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Device.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 设备信息 **/ @Data @NoArgsConstructor @AllArgsConstructor public class Device implements Serializable { private static final long serialVersionUID = -4510224826631515321L; /** * 服务开始的设备ID */ @SerializedName("start_device_id") private String startDeviceId; /** * 服务结束的设备ID */ @SerializedName("end_device_id") private String endDeviceId; /** * 物料编码 */ @SerializedName("materiel_no") private String materielNo; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/SyncDetail.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/SyncDetail.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * @description 内容信息详情 * createTime: 2023/9/19 16:39 **/ @Data @NoArgsConstructor public class SyncDetail implements Serializable { private static final long serialVersionUID = 8173356554917822934L; @SerializedName("seq") private int seq; @SerializedName("paid_time") private String paidTime; @SerializedName("paid_amount") private Integer paidAmount; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScorePlanDetailResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScorePlanDetailResult.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * @author UltramanNoa * @className PayScorePlanDetail * @description 支付分计划明细列表 * @createTime 2023/11/3 11:22 **/ @Data @NoArgsConstructor public class PayScorePlanDetailResult extends PayScorePlanDetailRequest implements Serializable { private static final long serialVersionUID = -2195861995542633650L; /** * 计划明细序号(返回参数) */ @SerializedName("plan_detail_no") private Integer planDetailNo; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/TimeRange.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/TimeRange.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 服务时间范围. * * @author doger.wang * created on 2020-05-19 */ @Data @NoArgsConstructor @AllArgsConstructor public class TimeRange implements Serializable { private static final long serialVersionUID = 8169562173656314930L; /** * start_time : 20091225091010 * end_time : 20091225121010 */ @SerializedName("start_time") private String startTime; @SerializedName("end_time") private String endTime; /** * 服务开始时间备注 */ @SerializedName("start_time_remark") private String startTimeRemark; /** * 服务结束时间备注 */ @SerializedName("end_time_remark") private String endTimeRemark; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PromotionDetail.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PromotionDetail.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; /** * 优惠详情 **/ @Data @NoArgsConstructor public class PromotionDetail implements Serializable { private static final long serialVersionUID = -4405156288317582934L; @SerializedName("coupon_id") private String couponId; @SerializedName("name") private String name; @SerializedName("scope") private String scope; @SerializedName("type") private String type; @SerializedName("amount") private Integer amount; @SerializedName("stock_id") private String stockId; @SerializedName("wechatpay_contribute") private Integer wechatpayContribute; @SerializedName("merchant_contribute") private Integer merchantContribute; @SerializedName("other_contribute") private Integer otherContribute; @SerializedName("currency") private String currency; @SerializedName("goods_detail") private List<GoodsDetail> goodsDetail; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/GoodsDetail.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/GoodsDetail.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 优惠商品信息 **/ @Data @NoArgsConstructor public class GoodsDetail implements Serializable { private static final long serialVersionUID = 7139782546598279686L; @SerializedName("goods_id") private String goodsId; @SerializedName("quantity") private Integer quantity; @SerializedName("unit_price") private Integer unitPrice; @SerializedName("discount_amount") private Integer discountAmount; @SerializedName("goods_remark") private String goodsRemark; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScorePlanDetailRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScorePlanDetailRequest.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * @author UltramanNoa * @className PayScorePlanDetail * @description 支付分计划明细列表 * @createTime 2023/11/3 11:22 **/ @Data @NoArgsConstructor public class PayScorePlanDetailRequest implements Serializable { private static final long serialVersionUID = 999251141141181820L; /** * 计划明细原支付金额(单位分) */ @SerializedName("original_price") private Integer originalPrice; /** * 计划明细优惠说明 */ @SerializedName("plan_discount_description") private String planDiscountDescription; /** * 计划明细实际支付金额(单位分) */ @SerializedName("actual_price") private Long actualPrice; /** * 计划明细名称 */ @SerializedName("plan_detail_name") private String planDetailName; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/UserSignPlanDetailMerchatNo.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/UserSignPlanDetailMerchatNo.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * @author UltramanNoa * @className UserSignPlanDetailMerchatNo * @description 签约计划对应的计划详情列表的商户侧单号信息 * @createTime 2023/11/3 15:51 **/ @Data @NoArgsConstructor public class UserSignPlanDetailMerchatNo implements Serializable { private static final long serialVersionUID = 2668791598158720023L; /** * 计划明细序号 */ @SerializedName("plan_detail_no") private Integer planDetailNo; /** * 商户侧计划明细使用订单号 */ @SerializedName("merchant_plan_detail_no") private String merchantPlanDetailNo; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScorePlanDetail.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PayScorePlanDetail.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * @author UltramanNoa * @className PayScorePlanDetail * @description 支付分计划明细列表 * @createTime 2023/11/3 11:22 **/ @Data @NoArgsConstructor public class PayScorePlanDetail implements Serializable { private static final long serialVersionUID = 999251141141181820L; /** * 计划明细原支付金额(单位分) */ @SerializedName("original_price") private Integer originalPrice; /** * 计划明细优惠说明 */ @SerializedName("plan_discount_description") private String planDiscountDescription; /** * 计划明细实际支付金额(单位分) */ @SerializedName("actual_price") private String actualPrice; /** * 计划明细名称 */ @SerializedName("plan_detail_name") private String planDetailName; /** * 计划明细序号(返回参数) */ @SerializedName("plan_detail_no") private Integer planDetailNo; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequest.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import lombok.experimental.SuperBuilder; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import java.io.Serializable; import java.util.List; /** * @author doger.wang * created on 2020/5/12 16:36 */ @Data @SuperBuilder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class WxPayScoreRequest implements Serializable { private static final long serialVersionUID = 364764508076146082L; public String toJson() { return WxGsonBuilder.create().toJson(this); } /**` * out_order_no : 1234323JKHDFE1243252 * appid : wxd678efh567hg6787 * service_id : 500001 * service_introduction : 某某酒店 * post_payments : [{"name":"就餐费用服务费","amount":4000,"description":"就餐人均100元服务费:100/小时","count":1}] * post_discounts : [{"name":"满20减1元","description":"不与其他优惠叠加"}] * time_range : {"start_time":"20091225091010","end_time":"20091225121010"} * location : {"start_location":"嗨客时尚主题展餐厅","end_location":"嗨客时尚主题展餐厅"} * risk_fund : {"name":"ESTIMATE_ORDER_COST","amount":10000,"description":"就餐的预估费用"} * attach : Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald * notify_url : https://api.test.com * openid : oUpF8uMuAJO_M2pxb1Q9zNjWeS6o * need_user_confirm : true * profitSharing : false:不分账,默认:false,true:分账 * device : {"start_device_id":"202501","end_device_id":"202502","materiel_no":"212323232"} */ @SerializedName("out_order_no") private String outOrderNo; @SerializedName("appid") private String appid; @SerializedName("service_id") private String serviceId; @SerializedName("service_introduction") private String serviceIntroduction; @SerializedName("time_range") private TimeRange timeRange; @SerializedName("location") private Location location; @SerializedName("risk_fund") private RiskFund riskFund; @SerializedName("attach") private String attach; @SerializedName("notify_url") private String notifyUrl; @SerializedName("openid") private String openid; @SerializedName("need_user_confirm") private Boolean needUserConfirm; @SerializedName("profit_sharing") private Boolean profitSharing; @SerializedName("post_payments") private List<PostPayment> postPayments; @SerializedName("post_discounts") private List<PostDiscount> postDiscounts; @SerializedName("total_amount") private Integer totalAmount; @SerializedName("reason") private String reason; @SerializedName("goods_tag") private String goodsTag; @SerializedName("type") private String type; @SerializedName("detail") private SyncDetail detail; @SerializedName("authorization_code") private String authorizationCode; /** * 完结服务时间 * 时间使用ISO 8601所定义的格式。 * 示例: * - YYYY-MM-DDTHH:mm:ss.SSSZ * - YYYY-MM-DDTHH:mm:ssZ * - YYYY-MM-DDTHH:mm:ss.SSS+08:00 * - YYYY-MM-DDTHH:mm:ss+08:00 */ @SerializedName("complete_time") private String completeTime; @SerializedName("device") private Device device; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PartnerUserSignPlanDetail.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/PartnerUserSignPlanDetail.java
package com.github.binarywang.wxpay.bean.payscore; import com.github.binarywang.wxpay.bean.payscore.enums.SignPlanServiceOrderPlanDetailStateEnum; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * @author UltramanNoa * @className PartnerUserSignPlanDetail * @description 签约计划明细列表 * @createTime 2023/11/3 17:19 **/ @Data @NoArgsConstructor public class PartnerUserSignPlanDetail implements Serializable { private static final long serialVersionUID = 2089297485318293622L; /** * 计划明细序号 */ @SerializedName("plan_detail_no") private Integer planDetailNo; /** * 计划明细原支付金额(单位分) */ @SerializedName("original_price") private Integer originalPrice; /** * 计划明细优惠说明 */ @SerializedName("plan_discount_description") private String planDiscountDescription; /** * 计划明细实际支付金额(单位分) */ @SerializedName("actual_price") private Integer actualPrice; /** * 计划明细状态 * * @see SignPlanServiceOrderPlanDetailStateEnum */ @SerializedName("plan_detail_state") private String planDetailState; /** * 计划明细对应的支付分服务单号 */ @SerializedName("order_id") private String orderId; /** * 商户侧计划明细使用订单号 */ @SerializedName("merchant_plan_detail_no") private String merchantPlanDetailNo; /** * 计划详情名称 */ @SerializedName("plan_detail_name") private String planDetailName; /** * 计划明细对应订单实际支付金额(单位分) */ @SerializedName("actual_pay_price") private Integer actualPayPrice; /** * 详情使用时间 */ @SerializedName("use_time") private String useTime; /** * 详情完成时间 */ @SerializedName("complete_time") private String completeTime; /** * 详情取消时间 */ @SerializedName("cancel_time") private String cancelTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreSignPlanResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreSignPlanResult.java
package com.github.binarywang.wxpay.bean.payscore; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import java.util.List; /** * @author UltramanNoa * @className WxPartnerPayScoreSignPlanResult * @description 支付分计划响应参数 * @createTime 2023/11/3 10:11 **/ @Data @NoArgsConstructor public class WxPartnerPayScoreSignPlanResult extends WxPayScoreResult { private static final long serialVersionUID = 4048529978029913621L; public static WxPartnerPayScoreSignPlanResult fromJson(String json) { return WxGsonBuilder.create().fromJson(json, WxPartnerPayScoreSignPlanResult.class); } /** * 子商户AppID */ @SerializedName("sub_appid") private String subAppid; /** * 子商户商户号 */ @SerializedName("sub_mchid") private String subMchid; /** * 支付分计划ID */ @SerializedName("plan_id") private String planId; /** * 商户侧计划号 */ @SerializedName("merchant_plan_no") private String merchantPlanNo; /** * 支付分计划名称 */ @SerializedName("plan_name") private String planName; /** * 支付分计划有效期(单位天) */ @SerializedName("plan_duration") private String planDuration; /** * 支付分计划状态 * * @see */ @SerializedName("plan_state") private String planState; /** * 支付分计划原总金额(单位分) */ @SerializedName("total_original_price") private String totalOriginalPrice; /** * 支付分计划扣费次数 */ @SerializedName("deduction_quantity") private String deductionQuantity; /** * 支付分计划实际扣费总金额(单位分) */ @SerializedName("total_actual_price") private Integer totalActualPrice; /** * 支付分计划明细列表 */ @SerializedName("plan_detail_list") private List<PayScorePlanDetailResult> planDetailList; /** * 终止方商户号 */ @SerializedName("stop_mchid") private String stopMchid; /** * 终止时间 */ @SerializedName("stop_time") private String stopTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/enums/UserSignPlanCancelSignTypeEnum.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/enums/UserSignPlanCancelSignTypeEnum.java
package com.github.binarywang.wxpay.bean.payscore.enums; /** * @author UltramanNoa * @className UserSignPlanCancelSignTypeEnum * @description 签约计划取消类型 * @createTime 2023/11/3 17:15 **/ public enum UserSignPlanCancelSignTypeEnum { /** * 用户已签约协议未取消 */ NOT_CANCEL, /** * 用户取消已签约的协议 */ USER, /** * 商户取消已签约的协议 */ MERCHANT, /** * 用户解除服务授权时取消服务下的已签约协议 */ REVOKE_SERVICE, ; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/enums/SignPlanServiceOrderPlanDetailStateEnum.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/enums/SignPlanServiceOrderPlanDetailStateEnum.java
package com.github.binarywang.wxpay.bean.payscore.enums; /** * @author UltramanNoa * @className SignPlanServiceOrderPlanDetailStateEnum * @description 计划明细状态 * @createTime 2023/11/3 17:43 **/ public enum SignPlanServiceOrderPlanDetailStateEnum { /** * 本计划详情还未使用 */ NOT_USED, /** * 本计划详情使用中,已有对应的服务订单 */ USING, /** * 本计划详情已使用,对应的服务订单已完成支付 */ USED, /** * 本计划详情已取消使用,对应的服务订单已取消 */ SIGN_PLAN_DETAIL_CANCEL, ; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/enums/SignPlanServiceOrderStateEnum.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/enums/SignPlanServiceOrderStateEnum.java
package com.github.binarywang.wxpay.bean.payscore.enums; /** * @author UltramanNoa * @className SignPlanServiceOrderStateEnum * @description 签约计划服务订单状态 * @createTime 2023/11/3 15:28 **/ public enum SignPlanServiceOrderStateEnum { /** * 商户已创建服务订单 */ CREATED, /** * 服务订单进行中 */ DOING, /** * 服务订单完成 */ DONE, /** * 商户取消服务订单 */ REVOKED, /** * 服务订单已失效 */ EXPIRED, ; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankingResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankingResult.java
package com.github.binarywang.wxpay.bean.bank; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import lombok.Setter; import java.io.Serializable; import java.util.List; /** * 个人业务的银行列表 * * @author zhongjun **/ @Data public class BankingResult implements Serializable { private static final long serialVersionUID = -8372812998971715894L; /** * 银行列表数据的总条数,调用方需要根据总条数分页查询 */ @SerializedName("total_count") private Integer totalCount; /** * 本次查询银行列表返回的数据条数 */ @SerializedName("count") private Integer count; /** * 该次请求资源的起始位置,请求中包含偏移量时应答消息返回相同偏移量,否则返回默认值0。 */ @SerializedName("offset") private Integer offset; @SerializedName("data") private List<BankInfo> data; @SerializedName("links") private Link links; @Getter @Setter public static class Link implements Serializable { private static final long serialVersionUID = -8372812998971715894L; /** * 下一页链接 */ @SerializedName("next") private String next; /** * 上一页链接 */ @SerializedName("prev") private String prev; /** * 当前链接 */ @SerializedName("self") private String self; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankAccountResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankAccountResult.java
package com.github.binarywang.wxpay.bean.bank; import com.google.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; import java.util.List; /** * 对私银行卡号开户银行信息 * * @author zhongjun **/ @Data public class BankAccountResult implements Serializable { private static final long serialVersionUID = -8226859146533243501L; /** * 根据卡号查询到的银行列表数据的总条数,未查询到对应银行列表时默认返回0,最大不超过两百条。 */ @SerializedName("total_count") private Integer totalCount; @SerializedName("data") private List<BankInfo> data; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankInfo.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankInfo.java
package com.github.binarywang.wxpay.bean.bank; import com.google.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; /** * 银行信息 * * @author zhongjun * created on 2022/5/12 **/ @Data public class BankInfo implements Serializable { private static final long serialVersionUID = 1L; /** * 银行别名 */ @SerializedName("bank_alias") private String bankAlias; /** * 银行别名编码 */ @SerializedName("bank_alias_code") private String bankAliasCode; /** * 开户银行 */ @SerializedName("account_bank") private String accountBank; /** * 开户银行编码 */ @SerializedName("account_bank_code") private Integer accountBankCode; /** * 是否需要填写支行 */ @SerializedName("need_bank_branch") private Boolean needBankBranch; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/CitiesResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/CitiesResult.java
package com.github.binarywang.wxpay.bean.bank; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import lombok.Setter; import java.io.Serializable; import java.util.List; /** * 城市列表 * * @author hupeng **/ @Data public class CitiesResult implements Serializable { private static final long serialVersionUID = -6089905695087974693L; /** * <pre> * 字段名:查询数据总条数 * 变量名:total_count * 是否必填:是 * 类型:int * 描述: * 查询到的省份数据总条数 * 示例值:10 * </pre> */ @SerializedName("total_count") private Integer totalCount; /** * <pre> * 字段名:城市列表 * 变量名:data * 是否必填:否 * 类型:array * 描述: * 查询返回的城市列表结果 * </pre> */ @SerializedName("data") private List<CityInfo> data; @Getter @Setter public static class CityInfo implements Serializable { private static final long serialVersionUID = -6089905695087974693L; /** * <pre> * 字段名:城市名称 * 变量名:city_name * 是否必填:是 * 类型:string[1, 256] * 描述: * 城市名称 * 示例值:北京市 * </pre> */ @SerializedName("city_name") private String cityName; /** * <pre> * 字段名:城市编码 * 变量名:city_code * 是否必填:是 * 类型:int * 描述: * 城市编码,唯一标识一座城市,用于结合银行别名编码查询支行列表 * 示例值:10 * </pre> */ @SerializedName("city_code") private Integer cityCode; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/ProvincesResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/ProvincesResult.java
package com.github.binarywang.wxpay.bean.bank; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import lombok.Setter; import java.io.Serializable; import java.util.List; /** * 省份列表 * * @author hupeng **/ @Data public class ProvincesResult implements Serializable { private static final long serialVersionUID = -4118613374545722650L; /** * <pre> * 字段名:查询数据总条数 * 变量名:total_count * 是否必填:是 * 类型:int * 描述: * 查询到的省份数据总条数 * 示例值:10 * </pre> */ @SerializedName("total_count") private Integer totalCount; /** * <pre> * 字段名:省份列表 * 变量名:data * 是否必填:否 * 类型:array * 描述: * 查询到的省份列表数组 * </pre> */ @SerializedName("data") private List<ProvinceInfo> data; @Getter @Setter public static class ProvinceInfo implements Serializable { private static final long serialVersionUID = -4118613374545722650L; /** * <pre> * 字段名:省份名称 * 变量名:province_name * 是否必填:是 * 类型:string[1, 256] * 描述: * 省份名称 * 示例值:广东省 * </pre> */ @SerializedName("province_name") private String provinceName; /** * <pre> * 字段名:省份编码 * 变量名:province_code * 是否必填:是 * 类型:int * 描述: * 省份编码,唯一标识一个省份,用于根据省份编码查询省份下的城市列表数据 * 示例值:22 * </pre> */ @SerializedName("province_code") private Integer provinceCode; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/PageLink.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/PageLink.java
package com.github.binarywang.wxpay.bean.bank; import com.google.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; /** * 支行列表 * * @author hupeng **/ @Data public class PageLink implements Serializable { private static final long serialVersionUID = -2624233403271204837L; /** * <pre> * 字段名:下一页链接 * 变量名:next * 是否必填:否 * 类型:string[1, 2048] * 描述: * 使用同样的limit进行下一页查询时的相对请求链接,使用方需要自行根据当前域名进行拼接。如果已经到最后时,为空 * 示例值:/v3/capital/capitallhh/banks/1001/branches?offset=10&limit=5 * </pre> */ @SerializedName("next") private String next; /** * <pre> * 字段名:上一页链接 * 变量名:prev * 是否必填:否 * 类型:string[1, 2048] * 描述: * 使用同样的limit进行上一页查询时的相对请求链接,使用方需要自行根据当前域名进行拼接。如果是第一页,为空 * 示例值:/v3/capital/capitallhh/banks/1001/branchesoffset=0&limit=5 * </pre> */ @SerializedName("prev") private String prev; /** * <pre> * 字段名:当前链接 * 变量名:self * 是否必填:否 * 类型:string[1, 2048] * 描述: * 当前的相对请求链接,使用方需要自行根据当前域名进行拼接 * 示例值:/v3/capital/capitallhh/banks/1001/branches?offset=5&limit=5 * </pre> */ @SerializedName("self") private String self; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankBranchesResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankBranchesResult.java
package com.github.binarywang.wxpay.bean.bank; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import lombok.Setter; import java.io.Serializable; import java.util.List; /** * 支行列表 * * @author hupeng **/ @Data public class BankBranchesResult implements Serializable { private static final long serialVersionUID = -3500020131951579476L; /** * <pre> * 字段名:查询数据总条数 * 变量名:total_count * 是否必填:是 * 类型:int * 描述: * 经过条件筛选,查询到的支行总数 * 示例值:10 * </pre> */ @SerializedName("total_count") private Integer totalCount; /** * <pre> * 字段名:本次查询条数 * 变量名:count * 是否必填:是 * 类型:int * 描述: * 本次查询到的支行数据条数 * 示例值:10 * </pre> */ @SerializedName("count") private Integer count; /** * <pre> * 字段名:支行列表 * 变量名:data * 是否必填:否 * 类型:array * 描述: * 单次查询返回的支行列表结果数组 * </pre> */ @SerializedName("data") private List<BankBranch> data; /** * <pre> * 字段名:本次查询偏移量 * 变量名:offset * 是否必填:是 * 类型:int * 描述: * 该次请求资源的起始位置,请求中包含偏移量时应答消息返回相同偏移量,否则返回默认值0 * 示例值:0 * </pre> */ @SerializedName("offset") private Integer offset; /** * <pre> * 字段名:分页链接 * 变量名:offset * 是否必填:是 * 类型:object * 描述: * 返回前后页和当前页面的访问链接 * </pre> */ @SerializedName("links") private PageLink links; /** * <pre> * 字段名:开户银行 * 变量名:account_bank * 是否必填:是 * 类型:string[1, 128] * 描述: * 查询到的支行所属开户银行的名称,非直连银行统一为其他银行 * 示例值:招商银行其他银行 * </pre> */ @SerializedName("account_bank") private String accountBank; /** * <pre> * 字段名:开户银行编码 * 变量名:account_bank_code * 是否必填:是 * 类型:int * 描述: * 查询到的支行所属开户银行的开户银行编码,可用于付款到银行卡等场景中指定银行卡的开户银行 * 示例值:1001 * </pre> */ @SerializedName("account_bank_code") private Integer accountBankCode; /** * <pre> * 字段名:银行别名 * 变量名:bank_alias * 是否必填:是 * 类型:string[1, 128] * 描述: * 查询到的支行所属银行的银行别名 * 示例值:工商银行深圳前海微众银行 * </pre> */ @SerializedName("bank_alias") private String bankAlias; /** * <pre> * 字段名:银行别名编码 * 变量名:bank_alias_code * 是否必填:是 * 类型:string[1, 32] * 描述: * 查询到的支行所属银行的银行别名编码,用于校验回包 * 示例值:1000006247 * </pre> */ @SerializedName("bank_alias_code") private String bankAliasCode; @Getter @Setter public static class BankBranch implements Serializable { private static final long serialVersionUID = -3500020131951579476L; /** * <pre> * 字段名:开户银行支行名称 * 变量名:bank_branch_name * 是否必填:是 * 类型:string[1, 128] * 描述: * 开户银行支行名称,用于开户银行为其他银行的情况下,在入驻、修改结算银行卡、企业付款等场景下填写结算银行卡信息。 * 示例值:中国工商银行上海市周浦支行 * </pre> */ @SerializedName("bank_branch_name") private String bankBranchName; /** * <pre> * 字段名:开户银行支行联行号 * 变量名:bank_branch_id * 是否必填:是 * 类型:string[1, 64] * 描述: * 开户银行支行的联行号,用于开户银行为其他银行的情况下,在入驻、修改结算银行卡、企业付款等场景下填写结算银行卡信息。 * 示例值:102290072311 * </pre> */ @SerializedName("bank_branch_id") private String bankBranchId; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/entwxpay/EntWxEmpPayRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/entwxpay/EntWxEmpPayRequest.java
package com.github.binarywang.wxpay.bean.entwxpay; import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest; import com.github.binarywang.wxpay.exception.WxPayException; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.*; import me.chanjar.weixin.common.annotation.Required; import java.util.Map; /** * Created on 2020/11/29. * 向员工付款请求对象 * @author 拎小壶冲 */ @Data @EqualsAndHashCode(callSuper = true) @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor @XStreamAlias("xml") public class EntWxEmpPayRequest extends BaseWxPayRequest { private static final long serialVersionUID = -3677217123742740648L; /** * <pre> * 字段名:商户订单号. * 变量名:partner_trade_no * 是否必填:是 * 示例值:10000098201411111234567890 * 类型:String * 描述:商户订单号 * </pre> */ @Required @XStreamAlias("partner_trade_no") private String partnerTradeNo; /** * <pre> * 字段名:需保持唯一性 用户openid. * 变量名:openid * 是否必填:是 * 示例值:oxTWIuGaIt6gTKsQRLau2M0yL16E * 类型:String * 描述:商户appid下,某用户的openid * </pre> */ @Required @XStreamAlias("openid") private String openid; /** * <pre> * 字段名:设备号. * 变量名:device_info * 是否必填:否 * 示例值:13467007045764 * 类型:String(32) * 描述:微信支付分配的终端设备号 * </pre> */ @XStreamAlias("device_info") private String deviceInfo; /** * <pre> * 字段名:校验用户姓名选项. * 变量名:check_name * 是否必填:是 * 示例值:OPTION_CHECK * 类型:String * 描述:NO_CHECK:不校验真实姓名  * FORCE_CHECK:强校验真实姓名(未实名认证的用户会校验失败,无法转账)  * OPTION_CHECK:针对已实名认证的用户才校验真实姓名(未实名认证用户不校验,可以转账成功) * </pre> */ @Required @XStreamAlias("check_name") private String checkName; /** * <pre> * 字段名:收款用户姓名. * 变量名:re_user_name * 是否必填:可选 * 示例值:马花花 * 类型:String * 描述:收款用户真实姓名。 * 如果check_name设置为FORCE_CHECK或OPTION_CHECK, 则必填用户真实姓名 * </pre> */ @XStreamAlias("re_user_name") private String reUserName; /** * <pre> * 字段名:金额. * 变量名:amount * 是否必填:是 * 示例值:10099 * 类型:int * 描述:企业付款金额, 单位为分 * </pre> */ @Required @XStreamAlias("amount") private Integer amount; /** * <pre> * 字段名:企业付款描述信息. * 变量名:desc * 是否必填:是 * 示例值:理赔 * 类型:String * 描述:企业付款操作说明信息。必填。 * </pre> */ @Required @XStreamAlias("desc") private String description; /** * <pre> * 字段名:Ip地址. * 变量名:spbill_create_ip * 是否必填:是 * 示例值:192.168.0.1 * 类型:String(32) * 描述:调用接口的机器Ip地址 * </pre> */ @Required @XStreamAlias("spbill_create_ip") private String spbillCreateIp; /** * <pre> * 字段名: 付款消息类型 * 变量名: ww_msg_type * 是否必填: 是 * 示例值:NORMAL_MSG * 描述:NORMAL_MSG:普通付款消息 APPROVAL _MSG:审批付款消息 * </pre> */ @Required @XStreamAlias("ww_msg_type") private String wwMsgType; /** * <pre> * 字段名: 审批单号 * 变量名: approval_number * 是否必填: 否 * 示例值: 201705160008 * 描述:ww_msg_type为APPROVAL _MSG时,需要填写approval_number * </pre> */ @XStreamAlias("approval_number") private String approvalNumber; /** * <pre> * 字段名: 审批类型 * 变量名: approval_type * 是否必填: 否 * 示例值: 1 * 描述:ww_msg_type为APPROVAL _MSG时,需要填写1 * </pre> */ @XStreamAlias("approval_type") private Integer approvalType; /** * <pre> * 字段名: 项目名称 * 变量名: act_name * 是否必填: 是 * 示例值: 产品部门报销 * 描述:项目名称,最长50个utf8字符 * </pre> */ @Required @XStreamAlias("act_name") private String actName; /** * <pre> * 字段名: 付款的应用id * 变量名: agentid * 是否必填: 否 * 示例值: 1 * 描述:以企业应用的名义付款,企业应用id,整型,可在企业微信管理端应用的设置页面查看。 * </pre> */ @XStreamAlias("agentid") private Integer agentId; @Override protected void checkConstraints() throws WxPayException { } @Override protected boolean isWxWorkSign() { return true; } @Override protected void storeMap(Map<String, String> map) { map.put("appid", appid); map.put("mch_id", mchId); map.put("device_info", deviceInfo); map.put("partner_trade_no", partnerTradeNo); map.put("openid", openid); map.put("check_name", checkName); map.put("re_user_name", reUserName); map.put("amount", amount.toString()); map.put("desc", description); map.put("spbill_create_ip", spbillCreateIp); map.put("act_name", actName); map.put("ww_msg_type", wwMsgType); map.put("approval_number", approvalNumber); map.put("approval_type", approvalType.toString()); map.put("agentid", agentId.toString()); } @Override protected String[] getIgnoredParamsForSign() { return new String[]{"sign_type"}; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/VerifyCertificateResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/VerifyCertificateResult.java
package com.github.binarywang.wxpay.bean.customs; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * @author xifengzhu */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class VerifyCertificateResult implements Serializable { private static final long serialVersionUID = -8578640869555299753L; /** * <pre> * 字段名:机构APPID * 变量名:appid * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "appid") private String appid; /** * <pre> * 字段名:商户号 * 变量名:mchid * 是否必填:是 * 类型:string(32) * 描述: * 微信支付分配的商户号 * 示例值:1230000109 * </pre> */ @SerializedName(value = "mchid") private String mchid; /** * <pre> * 字段名:商户订单号 * 变量名:out_trade_no * 是否必填:是 * 类型:string(32) * 描述: * 商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-&#124;*@ ,且在同一个商户号下唯一 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "out_trade_no") private String outTradeNo; /** * <pre> * 字段名:微信支付返回的订单号 * 变量名:transaction_id * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:1000320306201511078440737890 * </pre> */ @SerializedName(value = "transaction_id") private String transactionId; /** * <pre> * 字段名:身份核验结果 * 变量名:certificate_check_result * 是否必填:是 * 类型:string(32) * 描述: * 订购人和支付人身份信息校验结果 * SAME:身份信息校验匹配 * DIFFERENT:身份信息校验不匹配 * 示例值:SAME * </pre> */ @SerializedName(value = "certificate_check_result") private String certificateCheckResult; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/DeclarationRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/DeclarationRequest.java
package com.github.binarywang.wxpay.bean.customs; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * @author xifenzhu */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class DeclarationRequest implements Serializable { private static final long serialVersionUID = -170115210896346836L; /** * <pre> * 字段名:机构APPID * 变量名:appid * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "appid") private String appid; /** * <pre> * 字段名:商户号 * 变量名:mchid * 是否必填:是 * 类型:string(32) * 描述: * 微信支付分配的商户号 * 示例值:1230000109 * </pre> */ @SerializedName(value = "mchid") private String mchid; /** * <pre> * 字段名:商户订单号 * 变量名:out_trade_no * 是否必填:是 * 类型:string(32) * 描述: * 商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-&#124;*@ ,且在同一个商户号下唯一 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "out_trade_no") private String outTradeNo; /** * <pre> * 字段名:微信支付返回的订单号 * 变量名:transaction_id * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:1000320306201511078440737890 * </pre> */ @SerializedName(value = "transaction_id") private String transactionId; /** * <pre> * 字段名:海关 * 变量名:customs * 是否必填:是 * 类型:string(32) * 描述: * 海关代码, 枚举值参见参数规定-海关列表(https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/declarecustom_ch/chapter2_3.shtml#menu11) * 示例值:SHANGHAI_ZS * </pre> */ @SerializedName(value = "customs") private String customs; /** * <pre> * 字段名:商户海关备案号 * 变量名:merchant_customs_no * 是否必填:是 * 类型:string(32) * 描述: * 商户在海关登记的备案号 * 示例值:123456 * </pre> */ @SerializedName(value = "merchant_customs_no") private String merchantCustomsNo; /** * <pre> * 字段名:关税 * 变量名:duty * 是否必填:否 * 类型:int * 描述: * 关税,以分为单位,非必填项,不会提交给海关 * 示例值:888 * </pre> */ @SerializedName(value = "duty") private Integer duty; /** * <pre> * 字段名:商户子订单号 * 变量名:sub_order_no * 是否必填:是 * 类型:string(32) * 描述: * 商户子订单号,如有拆单则必传 * 注意:仅适用于机构模式 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "sub_order_no") private String subOrderNo; /** * <pre> * 字段名:货币类型 * 变量名:fee_type * 是否必填:否 * 类型:string(32) * 描述: * 微信支付订单支付时使用的币种,暂只支持人民币CNY,如有拆单则必传 * 示例值:CNY * </pre> */ @SerializedName(value = "fee_type") private String feeType; /** * <pre> * 字段名:子订单金额 * 变量名:order_fee * 是否必填:否 * 类型:int * 描述: * 子订单金额,以分为单位,不能超过原订单金额,order_fee=transport_fee+product_fee(应付金额=物流费+商品价格),如有拆单则必传 * 示例值:888 * </pre> */ @SerializedName(value = "order_fee") private Integer orderFee; /** * <pre> * 字段名:物流费用 * 变量名:transport_fee * 是否必填:否 * 类型:int * 描述: * 物流费用,以分为单位,如有拆单则必传 * 示例值:888 * </pre> */ @SerializedName(value = "transport_fee") private Integer transportFee; /** * <pre> * 字段名:商品费用 * 变量名:product_fee * 是否必填:否 * 类型:int * 描述: * 商品费用,以分为单位,如有拆单则必传 * 示例值:888 * </pre> */ @SerializedName(value = "product_fee") private Integer productFee; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/DeclarationQueryResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/DeclarationQueryResult.java
package com.github.binarywang.wxpay.bean.customs; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; import java.util.List; /** * @author xifenzhu */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class DeclarationQueryResult implements Serializable { private static final long serialVersionUID = 7776809282150143165L; /** * <pre> * 字段名:机构APPID * 变量名:appid * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "appid") private String appid; /** * <pre> * 字段名:商户号 * 变量名:mchid * 是否必填:是 * 类型:string(32) * 描述: * 微信支付分配的商户号 * 示例值:1230000109 * </pre> */ @SerializedName(value = "mchid") private String mchid; /** * <pre> * 字段名:微信支付返回的订单号 * 变量名:transaction_id * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:1000320306201511078440737890 * </pre> */ @SerializedName(value = "transaction_id") private String transactionId; /** * <pre> * 字段名:核验机构 * 变量名:verify_department * 是否必填:是 * 类型:string(16) * 描述: * 核验机构代码 * UNIONPAY:银联 * NETSUNION:网联 * OTHERS:其他 * 示例值:UNIONPAY * </pre> */ @SerializedName(value = "verify_department") private String verifyDepartment; /** * <pre> * 字段名:核验机构交易流水号 * 变量名:Verify_department_trade_id * 是否必填:是 * 类型:string(64) * 描述: * 交易流水号,来自验核机构,如银联记录的交易流水号,供商户报备海关 * 示例值:2018112288340107038204310100000 * </pre> */ @SerializedName(value = "verify_department_trade_id") private String verifyDepartmentTradeId; /** * <pre> * 字段名:偏移量 * 变量名:offset * 是否必填:是 * 类型:int * 描述: * 非0整数,该次请求资源的起始位置,从0开始计数。调用方选填,默认为0 * 示例值:0 * </pre> */ @SerializedName(value = "offset") private Integer offset; /** * <pre> * 字段名:请求最大记录条数 * 变量名:limit * 是否必填:是 * 类型:int * 描述: * 非0非负的整数,该次请求可返回的最大资源条数。调用方选填,默认值建议为20 * 示例值:20 * </pre> */ @SerializedName(value = "limit") private Integer limit; /** * <pre> * 字段名:查询结果总条数 * 变量名:total_count * 是否必填:是 * 类型:int * 描述: * 查询结果总条数 * 示例值:1 * </pre> */ @SerializedName(value = "total_count") private Integer totalCount; /** * <pre> * 字段名:报关数据包 * 变量名:data * 是否必填:是 * 类型:array * 描述: * 报关单结果数组,具体内容参见下方描述 * 示例值: * </pre> */ @SerializedName(value = "data") private List<DeclarationData> data; /** * 驳回原因详情 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public static class DeclarationData { /** * <pre> * 字段名:商户子订单号 * 变量名:sub_order_no * 是否必填:否 * 类型:string(32) * 描述: * 微信子订单号,如有拆单则返回 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "sub_order_no") private String subOrderNo; /** * <pre> * 字段名:微信子订单号 * 变量名:sub_order_id * 是否必填:否 * 类型:string(32) * 描述: * 商户子订单号,如有拆单则必传 * 注意:仅适用于机构模式 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "sub_order_id") private String subOrderId; /** * <pre> * 字段名:商户海关备案号 * 变量名:merchant_customs_no * 是否必填:是 * 类型:string(32) * 描述: * 商户在海关登记的备案号 * 示例值:123456 * </pre> */ @SerializedName(value = "mch_customs_no") private String merchantCustomsNo; /** * <pre> * 字段名:海关 * 变量名:customs * 是否必填:是 * 类型:string(32) * 描述: * 海关代码, 枚举值参见参数规定-海关列表(https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/declarecustom_ch/chapter2_3.shtml#menu11) * 示例值:SHANGHAI_ZS * </pre> */ @SerializedName(value = "customs") private String customs; /** * <pre> * 字段名:关税 * 变量名:duty * 是否必填:否 * 类型:int * 描述: * 关税,以分为单位,非必填项,不会提交给海关 * 示例值:888 * </pre> */ @SerializedName(value = "duty") private Integer duty; /** * <pre> * 字段名:货币类型 * 变量名:fee_type * 是否必填:否 * 类型:string(32) * 描述: * 微信支付订单支付时使用的币种,暂只支持人民币CNY,如有拆单则必传 * 示例值:CNY * </pre> */ @SerializedName(value = "fee_type") private String feeType; /** * <pre> * 字段名:子订单金额 * 变量名:order_fee * 是否必填:否 * 类型:int * 描述: * 子订单金额,以分为单位,不能超过原订单金额,order_fee=transport_fee+product_fee(应付金额=物流费+商品价格),如有拆单则必传 * 示例值:888 * </pre> */ @SerializedName(value = "order_fee") private Integer orderFee; /** * <pre> * 字段名:物流费用 * 变量名:transport_fee * 是否必填:否 * 类型:int * 描述: * 物流费用,以分为单位,如有拆单则必传 * 示例值:888 * </pre> */ @SerializedName(value = "transport_fee") private Integer transportFee; /** * <pre> * 字段名:商品费用 * 变量名:product_fee * 是否必填:否 * 类型:int * 描述: * 商品费用,以分为单位,如有拆单则必传 * 示例值:888 * </pre> */ @SerializedName(value = "product_fee") private Integer productFee; /** * <pre> * 字段名:报关状态 * 变量名:state * 是否必填:是 * 类型:string(32) * 描述: * 申报结果状态码 * PROCESSING:申报中 * UNDECLARED:未申报 * SUBMITTED:已修改未申报 * SUCCESS:申报成功 * FAIL:申报失败 * EXCEPT:海关接口异常 * 示例值:PROCESSING * </pre> */ @SerializedName(value = "state") private String state; /** * <pre> * 字段名:报关结果说明 * 变量名:explanation * 是否必填:是 * 类型:string(128) * 描述: * 申报结果说明,如果状态是失败或异常,显示失败原因 * 示例值:支付单已存在并且为非退单状态 * </pre> */ @SerializedName(value = "explanation") private String explanation; /** * <pre> * 字段名:最后更新时间 * 变量名:modify_time * 是否必填:是 * 类型:string(32) * 描述: * 最后更新时间,该时间取自微信服务器 * 示例值:2015-09-01T10:00:00+08:00 * </pre> */ @SerializedName(value = "modify_time") private String modifyTime; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/DeclarationResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/DeclarationResult.java
package com.github.binarywang.wxpay.bean.customs; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * @author xifengzhu */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class DeclarationResult implements Serializable { private static final long serialVersionUID = -5895139329545995308L; /** * <pre> * 字段名:机构APPID * 变量名:appid * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "appid") private String appid; /** * <pre> * 字段名:商户号 * 变量名:mchid * 是否必填:是 * 类型:string(32) * 描述: * 微信支付分配的商户号 * 示例值:1230000109 * </pre> */ @SerializedName(value = "mchid") private String mchid; /** * <pre> * 字段名:商户订单号 * 变量名:out_trade_no * 是否必填:是 * 类型:string(32) * 描述: * 商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-&#124;*@ ,且在同一个商户号下唯一 * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "20150806125346") private String outTradeNo; /** * <pre> * 字段名:微信支付返回的订单号 * 变量名:transaction_id * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:1000320306201511078440737890 * </pre> */ @SerializedName(value = "transaction_id") private String transactionId; /** * <pre> * 字段名:报关状态 * 变量名:state * 是否必填:是 * 类型:string(32) * 描述: * 申报结果状态码 * PROCESSING:申报中 * UNDECLARED:未申报 * SUBMITTED:已修改未申报 * SUCCESS:申报成功 * FAIL:申报失败 * EXCEPT:海关接口异常 * 示例值:PROCESSING * </pre> */ @SerializedName(value = "state") private String state; /** * <pre> * 字段名:商户子订单号 * 变量名:sub_order_no * 是否必填:否 * 类型:string(32) * 描述: * 微信子订单号,如有拆单则返回 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "sub_order_no") private String subOrderNo; /** * <pre> * 字段名:微信子订单号 * 变量名:sub_order_id * 是否必填:否 * 类型:string(32) * 描述: * 商户子订单号,如有拆单则必传 * 注意:仅适用于机构模式 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "sub_order_id") private String subOrderId; /** * <pre> * 字段名:核验机构 * 变量名:verify_department * 是否必填:是 * 类型:string(16) * 描述: * 核验机构代码 * UNIONPAY:银联 * NETSUNION:网联 * OTHERS:其他 * 示例值:UNIONPAY * </pre> */ @SerializedName(value = "verify_department") private String verifyDepartment; /** * <pre> * 字段名:核验机构交易流水号 * 变量名:Verify_department_trade_id * 是否必填:是 * 类型:string(64) * 描述: * 交易流水号,来自验核机构,如银联记录的交易流水号,供商户报备海关 * 示例值:2018112288340107038204310100000 * </pre> */ @SerializedName(value = "verify_department_trade_id") private String verifyDepartmentTradeId; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/RedeclareResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/RedeclareResult.java
package com.github.binarywang.wxpay.bean.customs; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * @author xifengzhu */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class RedeclareResult implements Serializable { private static final long serialVersionUID = 8863516626598050095L; /** * <pre> * 字段名:机构APPID * 变量名:appid * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "appid") private String appid; /** * <pre> * 字段名:商户号 * 变量名:mchid * 是否必填:是 * 类型:string(32) * 描述: * 微信支付分配的商户号 * 示例值:1230000109 * </pre> */ @SerializedName(value = "mchid") private String mchid; /** * <pre> * 字段名:微信订单号 * 变量名:transaction_id * 是否必填:是 * 类型:string(32) * 描述: * 微信支付返回的订单号 * 示例值:1000320306201511078440737890 * </pre> */ @SerializedName(value = "transaction_id") private String transactionId; /** * <pre> * 字段名:商户订单号 * 变量名:out_trade_no * 是否必填:是 * 类型:string(32) * 描述: * 商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "out_trade_no") private String outTradeNo; /** * <pre> * 字段名:商户子订单号 * 变量名:sub_order_no * 是否必填:是 * 类型:string(32) * 描述: * 商户子订单号,如有拆单则必传 * 注意:仅适用于机构模式 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "sub_order_no") private String subOrderNo; /** * <pre> * 字段名:微信子订单号 * 变量名:sub_order_id * 是否必填:否 * 类型:string(32) * 描述: * 商户子订单号,如有拆单则必传 * 注意:仅适用于机构模式 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "sub_order_id") private String subOrderId; /** * <pre> * 字段名:报关状态 * 变量名:state * 是否必填:是 * 类型:string(32) * 描述: * 申报结果状态码 * PROCESSING:申报中 * UNDECLARED:未申报 * SUBMITTED:已修改未申报 * SUCCESS:申报成功 * FAIL:申报失败 * EXCEPT:海关接口异常 * 示例值:PROCESSING * </pre> */ @SerializedName(value = "state") private String state; /** * <pre> * 字段名:报关结果说明 * 变量名:explanation * 是否必填:是 * 类型:string(128) * 描述: * 申报结果说明,如果状态是失败或异常,显示失败原因 * 示例值:支付单已存在并且为非退单状态 * </pre> */ @SerializedName(value = "explanation") private String explanation; /** * <pre> * 字段名:最后更新时间 * 变量名:modify_time * 是否必填:是 * 类型:string(32) * 描述: * 最后更新时间,该时间取自微信服务器 * 示例值:2015-09-01T10:00:00+08:00 * </pre> */ @SerializedName(value = "modify_time") private String modifyTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/VerifyCertificateRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/VerifyCertificateRequest.java
package com.github.binarywang.wxpay.bean.customs; import com.google.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; /** * @author xifengzhu */ @Data public class VerifyCertificateRequest implements Serializable { private static final long serialVersionUID = 721089103541592315L; /** * <pre> * 字段名:机构APPID * 变量名:appid * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "appid") private String appid; /** * <pre> * 字段名:商户号 * 变量名:mchid * 是否必填:是 * 类型:string(32) * 描述: * 微信支付分配的商户号 * 示例值:1230000109 * </pre> */ @SerializedName(value = "mchid") private String mchid; /** * <pre> * 字段名:商户订单号 * 变量名:out_trade_no * 是否必填:是 * 类型:string(32) * 描述: * 商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-&#124;*@ ,且在同一个商户号下唯一 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "out_trade_no") private String outTradeNo; /** * <pre> * 字段名:微信支付返回的订单号 * 变量名:transaction_id * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:1000320306201511078440737890 * </pre> */ @SerializedName(value = "transaction_id") private String transactionId; /** * <pre> * 字段名:海关 * 变量名:customs * 是否必填:是 * 类型:string(32) * 描述: * 海关代码, 枚举值参见参数规定-海关列表(https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/declarecustom_ch/chapter2_3.shtml#menu11) * 示例值:SHANGHAI_ZS * </pre> */ @SerializedName(value = "customs") private String customs; /** * <pre> * 字段名:商户海关备案号 * 变量名:merchant_customs_no * 是否必填:是 * 类型:string(32) * 描述: * 商户在海关登记的备案号 * 示例值:123456 * </pre> */ @SerializedName(value = "merchant_customs_no") private String merchantCustomsNo; /** * <pre> * 字段名:商户子订单号 * 变量名:sub_order_no * 是否必填:是 * 类型:string(32) * 描述: * 商户子订单号,如有拆单则必传 * 注意:仅适用于机构模式 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "sub_order_no") private String subOrderNo; /** * <pre> * 字段名:证件类型 * 变量名:certificate_type * 是否必填:是 * 类型:string(16) * 描述: * 请传固定值IDCARD,暂只支持大陆身份证 * 示例值:IDCARD * </pre> */ @SerializedName(value = "certificate_type") private String certificateType; /** * <pre> * 字段名:证件号 * 变量名:certificate_id * 是否必填:是 * 类型:string * 描述: * 用户大陆身份证号,尾号为字母X的身份证号,请大写字母X。该字段需要进行加密 * 示例值:330821198809085211 * </pre> */ @SerializedName(value = "certificate_id") private String certificateId; /** * <pre> * 字段名:证件姓名 * 变量名:certificate_name * 是否必填:是 * 类型:string * 描述: * 证件姓名,字段值需要进行加密 * 示例值:330821198809085211 * </pre> */ @SerializedName(value = "certificate_name") private String certificateName; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/DeclarationQueryRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/DeclarationQueryRequest.java
package com.github.binarywang.wxpay.bean.customs; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * @author xifenzhu */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class DeclarationQueryRequest implements Serializable { private static final long serialVersionUID = -251403491989628142L; /** * <pre> * 字段名:机构APPID * 变量名:appid * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "appid") private String appid; /** * <pre> * 字段名:商户号 * 变量名:mchid * 是否必填:是 * 类型:string(32) * 描述: * 微信支付分配的商户号 * 示例值:1230000109 * </pre> */ @SerializedName(value = "mchid") private String mchid; /** * <pre> * 字段名:订单类型 * 变量名:order_type * 是否必填:是 * 类型:string(16) * 描述: * 4种订单号类型,选择一种 * out_trade_no 商户订单号 * transaction_id 微信支付订单号 * sub_order_no 商户子订单号 * sub_order_id 微信子订单号 * 示例值:out_trade_no * </pre> */ @SerializedName(value = "order_type") private String orderType; /** * <pre> * 字段名:订单号 * 变量名:order_no * 是否必填:是 * 类型:string(32) * 描述: * 根据订单号类型,传入不同的订单号码 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "order_no") private String orderNo; /** * <pre> * 字段名:海关 * 变量名:customs * 是否必填:是 * 类型:string(32) * 描述: * 海关代码, 枚举值参见参数规定-海关列表(https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/declarecustom_ch/chapter2_3.shtml#menu11) * 示例值:SHANGHAI_ZS * </pre> */ @SerializedName(value = "customs") private String customs; /** * <pre> * 字段名:偏移量 * 变量名:offset * 是否必填:是 * 类型:int * 描述: * 非0整数,该次请求资源的起始位置,从0开始计数。调用方选填,默认为0 * 示例值:0 * </pre> */ @SerializedName(value = "offset") private String offset; /** * <pre> * 字段名:请求最大记录条数 * 变量名:limit * 是否必填:是 * 类型:int * 描述: * 非0非负的整数,该次请求可返回的最大资源条数。调用方选填,默认值建议为20 * 示例值:20 * </pre> */ @SerializedName(value = "limit") private String limit; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/RedeclareRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/customs/RedeclareRequest.java
package com.github.binarywang.wxpay.bean.customs; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * @author xifengzhu */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class RedeclareRequest implements Serializable { private static final long serialVersionUID = -5092107027805161479L; /** * <pre> * 字段名:机构APPID * 变量名:appid * 是否必填:是 * 类型:string(32) * 描述: * 微信分配的公众账号ID * 示例值:wxd678efh567hg6787 * </pre> */ @SerializedName(value = "appid") private String appid; /** * <pre> * 字段名:商户号 * 变量名:mchid * 是否必填:是 * 类型:string(32) * 描述: * 微信支付分配的商户号 * 示例值:1230000109 * </pre> */ @SerializedName(value = "mchid") private String mchid; /** * <pre> * 字段名:微信订单号 * 变量名:transaction_id * 是否必填:是 * 类型:string(32) * 描述: * out_trade_no, transaction_id二选一传入 * 示例值:1000320306201511078440737890 * </pre> */ @SerializedName(value = "transaction_id") private String transactionId; /** * <pre> * 字段名:商户订单号 * 变量名:out_trade_no * 是否必填:是 * 类型:string(32) * 描述: * out_trade_no, transaction_id二选一传入 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "out_trade_no") private String outTradeNo; /** * <pre> * 字段名:商户子订单号 * 变量名:sub_order_no * 是否必填:是 * 类型:string(32) * 描述: * 商户子订单号,如有拆单则必传 * 注意:仅适用于机构模式 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "sub_order_no") private String subOrderNo; /** * <pre> * 字段名:微信子订单号 * 变量名:sub_order_id * 是否必填:否 * 类型:string(32) * 描述: * 商户子订单号,如有拆单则必传 * 注意:仅适用于机构模式 * 示例值:20150806125346 * </pre> */ @SerializedName(value = "sub_order_id") private String subOrderId; /** * <pre> * 字段名:海关 * 变量名:customs * 是否必填:是 * 类型:string(32) * 描述: * 海关代码, 枚举值参见参数规定-海关列表(https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/declarecustom_ch/chapter2_3.shtml#menu11) * 示例值:SHANGHAI_ZS * </pre> */ @SerializedName(value = "customs") private String customs; /** * <pre> * 字段名:商户海关备案号 * 变量名:merchant_customs_no * 是否必填:是 * 类型:string(32) * 描述: * 商户在海关登记的备案号 * 示例值:123456 * </pre> */ @SerializedName(value = "merchant_customs_no") private String merchantCustomsNo; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponStockQueryResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponStockQueryResult.java
package com.github.binarywang.wxpay.bean.coupon; import com.github.binarywang.wxpay.bean.result.BaseWxPayResult; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.w3c.dom.Document; import java.io.Serializable; /** * <pre> * 查询代金券批次响应结果类. * Created by Binary Wang on 2017-7-15. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @AllArgsConstructor @XStreamAlias("xml") public class WxPayCouponStockQueryResult extends BaseWxPayResult implements Serializable { private static final long serialVersionUID = 4644274730788451926L; /** * <pre> * 字段名:设备号. * 变量名:device_info * 是否必填:否 * 示例值:123456sb * 类型:String(32) * 说明:微信支付分配的终端设备号 * </pre> */ @XStreamAlias("device_info") private String deviceInfo; /** * <pre> * 字段名:代金券批次ID. * 变量名:coupon_stock_id * 是否必填:是 * 示例值:1757 * 类型:String * 说明:代金券批次Id * </pre> */ @XStreamAlias("coupon_stock_id") private String couponStockId; /** * <pre> * 字段名:代金券名称. * 变量名:coupon_name * 是否必填:否 * 示例值:测试代金券 * 类型:String * 说明:代金券名称 * </pre> */ @XStreamAlias("coupon_name") private String couponName; /** * <pre> * 字段名:代金券面额. * 变量名:coupon_value * 是否必填:是 * 示例值:5 * 类型:Unsinged int * 说明:代金券面值,单位是分 * </pre> */ @XStreamAlias("coupon_value") private Integer couponValue; /** * <pre> * 字段名:代金券使用最低限额. * 变量名:coupon_mininumn * 是否必填:否 * 示例值:10 * 类型:Unsinged int * 说明:代金券使用最低限额,单位是分 * </pre> */ @XStreamAlias("coupon_mininumn") private Integer couponMinimum; /** * <pre> * 字段名:代金券批次状态. * 变量名:coupon_stock_status * 是否必填:是 * 示例值:4 * 类型:int * 说明:批次状态: 1-未激活;2-审批中;4-已激活;8-已作废;16-中止发放; * </pre> */ @XStreamAlias("coupon_stock_status") private Integer couponStockStatus; /** * <pre> * 字段名:代金券数量. * 变量名:coupon_total * 是否必填:是 * 示例值:100 * 类型:Unsigned int * 说明:代金券数量 * </pre> */ @XStreamAlias("coupon_total") private Integer couponTotal; /** * <pre> * 字段名:代金券最大领取数量. * 变量名:max_quota * 是否必填:否 * 示例值:1 * 类型:Unsigned int * 说明:代金券每个人最多能领取的数量, 如果为0,则表示没有限制 * </pre> */ @XStreamAlias("max_quota") private Integer maxQuota; /** * <pre> * 字段名:代金券已经发送的数量. * 变量名:is_send_num * 是否必填:否 * 示例值:0 * 类型:Unsigned int * 说明:代金券已经发送的数量 * </pre> */ @XStreamAlias("is_send_num") private Integer isSendNum; /** * <pre> * 字段名:生效开始时间. * 变量名:begin_time * 是否必填:是 * 示例值:1943787483 * 类型:String * 说明:格式为时间戳 * </pre> */ @XStreamAlias("begin_time") private String beginTime; /** * <pre> * 字段名:生效结束时间. * 变量名:end_time * 是否必填:是 * 示例值:1943787490 * 类型:String * 说明:格式为时间戳 * </pre> */ @XStreamAlias("end_time") private String endTime; /** * <pre> * 字段名:创建时间. * 变量名:create_time * 是否必填:是 * 示例值:1943787420 * 类型:String * 说明:格式为时间戳 * </pre> */ @XStreamAlias("create_time") private String createTime; /** * <pre> * 字段名:代金券预算额度. * 变量名:coupon_budget * 是否必填:否 * 示例值:500 * 类型:Unsigned int * 说明:代金券预算额度 * </pre> */ @XStreamAlias("coupon_budget") private Integer couponBudget; @Override protected void loadXml(Document d) { deviceInfo = readXmlString(d, "device_info"); couponStockId = readXmlString(d, "coupon_stock_id"); couponName = readXmlString(d, "coupon_name"); couponValue = readXmlInteger(d, "coupon_value"); couponMinimum = readXmlInteger(d, "coupon_mininumn"); couponStockStatus = readXmlInteger(d, "coupon_stock_status"); couponTotal = readXmlInteger(d, "coupon_total"); maxQuota = readXmlInteger(d, "max_quota"); isSendNum = readXmlInteger(d, "is_send_num"); beginTime = readXmlString(d, "begin_time"); endTime = readXmlString(d, "end_time"); createTime = readXmlString(d, "create_time"); couponBudget = readXmlInteger(d, "coupon_budget"); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponSendResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponSendResult.java
package com.github.binarywang.wxpay.bean.coupon; import com.github.binarywang.wxpay.bean.result.BaseWxPayResult; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.w3c.dom.Document; import java.io.Serializable; /** * <pre> * 发送代金券响应结果类 * Created by Binary Wang on 2017-7-15. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @XStreamAlias("xml") public class WxPayCouponSendResult extends BaseWxPayResult implements Serializable { private static final long serialVersionUID = -3596288305333090962L; /** * <pre> * 字段名:设备号 * 变量名:device_info * 是否必填:否 * 示例值:123456sb * 类型:String(32) * 描述:微信支付分配的终端设备号, * </pre> */ @XStreamAlias("device_info") private String deviceInfo; /** * <pre> * 字段名:代金券批次id * 变量名:coupon_stock_id * 是否必填:是 * 示例值:1757 * 类型:String * 描述:用户在商户appid下的唯一标识 * </pre> */ @XStreamAlias("coupon_stock_id") private String couponStockId; /** * <pre> * 字段名:返回记录数 * 变量名:resp_count * 是否必填:是 * 示例值:1 * 类型:Int * 描述:返回记录数 * </pre> */ @XStreamAlias("resp_count") private Integer respCount; /** * <pre> * 字段名:成功记录数 * 变量名:success_count * 是否必填:是 * 示例值:1或者0 * 类型:Int * 描述:成功记录数 * </pre> */ @XStreamAlias("success_count") private Integer successCount; /** * <pre> * 字段名:失败记录数 * 变量名:failed_count * 是否必填:是 * 示例值:1或者0 * 类型:Int * 描述:失败记录数 * </pre> */ @XStreamAlias("failed_count") private Integer failedCount; /** * <pre> * 字段名:用户标识 * 变量名:openid * 是否必填:是 * 示例值:onqOjjrXT-776SpHnfexGm1_P7iE * 类型:String * 描述:用户在商户appid下的唯一标识 * </pre> */ @XStreamAlias("openid") private String openid; /** * <pre> * 字段名:返回码 * 变量名:ret_code * 是否必填:是 * 示例值:SUCCESS或者FAILED * 类型:String * 描述:返回码,SUCCESS/FAILED * </pre> */ @XStreamAlias("ret_code") private String retCode; /** * <pre> * 字段名:代金券id * 变量名:coupon_id * 是否必填:是 * 示例值:1870 * 类型:String * 描述:对一个用户成功发放代金券则返回代金券id,即ret_code为SUCCESS的时候;如果ret_code为FAILED则填写空串"" * </pre> */ @XStreamAlias("coupon_id") private String couponId; /** * <pre> * 字段名:返回信息 * 变量名:ret_msg * 是否必填:是 * 示例值:失败描述信息,例如:“用户已达领用上限” * 类型:String * 描述:返回信息,当返回码是FAILED的时候填写,否则填空串“” * </pre> */ @XStreamAlias("ret_msg") private String retMsg; @Override protected void loadXml(Document d) { deviceInfo = readXmlString(d, "device_info"); couponStockId = readXmlString(d, "coupon_stock_id"); respCount = readXmlInteger(d, "resp_count"); successCount = readXmlInteger(d, "success_count"); failedCount = readXmlInteger(d, "failed_count"); openid = readXmlString(d, "openid"); retCode = readXmlString(d, "ret_code"); couponId = readXmlString(d, "coupon_id"); retMsg = readXmlString(d, "ret_msg"); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponSendRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponSendRequest.java
package com.github.binarywang.wxpay.bean.coupon; import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.*; import me.chanjar.weixin.common.annotation.Required; import java.util.Map; /** * <pre> * 发送代金券请求对象类 * Created by Binary Wang on 2017-7-15. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data @EqualsAndHashCode(callSuper = true) @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor @XStreamAlias("xml") public class WxPayCouponSendRequest extends BaseWxPayRequest { /** * <pre> * 字段名:代金券批次id * 变量名:coupon_stock_id * 是否必填:是 * 示例值:1757 * 类型:String * 说明:代金券批次id * </pre> */ @Required @XStreamAlias("coupon_stock_id") private String couponStockId; /** * <pre> * 字段名:openid记录数 * 变量名:openid_count * 是否必填:是 * 示例值:1 * 类型:int * 说明:openid记录数(目前支持num=1) * </pre> */ @Required @XStreamAlias("openid_count") private Integer openidCount; /** * <pre> * 字段名:商户单据号 * 变量名:partner_trade_no * 是否必填:是 * 示例值:1000009820141203515766 * 类型:String * 说明:商户此次发放凭据号(格式:商户id+日期+流水号),商户侧需保持唯一性 * </pre> */ @Required @XStreamAlias("partner_trade_no") private String partnerTradeNo; /** * <pre> * 字段名:用户openid * 变量名:openid * 是否必填:是 * 示例值:onqOjjrXT-776SpHnfexGm1_P7iE * 类型:String * 说明:Openid信息,用户在appid下的openid。 * </pre> */ @Required @XStreamAlias("openid") private String openid; /** * <pre> * 字段名:操作员 * 变量名:op_user_id * 是否必填:否 * 示例值:10000098 * 类型:String(32) * 说明:操作员帐号, 默认为商户号,可在商户平台配置操作员对应的api权限 * </pre> */ @XStreamAlias("op_user_id") private String opUserId; /** * <pre> * 字段名:设备号 * 变量名:device_info * 是否必填:否 * 示例值: * 类型:String(32) * 说明:微信支付分配的终端设备号 * </pre> */ @XStreamAlias("device_info") private String deviceInfo; /** * <pre> * 字段名:协议版本 * 变量名:version * 是否必填:否 * 示例值:1.0 * 类型:String(32) * 说明:默认1.0 * </pre> */ @XStreamAlias("version") private String version; /** * <pre> * 字段名:协议类型 * 变量名:type * 是否必填:否 * 示例值:XML * 类型:String(32) * 说明:XML【目前仅支持默认XML】 * </pre> */ @XStreamAlias("type") private String type; @Override protected void checkConstraints() { //do nothing } @Override protected void storeMap(Map<String, String> map) { map.put("coupon_stock_id", couponStockId); map.put("openid_count", openidCount.toString()); map.put("partner_trade_no", partnerTradeNo); map.put("openid", openid); map.put("op_user_id", opUserId); map.put("device_info", deviceInfo); map.put("version", version); map.put("type", type); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponStockQueryRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponStockQueryRequest.java
package com.github.binarywang.wxpay.bean.coupon; import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.*; import me.chanjar.weixin.common.annotation.Required; import java.util.Map; /** * <pre> * 查询代金券批次请求对象类 * Created by Binary Wang on 2017-7-15. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data @EqualsAndHashCode(callSuper = true) @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor @XStreamAlias("xml") public class WxPayCouponStockQueryRequest extends BaseWxPayRequest { /** * <pre> * 字段名:代金券批次id * 变量名:coupon_stock_id * 是否必填:是 * 示例值:1757 * 类型:String * 说明:代金券批次id * </pre> */ @Required @XStreamAlias("coupon_stock_id") private String couponStockId; /** * <pre> * 字段名:操作员 * 变量名:op_user_id * 是否必填:否 * 示例值:10000098 * 类型:String(32) * 说明:操作员帐号, 默认为商户号,可在商户平台配置操作员对应的api权限 * </pre> */ @XStreamAlias("op_user_id") private String opUserId; /** * <pre> * 字段名:设备号 * 变量名:device_info * 是否必填:否 * 示例值: * 类型:String(32) * 说明:微信支付分配的终端设备号 * </pre> */ @XStreamAlias("device_info") private String deviceInfo; /** * <pre> * 字段名:协议版本 * 变量名:version * 是否必填:否 * 示例值:1.0 * 类型:String(32) * 说明:默认1.0 * </pre> */ @XStreamAlias("version") private String version; /** * <pre> * 字段名:协议类型 * 变量名:type * 是否必填:否 * 示例值:XML * 类型:String(32) * 说明:XML【目前仅支持默认XML】 * </pre> */ @XStreamAlias("type") private String type; @Override protected void checkConstraints() { //do nothing } @Override protected void storeMap(Map<String, String> map) { map.put("coupon_stock_id", couponStockId); map.put("op_user_id", opUserId); map.put("device_info", deviceInfo); map.put("version", version); map.put("type", type); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponInfoQueryRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponInfoQueryRequest.java
package com.github.binarywang.wxpay.bean.coupon; import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.*; import me.chanjar.weixin.common.annotation.Required; import java.util.Map; /** * <pre> * 查询代金券信息请求对象类 * Created by Binary Wang on 2017-7-15. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data @EqualsAndHashCode(callSuper = true) @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor @XStreamAlias("xml") public class WxPayCouponInfoQueryRequest extends BaseWxPayRequest { /** * <pre> * 字段名:代金券id * 变量名:coupon_id * 是否必填:是 * 示例值:1757 * 类型:String * 说明:代金券id * </pre> */ @Required @XStreamAlias("coupon_id") private String couponId; /** * <pre> * 字段名:代金券批次号 * 变量名:stock_id * 是否必填:是 * 示例值:58818 * 类型:String * 说明:代金劵对应的批次号 * </pre> */ @Required @XStreamAlias("stock_id") private String stockId; /** * <pre> * 字段名:用户openid * 变量名:openid * 是否必填:是 * 示例值:onqOjjrXT-776SpHnfexGm1_P7iE * 类型:String * 说明:Openid信息,用户在appid下的openid。 * </pre> */ @Required @XStreamAlias("openid") private String openid; /** * <pre> * 字段名:操作员 * 变量名:op_user_id * 是否必填:否 * 示例值:10000098 * 类型:String(32) * 说明:操作员帐号, 默认为商户号,可在商户平台配置操作员对应的api权限 * </pre> */ @XStreamAlias("op_user_id") private String opUserId; /** * <pre> * 字段名:设备号 * 变量名:device_info * 是否必填:否 * 示例值: * 类型:String(32) * 说明:微信支付分配的终端设备号 * </pre> */ @XStreamAlias("device_info") private String deviceInfo; /** * <pre> * 字段名:协议版本 * 变量名:version * 是否必填:否 * 示例值:1.0 * 类型:String(32) * 说明:默认1.0 * </pre> */ @XStreamAlias("version") private String version; /** * <pre> * 字段名:协议类型 * 变量名:type * 是否必填:否 * 示例值:XML * 类型:String(32) * 说明:XML【目前仅支持默认XML】 * </pre> */ @XStreamAlias("type") private String type; @Override protected void checkConstraints() { //do nothing } @Override protected void storeMap(Map<String, String> map) { map.put("coupon_id", couponId); map.put("stock_id", stockId); map.put("openid", openid); map.put("op_user_id", opUserId); map.put("device_info", deviceInfo); map.put("version", version); map.put("type", type); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponInfoQueryResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/coupon/WxPayCouponInfoQueryResult.java
package com.github.binarywang.wxpay.bean.coupon; import com.github.binarywang.wxpay.bean.result.BaseWxPayResult; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.w3c.dom.Document; import java.io.Serializable; /** * <pre> * 查询代金券信息响应结果类 * Created by Binary Wang on 2017-7-15. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @XStreamAlias("xml") public class WxPayCouponInfoQueryResult extends BaseWxPayResult implements Serializable { private static final long serialVersionUID = -8328629147291321829L; /** * <pre> * 字段名:设备号. * 变量名:device_info * 是否必填:否 * 示例值:123456sb * 类型:String(32) * 说明:微信支付分配的终端设备号, * </pre> */ @XStreamAlias("device_info") private String deviceInfo; /** * <pre> * 字段名:批次ID. * 变量名:coupon_stock_id * 是否必填:是 * 示例值:1567 * 类型:String * 说明:代金券批次Id * </pre> */ @XStreamAlias("coupon_stock_id") private String couponStockId; /** * <pre> * 字段名:代金券id. * 变量名:coupon_id * 是否必填:是 * 示例值:4242 * 类型:String * 说明:代金券id * </pre> */ @XStreamAlias("coupon_id") private String couponId; /** * <pre> * 字段名:代金券面额. * 变量名:coupon_value * 是否必填:是 * 示例值:4 * 类型:Unsinged int * 说明:代金券面值,单位是分 * </pre> */ @XStreamAlias("coupon_value") private Integer couponValue; /** * <pre> * 字段名:代金券使用门槛. * 变量名:coupon_minimum 微信文档有误 * 是否必填:是 * 示例值:10 * 类型:Unsinged int * 说明:代金券使用最低限额,单位是分 * </pre> */ @XStreamAlias("coupon_minimum") private Integer couponMinimum; /** * <pre> * 字段名:代金券名称. * 变量名:coupon_name * 是否必填:是 * 示例值:测试代金券 * 类型:String * 说明:代金券名称 * </pre> */ @XStreamAlias("coupon_name") private String couponName; /** * <pre> * 字段名:代金券状态. * 变量名:coupon_state * 是否必填:是 * 示例值:SENDED * 类型:String * 说明:代金券状态:SENDED-可用,USED-已实扣,EXPIRED-已过期 * </pre> */ @XStreamAlias("coupon_state") private String couponState; /** * <pre> * 字段名:代金券描述. * 变量名:coupon_desc * 是否必填:是 * 示例值:微信支付-代金券 * 类型:String * 说明:代金券描述 * </pre> */ @XStreamAlias("coupon_desc") private String couponDesc; /** * <pre> * 字段名:实际优惠金额. * 变量名:coupon_use_value * 是否必填:是 * 示例值:0 * 类型:Unsinged int * 说明:代金券实际使用金额 * </pre> */ @XStreamAlias("coupon_use_value") private Integer couponUseValue; /** * <pre> * 字段名:优惠剩余可用额. * 变量名:coupon_remain_value * 是否必填:是 * 示例值:4 * 类型:Unsinged int * 说明:代金券剩余金额:部分使用情况下,可能会存在券剩余金额 * </pre> */ @XStreamAlias("coupon_remain_value") private Integer couponRemainValue; /** * <pre> * 字段名:生效开始时间. * 变量名:begin_time * 是否必填:是 * 示例值:1943787483 * 类型:String * 说明:格式为时间戳 * </pre> */ @XStreamAlias("begin_time") private String beginTime; /** * <pre> * 字段名:生效结束时间. * 变量名:end_time * 是否必填:是 * 示例值:1943787484 * 类型:String * 说明:格式为时间戳 * </pre> */ @XStreamAlias("end_time") private String endTime; /** * <pre> * 字段名:发放时间. * 变量名:send_time * 是否必填:是 * 示例值:1943787420 * 类型:String * 说明:格式为时间戳 * </pre> */ @XStreamAlias("send_time") private String sendTime; /** * <pre> * 字段名:消耗方商户id. * 变量名:consumer_mch_id * 是否必填:否 * 示例值:10000098 * 类型:String * 说明:代金券使用后,消耗方商户id * </pre> */ @XStreamAlias("consumer_mch_id") private String consumerMchId; /** * <pre> * 字段名:发放来源. * 变量名:send_source * 是否必填:是 * 示例值:FULL_SEND * 类型:String * 说明:代金券发放来源:FULL_SEND-满送 NORMAL-普通发放场景 * </pre> */ @XStreamAlias("send_source") private String sendSource; /** * <pre> * 字段名:是否允许部分使用. * 变量名:is_partial_use * 是否必填:否 * 示例值:1 * 类型:String * 说明:该代金券是否允许部分使用标识:1-表示支持部分使用 * </pre> */ @XStreamAlias("is_partial_use") private String isPartialUse; @Override protected void loadXml(Document d) { deviceInfo = readXmlString(d, "device_info"); couponStockId = readXmlString(d, "coupon_stock_id"); couponId = readXmlString(d, "coupon_id"); couponValue = readXmlInteger(d, "coupon_value"); couponMinimum = readXmlInteger(d, "coupon_minimum"); couponName = readXmlString(d, "coupon_name"); couponState = readXmlString(d, "coupon_state"); couponDesc = readXmlString(d, "coupon_desc"); couponUseValue = readXmlInteger(d, "coupon_use_value"); couponRemainValue = readXmlInteger(d, "coupon_remain_value"); beginTime = readXmlString(d, "begin_time"); endTime = readXmlString(d, "end_time"); sendTime = readXmlString(d, "send_time"); consumerMchId = readXmlString(d, "consumer_mch_id"); sendSource = readXmlString(d, "send_source"); isPartialUse = readXmlString(d, "is_partial_use"); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/ReservationTransferBatchResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/ReservationTransferBatchResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * <pre> * 批量预约商家转账响应结果 * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4015901167 * </pre> * * @author wanggang * created on 2025/11/28 */ @Data @NoArgsConstructor public class ReservationTransferBatchResult implements Serializable { private static final long serialVersionUID = 1L; /** * 【商户预约批次单号】 商户系统内部的商家预约批次单号 */ @SerializedName("out_batch_no") private String outBatchNo; /** * 【微信预约批次单号】 微信预约批次单号,微信商家转账系统返回的唯一标识 */ @SerializedName("reservation_batch_no") private String reservationBatchNo; /** * 【批次创建时间】 批次受理成功时返回 * 遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("create_time") private String createTime; /** * 【批次状态】 * ACCEPTED: 批次已受理 * PROCESSING: 批次处理中 * FINISHED: 批次处理完成 * CLOSED: 批次已关闭 */ @SerializedName("batch_state") private String batchState; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsCancelResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsCancelResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * <pre> * 商家转账到零钱撤销转账接口 * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4012716458 * </pre> * * @author Nor * @date 2025/1/17 */ @Data @NoArgsConstructor public class TransferBillsCancelResult implements Serializable { private static final long serialVersionUID = -4935840810530008418L; /** * 【商户单号】 商户系统内部的商家单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 */ @SerializedName("out_bill_no") private String outBillNo; /** * 【微信转账单号】 微信转账单号,微信商家转账系统返回的唯一标识 */ @SerializedName("transfer_bill_no") private String transferBillNo; /** * 【单据状态】 商家转账订单状态 * 可选取值 * CANCELING: 商户撤销请求受理成功,该笔转账正在撤销中 * CANCELLED: 转账撤销完成 */ private String state; /** * 【最后一次单据状态变更时间】 按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE */ @SerializedName("update_time") private String updateTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBatchesRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBatchesRequest.java
package com.github.binarywang.wxpay.bean.transfer; import com.github.binarywang.wxpay.v3.SpecEncrypt; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; /** * 发起商家转账API参数 * * @author zhongjun * created on 2022/6/17 **/ @Data @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor public class TransferBatchesRequest implements Serializable { private static final long serialVersionUID = -2175582517588397426L; /** * 直连商户的appid */ @SerializedName("appid") private String appid; /** * 商家批次单号 */ @SerializedName("out_batch_no") private String outBatchNo; /** * 批次名称 */ @SerializedName("batch_name") private String batchName; /** * 批次备注 */ @SerializedName("batch_remark") private String batchRemark; /** * 转账总金额 */ @SerializedName("total_amount") private Integer totalAmount; /** * 转账总笔数 */ @SerializedName("total_num") private Integer totalNum; /** * 转账明细列表 */ @SpecEncrypt @SerializedName("transfer_detail_list") private List<TransferDetail> transferDetailList; /** * 转账场景ID */ @SerializedName("transfer_scene_id") private String transferSceneId; /** * 异步接收微信支付结果通知的回调地址,通知url必须为公网可访问的url,必须为https,不能携带参数 */ @SerializedName("notify_url") private String notifyUrl; @Data @Builder(builderMethodName = "newBuilder") @AllArgsConstructor @NoArgsConstructor public static class TransferDetail { /** * 商家明细单号 */ @SerializedName("out_detail_no") private String outDetailNo; /** * 转账金额 */ @SerializedName("transfer_amount") private Integer transferAmount; /** * 转账备注 */ @SerializedName("transfer_remark") private String transferRemark; /** * 用户在直连商户应用下的用户标示 */ @SerializedName("openid") private String openid; /** * 收款用户姓名 */ @SpecEncrypt @SerializedName("user_name") private String userName; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBatchesResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBatchesResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 商家转账结果 * * @author zhongjun * created on 2022/6/17 **/ @Data @NoArgsConstructor public class TransferBatchesResult implements Serializable { private static final long serialVersionUID = -2175582517588397426L; /** * 商家批次单号 */ @SerializedName("out_batch_no") private String outBatchNo; /** * 微信批次单号 */ @SerializedName("batch_id") private String batchId; /** * 批次创建时间 */ @SerializedName("create_time") private String createTime; /** * 批次状态 */ @SerializedName("batch_status") private String batchStatus; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsGetResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsGetResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.github.binarywang.wxpay.constant.WxPayConstants; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * <pre> * 商家转账到零钱查询转账单接口 * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4012716457 https://pay.weixin.qq.com/doc/v3/merchant/4012716437 * </pre> * * @author Nor * @date 2025/1/17 */ @Data @NoArgsConstructor public class TransferBillsGetResult implements Serializable { private static final long serialVersionUID = -6376955113492371763L; /** * 【商户号】 微信支付分配的商户号 */ @SerializedName("mch_id") private String mchId; /** * 【商户单号】 商户系统内部的商家单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 */ @SerializedName("out_bill_no") private String outBillNo; /** * 【商家转账订单号】 商家转账订单的主键,唯一定义此资源的标识 */ @SerializedName("transfer_bill_no") private String transferBillNo; /** * 【商户AppID】 申请商户号的AppID或商户号绑定的AppID(企业号corpid即为此AppID) */ private String appid; /** * 【单据状态】 * 可选取值 * ACCEPTED: 转账已受理 * PROCESSING: 转账处理中,转账结果尚未明确,如一直处于此状态,建议检查账户余额是否足够 * WAIT_USER_CONFIRM: 待收款用户确认,可拉起微信收款确认页面进行收款确认 * TRANSFERING: 转账结果尚未明确,可拉起微信收款确认页面再次重试确认收款 * SUCCESS: 转账成功 * FAIL: 转账失败 * CANCELING: 商户撤销请求受理成功,该笔转账正在撤销中 * CANCELLED: 转账撤销完成 * * @see WxPayConstants.TransformBillState */ private String state; /** * 【转账金额】 转账金额单位为“分”。 */ @SerializedName("transfer_amount") private String transferAmount; /** * 【转账备注】 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符 */ @SerializedName("transfer_remark") private String transferRemark; /** * 【失败原因】 订单已失败或者已退资金时,返回失败原因 */ @SerializedName("fail_reason") private String failReason; /** * 【收款用户OpenID】 商户AppID下,某用户的OpenID */ private String openid; /** * 【收款用户姓名】 收款方真实姓名。支持标准RSA算法和国密算法,公钥由微信侧提供转账金额 >= 2,000元时,该笔明细必须填写若商户传入收款用户姓名,微信支付会校验用户OpenID与姓名是否一致,并提供电子回单 */ @SerializedName("user_name") private String userName; /** * 【单据创建时间】 单据受理成功时返回,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE */ @SerializedName("create_time") private String createTime; /** * 【最后一次状态变更时间】 单据最后更新时间,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE */ @SerializedName("update_time") private String updateTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/BusinessOperationTransferQueryResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/BusinessOperationTransferQueryResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 运营工具-商家转账查询结果 * * @author WxJava Team * @see <a href="https://pay.weixin.qq.com/doc/v3/merchant/4012711988">运营工具-商家转账API</a> */ @Data @NoArgsConstructor public class BusinessOperationTransferQueryResult implements Serializable { private static final long serialVersionUID = 1L; /** * 直连商户的appid */ @SerializedName("appid") private String appid; /** * 商户系统内部的商家单号 */ @SerializedName("out_bill_no") private String outBillNo; /** * 微信转账单号 */ @SerializedName("transfer_bill_no") private String transferBillNo; /** * 运营工具转账场景ID */ @SerializedName("operation_scene_id") private String operationSceneId; /** * 用户在直连商户应用下的用户标示 */ @SerializedName("openid") private String openid; /** * 收款用户姓名 * 已脱敏 */ @SerializedName("user_name") private String userName; /** * 转账金额 * 单位为"分" */ @SerializedName("transfer_amount") private Integer transferAmount; /** * 转账备注 */ @SerializedName("transfer_remark") private String transferRemark; /** * 转账状态 * WAIT_PAY:等待确认 * PROCESSING:转账中 * SUCCESS:转账成功 * FAIL:转账失败 * REFUND:已退款 */ @SerializedName("transfer_state") private String transferState; /** * 发起转账的时间 * 遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("create_time") private String createTime; /** * 转账更新时间 * 遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("update_time") private String updateTime; /** * 失败原因 * 当transfer_state为FAIL时返回 */ @SerializedName("fail_reason") private String failReason; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/ReservationTransferNotifyResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/ReservationTransferNotifyResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.github.binarywang.wxpay.bean.notify.OriginNotifyResponse; import com.github.binarywang.wxpay.bean.notify.WxPayBaseNotifyV3Result; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; /** * <pre> * 预约商家转账通知回调结果 * 预约批次单中的明细单在转账成功或转账失败时,微信会把相关结果信息发送给商户。 * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4015901167 * </pre> * * @author wanggang * created on 2025/11/28 */ @Data public class ReservationTransferNotifyResult implements Serializable, WxPayBaseNotifyV3Result<ReservationTransferNotifyResult.DecryptNotifyResult> { private static final long serialVersionUID = 1L; /** * 源数据 */ private OriginNotifyResponse rawData; /** * 解密后的数据 */ private ReservationTransferNotifyResult.DecryptNotifyResult result; @Data @NoArgsConstructor public static class DecryptNotifyResult implements Serializable { private static final long serialVersionUID = 1L; /** * 【商户号】 微信支付分配的商户号 */ @SerializedName("mch_id") private String mchId; /** * 【商户预约批次单号】 商户系统内部的商家预约批次单号 */ @SerializedName("out_batch_no") private String outBatchNo; /** * 【微信预约批次单号】 微信预约批次单号,微信商家转账系统返回的唯一标识 */ @SerializedName("reservation_batch_no") private String reservationBatchNo; /** * 【批次状态】 * ACCEPTED: 批次已受理 * PROCESSING: 批次处理中 * FINISHED: 批次处理完成 * CLOSED: 批次已关闭 */ @SerializedName("batch_state") private String batchState; /** * 【转账总金额】 转账金额单位为"分" */ @SerializedName("total_amount") private Integer totalAmount; /** * 【转账总笔数】 转账总笔数 */ @SerializedName("total_num") private Integer totalNum; /** * 【转账成功金额】 转账成功金额单位为"分" */ @SerializedName("success_amount") private Integer successAmount; /** * 【转账成功笔数】 转账成功笔数 */ @SerializedName("success_num") private Integer successNum; /** * 【转账失败金额】 转账失败金额单位为"分" */ @SerializedName("fail_amount") private Integer failAmount; /** * 【转账失败笔数】 转账失败笔数 */ @SerializedName("fail_num") private Integer failNum; /** * 【批次创建时间】 批次受理成功时返回 * 遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("create_time") private String createTime; /** * 【批次更新时间】 批次最后更新时间 * 遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("update_time") private String updateTime; /** * 【转账明细列表】 */ @SerializedName("transfer_detail_list") private List<TransferDetailNotify> transferDetailList; } /** * 转账明细通知 */ @Data @NoArgsConstructor public static class TransferDetailNotify implements Serializable { private static final long serialVersionUID = 1L; /** * 【商户明细单号】 商户系统内部区分转账批次单下不同转账明细单的唯一标识 */ @SerializedName("out_detail_no") private String outDetailNo; /** * 【微信转账单号】 微信转账单号,微信商家转账系统返回的唯一标识 */ @SerializedName("transfer_bill_no") private String transferBillNo; /** * 【明细状态】 * PROCESSING: 转账处理中 * SUCCESS: 转账成功 * FAIL: 转账失败 */ @SerializedName("detail_state") private String detailState; /** * 【收款用户OpenID】 商户AppID下,某用户的OpenID */ @SerializedName("openid") private String openid; /** * 【转账金额】 转账金额单位为"分" */ @SerializedName("transfer_amount") private Integer transferAmount; /** * 【失败原因】 转账失败原因 */ @SerializedName("fail_reason") private String failReason; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/BusinessOperationTransferRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/BusinessOperationTransferRequest.java
package com.github.binarywang.wxpay.bean.transfer; import com.github.binarywang.wxpay.v3.SpecEncrypt; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 运营工具-商家转账请求参数 * * @author WxJava Team * @see <a href="https://pay.weixin.qq.com/doc/v3/merchant/4012711988">运营工具-商家转账API</a> */ @Data @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor public class BusinessOperationTransferRequest implements Serializable { private static final long serialVersionUID = 1L; /** * 直连商户的appid * 必须 */ @SerializedName("appid") private String appid; /** * 商户系统内部的商家单号 * 必须,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 */ @SerializedName("out_bill_no") private String outBillNo; /** * 运营工具转账场景ID * 必须,用于标识运营工具转账的具体业务场景 */ @SerializedName("operation_scene_id") private String operationSceneId; /** * 用户在直连商户应用下的用户标示 * 必须 */ @SerializedName("openid") private String openid; /** * 收款用户姓名 * 可选,传入则校验收款用户姓名 * 使用RSA加密,使用OAEP填充方式 */ @SpecEncrypt @SerializedName("user_name") private String userName; /** * 转账金额 * 必须,单位为"分" */ @SerializedName("transfer_amount") private Integer transferAmount; /** * 转账备注 * 必须,会在转账成功消息和转账详情页向用户展示 */ @SerializedName("transfer_remark") private String transferRemark; /** * 用户收款感知 * 可选,用于在转账成功消息中向用户展示特定内容 */ @SerializedName("user_recv_perception") private String userRecvPerception; /** * 异步接收微信支付转账结果通知的回调地址 * 可选,通知URL必须为外网可以正常访问的地址,不能携带查询参数 */ @SerializedName("notify_url") private String notifyUrl; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/QueryTransferBatchesRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/QueryTransferBatchesRequest.java
package com.github.binarywang.wxpay.bean.transfer; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 查询微信批次单号查询批次单API参数 * * @author zhongjun * created on 2022/6/17 **/ @Data @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor public class QueryTransferBatchesRequest implements Serializable { private static final long serialVersionUID = -2175582517588397426L; /** * 微信批次单号 */ private String batchId; /** * 是否查询转账明细单 */ private Boolean needQueryDetail; private Integer offset; private Integer limit; /** * 明细状态 * 查询指定状态的转账明细单,当need_query_detail为true时,该字段必填 * ALL:全部。需要同时查询转账成功和转账失败的明细单 * SUCCESS:转账成功。只查询转账成功的明细单 * FAIL:转账失败。只查询转账失败的明细单 */ private String detailStatus; /** * 商家批次单号 */ private String outBatchNo; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsNotifyResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsNotifyResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.github.binarywang.wxpay.bean.notify.OriginNotifyResponse; import com.github.binarywang.wxpay.bean.notify.WxPayBaseNotifyV3Result; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * <pre> * 商家转账到零钱接口将转账结果通知用户 * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4012716434 * </pre> */ @Data public class TransferBillsNotifyResult implements Serializable, WxPayBaseNotifyV3Result<TransferBillsNotifyResult.DecryptNotifyResult> { /** * 源数据 */ private OriginNotifyResponse rawData; /** * 解密后的数据 */ private TransferBillsNotifyResult.DecryptNotifyResult result; @Data @NoArgsConstructor public static class DecryptNotifyResult implements Serializable { /** * 商户号 */ @SerializedName(value = "mch_id") private String mchId; /** * 商家批次单号 */ @SerializedName(value = "out_bill_no") private String outBillNo; /** * 微信批次单号 */ @SerializedName(value = "transfer_bill_no") private String transferBillNo; /** * 批次状态 */ @SerializedName(value = "state") private String state; /** * 转账金额 */ @SerializedName(value = "transfer_amount") private Integer transferAmount; /** * 批次状态 */ @SerializedName(value = "openid") private String openid; /** * 单据创建时间 */ @SerializedName(value = "create_time") private String createTime; /** * 最后一次状态变更时间 */ @SerializedName(value = "update_time") private String updateTime; /** * 错误原因 */ @SerializedName(value = "fail_reason") private String failReason; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/UserAuthorizationStatusResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/UserAuthorizationStatusResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * <pre> * 商户查询用户授权信息接口响应结果 * 商户通过此接口可查询用户是否对商户的商家转账场景进行了授权。 * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4015901167 * </pre> * * @author wanggang * created on 2025/11/28 */ @Data @NoArgsConstructor public class UserAuthorizationStatusResult implements Serializable { private static final long serialVersionUID = 1L; /** * 【商户AppID】 商户在微信申请公众号或移动应用成功后分配的账号ID */ @SerializedName("appid") private String appid; /** * 【商户号】 微信支付分配的商户号 */ @SerializedName("mch_id") private String mchId; /** * 【用户标识】 用户在直连商户应用下的用户标识 */ @SerializedName("openid") private String openid; /** * 【授权状态】 用户授权状态 * UNAUTHORIZED: 未授权 * AUTHORIZED: 已授权 */ @SerializedName("authorization_state") private String authorizationState; /** * 【授权时间】 用户授权时间,遵循rfc3339标准格式 * 格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("authorize_time") private String authorizeTime; /** * 【取消授权时间】 用户取消授权时间,遵循rfc3339标准格式 * 格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("deauthorize_time") private String deauthorizeTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/BusinessOperationTransferResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/BusinessOperationTransferResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 运营工具-商家转账结果 * * @author WxJava Team * @see <a href="https://pay.weixin.qq.com/doc/v3/merchant/4012711988">运营工具-商家转账API</a> */ @Data @NoArgsConstructor public class BusinessOperationTransferResult implements Serializable { private static final long serialVersionUID = 1L; /** * 商户系统内部的商家单号 */ @SerializedName("out_bill_no") private String outBillNo; /** * 微信转账单号 * 微信商家转账系统返回的唯一标识 */ @SerializedName("transfer_bill_no") private String transferBillNo; /** * 转账状态 * WAIT_PAY:等待确认 * PROCESSING:转账中 * SUCCESS:转账成功 * FAIL:转账失败 * REFUND:已退款 */ @SerializedName("transfer_state") private String transferState; /** * 发起转账的时间 * 遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("create_time") private String createTime; /** * 转账更新时间 * 遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("update_time") private String updateTime; /** * 失败原因 * 当transfer_state为FAIL时返回 */ @SerializedName("fail_reason") private String failReason; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java
package com.github.binarywang.wxpay.bean.transfer; import com.github.binarywang.wxpay.v3.SpecEncrypt; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; /** * 发起商家转账API参数 * * @author allovine * created on 2025/1/15 **/ @Data @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor public class TransferBillsRequest implements Serializable { private static final long serialVersionUID = -2175582517588397437L; /** * 直连商户的appid */ @SerializedName("appid") private String appid; /** * 商户系统内部的商家单号 */ @SerializedName("out_bill_no") private String outBillNo; /** * 转账场景ID * 商户平台-产品中心-商家转账 申请 * 佣金报酬 ID:1005 */ @SerializedName("transfer_scene_id") private String transferSceneId; /** * 用户在直连商户应用下的用户标示 */ @SerializedName("openid") private String openid; /** * 收款用户姓名 */ @SpecEncrypt @SerializedName("user_name") private String userName; /** * 转账金额 */ @SerializedName("transfer_amount") private Integer transferAmount; /** * 转账备注 */ @SerializedName("transfer_remark") private String transferRemark; /** * 异步接收微信支付结果通知的回调地址,通知url必须为公网可访问的url,必须为https,不能携带参数 */ @SerializedName("notify_url") private String notifyUrl; /** * 用户收款感知 */ @SerializedName("user_recv_perception") private String userRecvPerception; /** * 转账场景报备信息 */ @SerializedName("transfer_scene_report_infos") private List<TransferSceneReportInfo> transferSceneReportInfos; /** * 收款授权模式 * <pre> * 字段名:收款授权模式 * 变量名:receipt_authorization_mode * 是否必填:否 * 类型:string * 描述: * 控制收款方式的授权模式,可选值: * - CONFIRM_RECEIPT_AUTHORIZATION:需确认收款授权模式(默认值) * - NO_CONFIRM_RECEIPT_AUTHORIZATION:免确认收款授权模式(需要用户事先授权) * 为空时,默认为需确认收款授权模式 * 示例值:NO_CONFIRM_RECEIPT_AUTHORIZATION * </pre> * * @see com.github.binarywang.wxpay.constant.WxPayConstants.ReceiptAuthorizationMode */ @SerializedName("receipt_authorization_mode") private String receiptAuthorizationMode; @Data @Builder(builderMethodName = "newBuilder") @AllArgsConstructor @NoArgsConstructor public static class TransferSceneReportInfo { /** * 信息类型 */ @SerializedName("info_type") private String infoType; /** * 信息内容 */ @SerializedName("info_content") private String infoContent; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.github.binarywang.wxpay.constant.WxPayConstants; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 商家转账结果 * * @author allovine * created on 2025/1/15 **/ @Data @NoArgsConstructor public class TransferBillsResult implements Serializable { private static final long serialVersionUID = -2175582517588397437L; /** * 商户单号 */ @SerializedName("out_bill_no") private String outBillNo; /** * 微信转账单号 */ @SerializedName("transfer_bill_no") private String transferBillNo; /** * 单据创建时间 */ @SerializedName("create_time") private String createTime; /** * 单据状态 * * @see WxPayConstants.TransformBillState */ @SerializedName("state") private String state; /** * 失败原因 */ @SerializedName("fail_reason") private String failReason; /** * 跳转领取页面的package信息 */ @SerializedName("package_info") private String packageInfo; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/QueryTransferBatchesResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/QueryTransferBatchesResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; /** * 查询微信批次单号查询批次单API响应 * * @author zhongjun * created on 2022/6/17 **/ @Data @NoArgsConstructor public class QueryTransferBatchesResult implements Serializable { private static final long serialVersionUID = -2175582517588397426L; @SerializedName("offset") private Integer offset; @SerializedName("limit") private Integer limit; @SerializedName("transfer_batch") private TransferBatch transferBatch; @SerializedName("transfer_detail_list") private List<TransferDetail> transferDetailList; @NoArgsConstructor @Data public static class TransferBatch { @SerializedName("mchid") private String mchid; @SerializedName("out_batch_no") private String outBatchNo; @SerializedName("batch_id") private String batchId; @SerializedName("appid") private String appid; @SerializedName("batch_status") private String batchStatus; @SerializedName("batch_type") private String batchType; @SerializedName("batch_name") private String batchName; @SerializedName("batch_remark") private String batchRemark; @SerializedName("close_reason") private String closeReason; @SerializedName("total_amount") private Integer totalAmount; @SerializedName("total_num") private Integer totalNum; @SerializedName("create_time") private String createTime; @SerializedName("update_time") private String updateTime; @SerializedName("success_amount") private Integer successAmount; @SerializedName("success_num") private Integer successNum; @SerializedName("fail_amount") private Integer failAmount; @SerializedName("fail_num") private Integer failNum; } @NoArgsConstructor @Data public static class TransferDetail { @SerializedName("detail_id") private String detailId; @SerializedName("out_detail_no") private String outDetailNo; @SerializedName("detail_status") private String detailStatus; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferNotifyResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferNotifyResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.github.binarywang.wxpay.bean.notify.OriginNotifyResponse; import com.github.binarywang.wxpay.bean.notify.WxPayBaseNotifyV3Result; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * <pre> * 商家转账到零钱接口将转账结果通知用户 * 文档地址:https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/transfer-batch-callback-notice.html * </pre> */ @Data public class TransferNotifyResult implements Serializable, WxPayBaseNotifyV3Result<TransferNotifyResult.DecryptNotifyResult> { /** * 源数据 */ private OriginNotifyResponse rawData; /** * 解密后的数据 */ private TransferNotifyResult.DecryptNotifyResult result; @Data @NoArgsConstructor public static class DecryptNotifyResult implements Serializable { /** * 商户号 */ @SerializedName(value = "mchid") private String mchid; /** * 商家批次单号 */ @SerializedName(value = "out_batch_no") private String outBatchNo; /** * 微信批次单号 */ @SerializedName(value = "batch_id") private String batchId; /** * 批次状态 */ @SerializedName(value = "batch_status") private String batchStatus; /** * 批次总笔数 */ @SerializedName(value = "total_num") private Integer totalNum; /** * 批次总金额 */ @SerializedName(value = "total_amount") private Integer totalAmount; /** * 转账成功金额 */ @SerializedName(value = "success_amount") private Integer successAmount; /** * 转账成功笔数 */ @SerializedName(value = "success_num") private Integer successNum; /** * 转账失败金额 */ @SerializedName(value = "fail_amount") private Integer failAmount; /** * 转账失败笔数 */ @SerializedName(value = "fail_num") private Integer failNum; /** * 批次更新时间 */ @SerializedName(value = "update_time") private String updateTime; /** * 批次关闭原因 */ @SerializedName(value = "close_reason") private String closeReason; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/ReservationTransferBatchRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/ReservationTransferBatchRequest.java
package com.github.binarywang.wxpay.bean.transfer; import com.github.binarywang.wxpay.v3.SpecEncrypt; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; /** * <pre> * 批量预约商家转账请求参数 * 商户可以通过批量预约接口一次发起批量转账请求,最多可以同时向50个用户发起转账。 * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4015901167 * </pre> * * @author wanggang * created on 2025/11/28 */ @Data @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor public class ReservationTransferBatchRequest implements Serializable { private static final long serialVersionUID = 1L; /** * 【商户AppID】 商户在微信申请公众号或移动应用成功后分配的账号ID */ @SerializedName("appid") private String appid; /** * 【商户预约批次单号】 商户系统内部的商家预约批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 */ @SerializedName("out_batch_no") private String outBatchNo; /** * 【转账场景ID】 商户在商户平台-产品中心-商家转账中申请的转账场景ID */ @SerializedName("transfer_scene_id") private String transferSceneId; /** * 【批次备注】 批次备注 */ @SerializedName("batch_remark") private String batchRemark; /** * 【转账总金额】 转账金额单位为"分",转账总金额必须与批次内所有转账明细金额之和保持一致,否则无法发起转账操作 */ @SerializedName("total_amount") private Integer totalAmount; /** * 【转账总笔数】 转账总笔数,需要与批次内所有转账明细笔数保持一致,否则无法发起转账操作 */ @SerializedName("total_num") private Integer totalNum; /** * 【转账明细列表】 转账明细列表,最多50条 */ @SerializedName("transfer_detail_list") private List<TransferDetail> transferDetailList; /** * 【异步回调地址】 异步接收微信支付结果通知的回调地址,通知url必须为公网可访问的url,必须为https,不能携带参数 */ @SerializedName("notify_url") private String notifyUrl; /** * 转账明细 */ @Data @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor public static class TransferDetail implements Serializable { private static final long serialVersionUID = 1L; /** * 【商户明细单号】 商户系统内部区分转账批次单下不同转账明细单的唯一标识,要求此参数只能由数字、大小写字母组成 */ @SerializedName("out_detail_no") private String outDetailNo; /** * 【转账金额】 转账金额单位为"分" */ @SerializedName("transfer_amount") private Integer transferAmount; /** * 【转账备注】 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符 */ @SerializedName("transfer_remark") private String transferRemark; /** * 【收款用户OpenID】 商户AppID下,某用户的OpenID */ @SerializedName("openid") private String openid; /** * 【收款用户姓名】 收款方真实姓名。支持标准RSA算法和国密算法,公钥由微信侧提供 */ @SpecEncrypt @SerializedName("user_name") private String userName; /** * 【转账场景报备信息】 */ @SerializedName("transfer_scene_report_infos") private List<TransferSceneReportInfo> transferSceneReportInfos; } /** * 转账场景报备信息 */ @Data @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor public static class TransferSceneReportInfo implements Serializable { private static final long serialVersionUID = 1L; /** * 【信息类型】 信息类型编码 */ @SerializedName("info_type") private String infoType; /** * 【信息内容】 信息内容 */ @SerializedName("info_content") private String infoContent; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/ReservationTransferBatchGetResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/ReservationTransferBatchGetResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; /** * <pre> * 预约转账批次单号查询接口响应结果 * 通过预约批次单号查询批量预约商家转账批次单基本信息。 * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4015901167 * </pre> * * @author wanggang * created on 2025/11/28 */ @Data @NoArgsConstructor public class ReservationTransferBatchGetResult implements Serializable { private static final long serialVersionUID = 1L; /** * 【商户号】 微信支付分配的商户号 */ @SerializedName("mch_id") private String mchId; /** * 【商户预约批次单号】 商户系统内部的商家预约批次单号 */ @SerializedName("out_batch_no") private String outBatchNo; /** * 【微信预约批次单号】 微信预约批次单号,微信商家转账系统返回的唯一标识 */ @SerializedName("reservation_batch_no") private String reservationBatchNo; /** * 【商户AppID】 商户在微信申请公众号或移动应用成功后分配的账号ID */ @SerializedName("appid") private String appid; /** * 【批次备注】 批次备注 */ @SerializedName("batch_remark") private String batchRemark; /** * 【转账场景ID】 商户在商户平台-产品中心-商家转账中申请的转账场景ID */ @SerializedName("transfer_scene_id") private String transferSceneId; /** * 【批次状态】 * ACCEPTED: 批次已受理 * PROCESSING: 批次处理中 * FINISHED: 批次处理完成 * CLOSED: 批次已关闭 */ @SerializedName("batch_state") private String batchState; /** * 【转账总金额】 转账金额单位为"分" */ @SerializedName("total_amount") private Integer totalAmount; /** * 【转账总笔数】 转账总笔数 */ @SerializedName("total_num") private Integer totalNum; /** * 【转账成功金额】 转账成功金额单位为"分" */ @SerializedName("success_amount") private Integer successAmount; /** * 【转账成功笔数】 转账成功笔数 */ @SerializedName("success_num") private Integer successNum; /** * 【转账失败金额】 转账失败金额单位为"分" */ @SerializedName("fail_amount") private Integer failAmount; /** * 【转账失败笔数】 转账失败笔数 */ @SerializedName("fail_num") private Integer failNum; /** * 【批次创建时间】 批次受理成功时返回 * 遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("create_time") private String createTime; /** * 【批次更新时间】 批次最后更新时间 * 遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE */ @SerializedName("update_time") private String updateTime; /** * 【批次关闭原因】 批次关闭原因 * MERCHANT_REVOCATION: 商户主动撤销 * OVERDUE_CLOSE: 系统超时关闭 */ @SerializedName("close_reason") private String closeReason; /** * 【是否需要查询明细】 */ @SerializedName("need_query_detail") private Boolean needQueryDetail; /** * 【转账明细列表】 */ @SerializedName("transfer_detail_list") private List<TransferDetail> transferDetailList; /** * 转账明细 */ @Data @NoArgsConstructor public static class TransferDetail implements Serializable { private static final long serialVersionUID = 1L; /** * 【商户明细单号】 商户系统内部区分转账批次单下不同转账明细单的唯一标识 */ @SerializedName("out_detail_no") private String outDetailNo; /** * 【微信转账单号】 微信转账单号,微信商家转账系统返回的唯一标识 */ @SerializedName("transfer_bill_no") private String transferBillNo; /** * 【明细状态】 * PROCESSING: 转账处理中 * SUCCESS: 转账成功 * FAIL: 转账失败 */ @SerializedName("detail_state") private String detailState; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBatchDetailResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBatchDetailResult.java
package com.github.binarywang.wxpay.bean.transfer; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 微信明细单号查询明细单API * * @author zhongjun */ @NoArgsConstructor @Data public class TransferBatchDetailResult implements Serializable { private static final long serialVersionUID = -2175582517588397426L; @SerializedName("mchid") private String mchid; @SerializedName("out_batch_no") private String outBatchNo; @SerializedName("batch_id") private String batchId; @SerializedName("appid") private String appid; @SerializedName("out_detail_no") private String outDetailNo; @SerializedName("detail_id") private String detailId; @SerializedName("detail_status") private String detailStatus; @SerializedName("transfer_amount") private Integer transferAmount; @SerializedName("transfer_remark") private String transferRemark; @SerializedName("fail_reason") private String failReason; @SerializedName("openid") private String openid; @SerializedName("user_name") private String userName; @SerializedName("initiate_time") private String initiateTime; @SerializedName("update_time") private String updateTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/BusinessOperationTransferQueryRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/BusinessOperationTransferQueryRequest.java
package com.github.binarywang.wxpay.bean.transfer; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 运营工具-商家转账查询请求参数 * * @author WxJava Team * @see <a href="https://pay.weixin.qq.com/doc/v3/merchant/4012711988">运营工具-商家转账API</a> */ @Data @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor public class BusinessOperationTransferQueryRequest implements Serializable { private static final long serialVersionUID = 1L; /** * 商户系统内部的商家单号 * 与transfer_bill_no二选一 */ @SerializedName("out_bill_no") private String outBillNo; /** * 微信转账单号 * 与out_bill_no二选一 */ @SerializedName("transfer_bill_no") private String transferBillNo; /** * 直连商户的appid * 可选 */ @SerializedName("appid") private String appid; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/realname/RealNameRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/realname/RealNameRequest.java
package com.github.binarywang.wxpay.bean.realname; import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.*; import me.chanjar.weixin.common.annotation.Required; import java.util.Map; /** * <pre> * 微信支付实名验证请求对象. * 详见文档:https://pay.wechatpay.cn/doc/v2/merchant/4011987607 * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data @EqualsAndHashCode(callSuper = true) @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor @XStreamAlias("xml") public class RealNameRequest extends BaseWxPayRequest { private static final long serialVersionUID = 1L; /** * <pre> * 字段名:用户标识 * 变量名:openid * 是否必填:是 * 类型:String(128) * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o * 描述:用户在商户appid下的唯一标识 * </pre> */ @Required @XStreamAlias("openid") private String openid; @Override protected void checkConstraints() { //do nothing } @Override protected void storeMap(Map<String, String> map) { map.put("openid", openid); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/realname/RealNameResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/realname/RealNameResult.java
package com.github.binarywang.wxpay.bean.realname; import com.github.binarywang.wxpay.bean.result.BaseWxPayResult; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.w3c.dom.Document; import java.io.Serializable; /** * <pre> * 微信支付实名验证返回结果. * 详见文档:https://pay.wechatpay.cn/doc/v2/merchant/4011987607 * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @XStreamAlias("xml") public class RealNameResult extends BaseWxPayResult implements Serializable { private static final long serialVersionUID = 1L; /** * <pre> * 字段名:用户标识 * 变量名:openid * 是否必填:否 * 类型:String(128) * 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o * 描述:用户在商户appid下的唯一标识 * </pre> */ @XStreamAlias("openid") private String openid; /** * <pre> * 字段名:实名认证状态 * 变量名:is_certified * 是否必填:是 * 类型:String(1) * 示例值:Y * 描述:Y-已实名认证 N-未实名认证 * </pre> */ @XStreamAlias("is_certified") private String isCertified; /** * <pre> * 字段名:实名认证信息 * 变量名:cert_info * 是否必填:否 * 类型:String(256) * 示例值: * 描述:实名认证的相关信息,如姓名等(加密) * </pre> */ @XStreamAlias("cert_info") private String certInfo; /** * <pre> * 字段名:引导链接 * 变量名:guide_url * 是否必填:否 * 类型:String(256) * 示例值: * 描述:未实名时,引导用户进行实名认证的URL * </pre> */ @XStreamAlias("guide_url") private String guideUrl; /** * 从XML结构中加载额外的属性 * * @param d Document */ @Override protected void loadXml(Document d) { openid = readXmlString(d, "openid"); isCertified = readXmlString(d, "is_certified"); certInfo = readXmlString(d, "cert_info"); guideUrl = readXmlString(d, "guide_url"); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/result/BrandDetailsQueryResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/result/BrandDetailsQueryResult.java
package com.github.binarywang.wxpay.bean.brandmerchanttransfer.result; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * 品牌红包微信明细单号查询明细单 响应实体、 * * @author moran */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class BrandDetailsQueryResult implements Serializable { private static final long serialVersionUID = 1L; /** * <pre> * 字段名:品牌主商户号 * 变量名:brand_mchid * 是否必填:是 * 类型:string[1,32] * 描述: * 微信服务商下特约商户的商户号,且已经认证品牌的品牌主商户号 * 示例值:1900001109 * </pre> */ @SerializedName("brand_mchid") private String brandMchid; /** * <pre> * 字段名:商家品牌红包批次单号 * 变量名:out_batch_no * 是否必填:是 * 类型:string[1,32] * 描述: * 商户系统内部的商家品牌红包批次单号,在商户系统内部唯一 * 示例值:plfk2020042013 * </pre> */ @SerializedName("out_batch_no") private String outBatchNo; /** * <pre> * 字段名:微信支付品牌红包批次单号 * 变量名:batch_no * 是否必填:是 * 类型:string[32, 64] * 描述: * 微信支付品牌红包批次单号,微信商家品牌红包系统返回的唯一标识 * 示例值:1030000071100999991182020050700019480001 * </pre> */ @SerializedName("batch_no") private String batchNo; /** * <pre> * 字段名:商家品牌红包明细单号 * 变量名:out_detail_no * 是否必填:是 * 类型:string[1,32] * 描述: * 品牌商户系统内部的品牌红包批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 * 示例值:x23zy545Bd5436 * </pre> */ @SerializedName("out_detail_no") private String outDetailNo; /** * <pre> * 字段名:微信支付品牌红包明细单号 * 变量名:detail_id * 是否必填:是 * 类型:string[32, 64] * 描述: * 微信支付系统内部区分品牌红包批次单下不同品牌红包明细单的唯一标识 * 示例值:1040000071100999991182020050700019500100 * </pre> */ @SerializedName("detail_no") private String detailNo; /** * <pre> * 字段名:品牌红包明细单状态 * 变量名:detail_state * 是否必填:是 * 类型:string * 描述: * 品牌红包明细单状态 * DETAIL_PROCESSING - 发送中,正在处理中,品牌红包发送结果尚未明确 * DETAIL_SUCCESS - 发送成功,发送成功 * DETAIL_FAIL - 发送失败,需要确认失败原因后,再决定是否重新对该笔品牌红包明细单进行发送(并非整个品牌红包批次单) * 示例值:DETAIL_SUCCESS * </pre> */ @SerializedName("detail_state") private String detailState; /** * <pre> * 字段名:红包金额 * 变量名:amount * 是否必填:是 * 类型:int * 描述: * 红包金额单位为“分” * 示例值:100 * </pre> */ @SerializedName("amount") private Integer amount; /** * <pre> * 字段名:红包备注 * 变量名:remark * 是否必填:是 * 类型:string[1,32] * 描述: * 单个品牌红包备注(微信用户会收到该备注),UTF8编码,最多允许32个字符 * 示例值:来自XX品牌红包 * </pre> */ @SerializedName("remark") private String remark; /** * <pre> * 字段名:明细失败原因 * 变量名:fail_reason * 是否必填:否 * 类型:string * 描述: * 明细失败原因 * ACCOUNT_FROZEN - 该用户账户被冻结 * REAL_NAME_CHECK_FAIL - 收款人未实名认证,需要用户完成微信实名认证 * NAME_NOT_CORRECT - 收款人姓名校验不通过,请核实信息 * OPENID_INVALID - OpenID格式错误或者不属于商家公众账号 * TRANSFER_QUOTA_EXCEED - 超过用户单笔收款区间,核实产品设置是否准确 * DAY_RECEIVED_QUOTA_EXCEED - 超过用户单日收款额度,核实产品设置是否准确 * DAY_RECEIVED_COUNT_EXCEED - 超过用户单日收款次数,核实产品设置是否准确 * PRODUCT_AUTH_CHECK_FAIL - 未开通该权限或权限被冻结,请核实产品权限状态 * OVERDUE_CLOSE - 该笔转账已关闭 * ACCOUNT_NOT_EXIST - 该用户账户不存在 * TRANSFER_RISK - 该笔转账可能存在风险,已被微信拦截 * USER_ACCOUNT_LIMIT - 用户账户收款受限,请引导用户在微信支付查看详情 * FAIL_REASON_UNKNOWN - 失败原因未知 * PAYER_ACCOUNT_ABNORMAL - 商户账户付款受限,可前往商户平台获取解除功能限制指引 * PAYEE_ACCOUNT_ABNORMAL - 用户账户收款异常,请联系用户完善其在微信支付的身份信息以继续收款 * USER_RECEIVE_OVERDUE - 用户逾期未领取 * REMARK_NOT_CORRECT - 红包备注设置失败,请修改后再试 * 示例值:ACCOUNT_FROZEN * </pre> */ @SerializedName("fail_reason") private String failReason; /** * <pre> * 字段名:接收红包用户OpenID * 变量名:openid * 是否必填:是 * 类型:string[1, 64] * 描述: * 接收红包的用户OpenID,OpenID为用户在对应AppID下的唯一标识 * 示例值:o-MYE42l80oelYMDE34nYD456Xoy * </pre> */ @SerializedName("openid") private String openid; /** * <pre> * 字段名:接收红包用户姓名 * 变量名:user_name * 是否必填:否 * 类型:string[1,1024] * 描述: * 发放品牌红包时传入的接收红包用户姓名,已使用商户的私钥加密 * 示例值:757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45 * </pre> */ @SerializedName("user_name") private String userName; /** * <pre> * 字段名:品牌红包发起时间 * 变量名:initiate_time * 是否必填:否 * 类型:string[1,32] * 描述: * 品牌红包发起的时间,遵循rfc3339标准格式, * 格式为yyyy-MM-DDTHH:mm:ss.sss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss.sss表示时分秒毫秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。 * 例如:2015-05-20T13:29:35.120+08:00表示北京时间2015年05月20日13点29分35秒 * 示例值:2015-05-20T13:29:35.120+08:00 * </pre> */ @SerializedName("initiate_time") private String initiateTime; /** * <pre> * 字段名:品牌红包更新时间 * 变量名:update_time * 是否必填:是 * 类型:string[1,32] * 描述: * 品牌红包明细单最后一次状态变更时间,遵循rfc3339标准格式, * 格式为yyyy-MM-DDTHH:mm:ss.sss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss.sss表示时分秒毫秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。 * 例如:2015-05-20T13:29:35.120+08:00表示北京时间2015年05月20日13点29分35秒 * 示例值:2015-05-20T13:29:35.120+08:00 * </pre> */ @SerializedName("update_time") private String updateTime; /** * <pre> * 字段名:品牌ID * 变量名:brand_id * 是否必填:是 * 类型:int * 描述: * 品牌在微信支付进行品牌认证后的唯一标识品牌ID * 示例值:1234 * </pre> */ @SerializedName("brand_id") private Integer brandId; /** * <pre> * 字段名:品牌红包模板ID * 变量名:template_id * 是否必填:是 * 类型:string[1, 128] * 描述: * 品牌主配置的品牌红包模板ID * 示例值:12340000000001 * </pre> */ @SerializedName("template_id") private String templateId; /** * <pre> * 字段名:品牌AppID * 变量名:brand_appid * 是否必填:否 * 类型:string[1, 32] * 描述: * 品牌商户在微信申请公众号/小程序或移动应用成功后分配的账号ID,该AppID需与品牌ID有绑定关系(B-A绑定关系) * 示例值:wxf636efh567hg4356 * </pre> */ @SerializedName("brand_appid") private String brandAppid; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/result/BrandTransferBatchesResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/result/BrandTransferBatchesResult.java
package com.github.binarywang.wxpay.bean.brandmerchanttransfer.result; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 品牌红包商家转账结果 * * @author moran **/ @Data @NoArgsConstructor public class BrandTransferBatchesResult implements Serializable { private static final long serialVersionUID = 1L; /** * <pre> * 字段名:商家品牌红包批次单号 * 变量名:out_batch_no * 是否必填:是 * 类型:string[5, 32] * 描述: * 品牌商户系统内部区分品牌红包批次单下不同品牌红包明细单的唯一标识,要求此参数只能由数字、大小写字母组成 * 示例值:plfk2020042013 * </pre> */ @SerializedName("out_batch_no") private String outBatchNo; /** * <pre> * 字段名:微信支付品牌红包批次单号 * 变量名:batch_no * 是否必填:是 * 类型:string[32, 64] * 描述: * 微信批次单号,微信商家转账系统返回的唯一标识 * 示例值:1210000071100999991182020050700019480001 * </pre> */ @SerializedName("batch_no") private String batchNo; /** * <pre> * 字段名:品牌红包批次创建时间 * 变量名:create_time * 是否必填:是 * 类型:string[1, 32] * 描述: * 批次受理成功时返回,遵循rfc3339标准格式, * 格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。 * 例如:2015-05-20T13:29:35+08:00表示北京时间2015年05月20日13点29分35秒 * 示例值:2015-05-20T13:29:35+08:00 * </pre> */ @SerializedName("create_time") private String createTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/result/BrandBatchesQueryResult.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/result/BrandBatchesQueryResult.java
package com.github.binarywang.wxpay.bean.brandmerchanttransfer.result; import com.github.binarywang.wxpay.v3.SpecEncrypt; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; import java.util.List; /** * 查询批次单结果 * * @author moran **/ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class BrandBatchesQueryResult implements Serializable { private static final long serialVersionUID = 1L; /** * <pre> * 字段名:品牌主商户号 * 变量名:brand_mchid * 是否必填:是 * 类型:string[1, 32] * 描述: * 微信服务商下特约商户的商户号,且已经认证品牌的品牌主商户号 * 示例值:1900001109 * </pre> */ @SerializedName("brand_mchid") private String brandMchid; /** * <pre> * 字段名:微信支付品牌红包批次单号 * 变量名:batch_no * 是否必填:是 * 类型:string[32, 64] * 描述: * 品牌在微信支付进行品牌认证后的唯一标识品牌ID * 示例值:1030000071100999991182020050700019480001 * </pre> */ @SerializedName("batch_no") private String batchNo; /** * <pre> * 字段名:商家品牌红包批次单号 * 变量名:out_batch_no * 是否必填:是 * 类型:string[1, 32] * 描述: * 品牌商户系统内部的品牌红包批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 * 示例值:plfk2020042013 * </pre> */ @SerializedName("out_batch_no") private String outBatchNo; /** * <pre> * 字段名:品牌ID * 变量名:brand_id * 是否必填:否 * 类型:int * 描述: * 品牌在微信支付进行品牌认证后的唯一标识品牌ID * 示例值:1234 * </pre> */ @SerializedName("brand_id") private Integer brandId; /** * <pre> * 字段名:品牌红包模板ID * 变量名:template_id * 是否必填:否 * 类型:string[1, 128] * 描述: * 品牌主配置的品牌红包模板ID * 示例值:12340000000001 * </pre> */ @SerializedName("template_id") private String templateId; /** * <pre> * 字段名:品牌AppID * 变量名:brand_appid * 是否必填:否 * 类型:string[1, 32] * 描述: * 品牌商户在微信申请公众号/小程序或移动应用成功后分配的账号ID,该AppID需与品牌ID有绑定关系(B-A绑定关系) * 示例值:wxf636efh567hg4356 * </pre> */ @SerializedName("brand_appid") private String brandAppid; /** * <pre> * 字段名:品牌红包批次状态 * 变量名:batch_state * 是否必填:是 * 类型:string * 描述: * 当前品牌红包批次状态 * WAIT_PAY - 待付款,商户员工确认付款阶段 * ACCEPTED - 已受理,批次已受理成功,若发起品牌红包的30分钟后,品牌红包批次单仍处于该状态,可能原因是商户账户余额不足等。商户可查询账户资金流水,若该笔品牌红包批次单的扣款已经发生,则表示批次已经进入发送中,请再次查单确认 * PROCESSING - 发送中,已开始处理批次内的品牌红包明细单 * FINISHED - 已完成,批次内的所有品牌红包明细单都已处理完成 * CLOSED - 已关闭,可查询具体的批次关闭原因确认 * 示例值:ACCEPTED * </pre> */ @SerializedName("batch_state") private String batchState; /** * <pre> * 字段名:品牌红包批次名称 * 变量名:batch_name * 是否必填:是 * 类型:string[1, 32] * 描述: * 该批次品牌红包的备注,用于品牌商户内部管理 * 示例值:双十一营销发放品牌红包 * </pre> */ @SerializedName("batch_name") private String batchName; /** * <pre> * 字段名:品牌红包批次备注 * 变量名:batch_remark * 是否必填:是 * 类型:string[1, 32] * 描述: * 该批次品牌红包的备注,仅用于品牌商户内部管理 * 示例值:双十一营销发放品牌红包 * </pre> */ @SerializedName("batch_remark") private String batchRemark; /** * <pre> * 字段名:品牌红包批次单关闭原因 * 变量名:close_reason * 是否必填:否 * 类型:string * 描述: * 品牌红包批次单状态为“CLOSED”(已关闭)时返回 * MERCHANT_REVOCATION - 商户主动撤销 * SYSTEM_OVERDUE_CLOSE - 系统超时关闭 * 示例值:SYSTEM_OVERDUE_CLOSE * </pre> */ @SerializedName("close_reason") private String closeReason; /** * <pre> * 字段名:总金额 * 变量名:total_amount * 是否必填:是 * 类型:int * 描述: * 品牌红包金额单位为“分” * 示例值:10000 * </pre> */ @SerializedName("total_amount") private Integer totalAmount; /** * <pre> * 字段名:总笔数 * 变量名:total_num * 是否必填:是 * 类型:int * 描述: * 一个品牌红包批次单最多发送10笔品牌红包明细。品牌红包总笔数必须与批次内所有品牌红包明细之和保持一致,否则无法发送品牌红包 * 示例值:10 * </pre> */ @SerializedName("total_num") private Integer totalNum; /** * <pre> * 字段名:品牌红包批次创建时间 * 变量名:create_time * 是否必填:是 * 类型:string[1, 32] * 描述: * 品牌红包批次受理成功时返回,遵循rfc3339标准格式, * 格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。 * 例如:2015-05-20T13:29:35+08:00表示北京时间2015年05月20日13点29分35秒 * 示例值:2015-05-20T13:29:35+08:00 * </pre> */ @SerializedName("create_time") private String createTime; /** * <pre> * 字段名:品牌红包批次更新时间 * 变量名:update_time * 是否必填:是 * 类型:string[1, 32] * 描述: * 品牌红包批次最近一次状态变更时间,遵循rfc3339标准格式, * 格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。 * 例如:2015-05-20T13:29:35+08:00表示北京时间2015年05月20日13点29分35秒 * 示例值:2015-05-20T13:29:35+08:00 * </pre> */ @SerializedName("update_time") private String updateTime; /** * <pre> * 字段名:发放成功金额 * 变量名:success_amount * 是否必填:是 * 类型:int * 描述: * 品牌红包发放成功的金额,单位为“分”。当批次状态为“PROCESSING”(发送中)时,发放成功金额随时可能变化 * 示例值:5000 * </pre> */ @SerializedName("success_amount") private Integer successAmount; /** * <pre> * 字段名:发放成功笔数 * 变量名:success_num * 是否必填:是 * 类型:int * 描述: * 品牌红包发放成功的笔数。当批次状态为“PROCESSING”(发放中)时,发放成功笔数随时可能变化 * 示例值:10 * </pre> */ @SerializedName("success_num") private Integer successNum; /** * <pre> * 字段名:发放失败金额 * 变量名:fail_amount * 是否必填:是 * 类型:int * 描述: * 品牌红包发放失败的金额,单位为“分” * 示例值:5000 * </pre> */ @SerializedName("fail_amount") private Integer failAmount; /** * <pre> * 字段名:发放失败笔数 * 变量名:fail_num * 是否必填:是 * 类型:int * 描述: * 品牌红包发放失败的笔数 * 示例值:10 * </pre> */ @SerializedName("fail_num") private Integer failNum; /** * <pre> * 字段名:品牌红包明细列表 * 变量名:detail_list * 是否必填:否 * 类型:array * 描述: * 当批次状态为“FINISHED”(已完成),且成功查询到品牌红包明细单时返回。包括微信支付品牌红包明细单号、明细状态信息 * </pre> */ @SpecEncrypt @SerializedName("detail_list") private List<BrandDetailResult> detailList; @Data @Accessors(chain = true) public static class BrandDetailResult implements Serializable { /** * <pre> * 字段名:微信支付品牌红包明细单号 * 变量名:transfer_detail_no * 是否必填:是 * 类型:string[32, 64] * 描述: * 微信支付系统内部区分品牌红包批次单下不同品牌红包明细单的唯一标识 * 示例值:1220000071100999991182020050700019500100 * </pre> */ @SerializedName("transfer_detail_no") private String transferDetailNo; /** * <pre> * 字段名:商家品牌红包明细单号 * 变量名:out_detail_no * 是否必填:是 * 类型:string[1, 32] * 描述: * 品牌商户系统内部区分品牌红包批次单下不同品牌红包明细单的唯一标识,要求此参数只能由数字、大小写字母组成 * 示例值:x23zy545Bd5436 * </pre> */ @SerializedName("out_detail_no") private String outDetailNo; /** * <pre> * 字段名:品牌红包明细单状态 * 变量名:detail_state * 是否必填:是 * 类型:string[1, 64] * 描述: * 品牌红包明细单的状态 * DETAIL_PROCESSING - 发送中,正在处理中,品牌红包发送结果尚未明确 * DETAIL_SUCCESS - 发送成功,发送成功 * DETAIL_FAIL - 发送失败,需要确认失败原因后,再决定是否重新对该笔品牌红包明细单进行发送(并非整个品牌红包批次单) * 示例值:DETAIL_SUCCESS * </pre> */ @SerializedName("detail_state") private String detailState; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/request/BrandMerchantDetailsQueryRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/request/BrandMerchantDetailsQueryRequest.java
package com.github.binarywang.wxpay.bean.brandmerchanttransfer.request; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * 品牌红包商家明细单号查询明细单API参数 * * @author moran */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class BrandMerchantDetailsQueryRequest implements Serializable { private static final long serialVersionUID = 1L; /** * <pre> * 字段名:商家品牌红包批次单号 * 变量名:out_batch_no * 是否必填:是 * 类型:string[5, 32] * 描述: * path商户系统内部的商家品牌红包批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 * 示例值:plfk2020042013 * </pre> */ @SerializedName("out_batch_no") private String outBatchNo; /** * <pre> * 字段名:商家品牌红包明细单号 * 变量名:out_detail_no * 是否必填:是 * 类型:string[5, 32] * 描述: * path商户系统内部区分品牌红包批次单下不同品牌红包明细单的唯一标识,要求此参数只能由数字、大小写字母组成 * 示例值:x23zy545Bd5436 * </pre> */ @SerializedName("out_detail_no") private String outDetailNo; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/request/BrandMerchantBatchesQueryRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/request/BrandMerchantBatchesQueryRequest.java
package com.github.binarywang.wxpay.bean.brandmerchanttransfer.request; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * 品牌红包商家批次单号查询批次单API参数 * * @author moran */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class BrandMerchantBatchesQueryRequest implements Serializable { private static final long serialVersionUID = 1L; /** * <pre> * 字段名:商家品牌红包批次单号 * 变量名:out_batch_no * 是否必填:是 * 类型:string[1, 32] * 描述: * path商户系统内部的商家品牌红包批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 * 示例值:plfk2020042013 * </pre> */ @SerializedName("out_batch_no") private String outBatchNo; /** * <pre> * 字段名:是否需要查询品牌红包明细单 * 变量名:need_query_detail * 是否必填:否 * 类型:boolean * 描述: * query枚举值: * true:是; * false:否,默认否。 * 商户可选择是否查询指定状态的品牌红包明细单,当品牌红包批次单状态为“FINISHED”(已完成)时,才会返回满足条件的品牌红包明细单 * </pre> */ @SerializedName("need_query_detail") private Boolean needQueryDetail; /** * <pre> * 字段名:品牌红包明细单状态 * 变量名:detail_state * 是否必填:否 * 类型:string * 描述: * query查询指定状态的品牌红包明细单信息 * DETAIL_VIEW_ALL - 全部,需要同时查询发送成功和发送失败的品牌红包明细单 * DETAIL_VIEW_SUCCESS - 发送成功,只查询发送成功的品牌红包明细单 * DETAIL_VIEW_FAIL - 发送失败,只查询发送失败的品牌红包明细单 * 示例值:DETAIL_VIEW_FAIL * </pre> */ @SerializedName("detail_state") private String detailState; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/request/BrandWxBatchesQueryRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/request/BrandWxBatchesQueryRequest.java
package com.github.binarywang.wxpay.bean.brandmerchanttransfer.request; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * 品牌红包微信支付批次单号查询批次单API参数 * * @author moran */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class BrandWxBatchesQueryRequest implements Serializable { private static final long serialVersionUID = 1L; /** * <pre> * 字段名:微信支付品牌红包批次单号 * 变量名:batch_no * 是否必填:是 * 类型:string[32, 64] * 描述: * path微信支付品牌红包批次单号,微信商家品牌红包系统返回的唯一标识 * 示例值:1030000071100999991182020050700019480001 * </pre> */ @SerializedName("batch_no") private String batchNo; /** * <pre> * 字段名:是否需要查询品牌红包明细单 * 变量名:need_query_detail * 是否必填:是 * 类型:boolean * 描述: * query枚举值: * true:是; * false:否,默认否。 * 商户可选择是否查询指定状态的品牌红包明细单,当品牌红包批次单状态为“FINISHED”(已完成)时,才会返回满足条件的品牌红包明细单 * 示例值:true * </pre> */ @SerializedName("need_query_detail") private Boolean needQueryDetail; /** * <pre> * 字段名:品牌红包明细单状态 * 变量名:detail_status * 是否必填:否 * 类型:string[1,32] * 描述: * query查询指定状态的品牌红包明细单信息 * DETAIL_VIEW_ALL - 全部,需要同时查询发送成功和发送失败的品牌红包明细单 * DETAIL_VIEW_SUCCESS - 发送成功,只查询发送成功的品牌红包明细单 * DETAIL_VIEW_FAIL - 发送失败,只查询发送失败的品牌红包明细单 * 示例值:DETAIL_VIEW_FAIL * </pre> */ @SerializedName("detail_state") private String detailState; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/request/BrandTransferBatchesRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/request/BrandTransferBatchesRequest.java
package com.github.binarywang.wxpay.bean.brandmerchanttransfer.request; import com.github.binarywang.wxpay.v3.SpecEncrypt; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; /** * 发起品牌红包商家转账API参数 * * @author moran **/ @Data @Builder(builderMethodName = "newBuilder") @NoArgsConstructor @AllArgsConstructor public class BrandTransferBatchesRequest implements Serializable { private static final long serialVersionUID = 1L; /** * <pre> * 字段名:品牌ID * 变量名:brand_id * 是否必填:是 * 类型:int * 描述: * body品牌在微信支付进行品牌认证后的唯一标识品牌ID * 示例值:1234 * </pre> */ @SerializedName("brand_id") private Integer brandId; /** * <pre> * 字段名:品牌AppID * 变量名:brand_appid * 是否必填:是 * 类型:string[1, 32] * 描述: * body品牌商户在微信申请公众号/小程序或移动应用成功后分配的账号ID,需与品牌有绑定关系,使用品牌的AppID时需要填写 * 示例值:wxf636efh567hg4356 * </pre> */ @SerializedName("brand_appid") private String brandAppid; /** * <pre> * 字段名:品牌红包发放场景 * 变量名:scene * 是否必填:是 * 类型:string * 描述: * body品牌红包发放场景,用户可以在指定的场景领取到红包 * CUSTOM_SEND - 自定义发放场景,自定义场景发放红包,使用已配置的自定义发放模板进行发红包 * 示例值:CUSTOM_SEND * </pre> */ @SerializedName("scene") private String scene; /** * <pre> * 字段名:品牌红包模板ID * 变量名:template_id * 是否必填:是 * 类型:string[1, 128] * 描述: * body品牌主配置的品牌红包模板ID * 示例值:123400001 * </pre> */ @SerializedName("template_id") private String templateId; /** * <pre> * 字段名:商家品牌红包批次单号 * 变量名:out_batch_no * 是否必填:是 * 类型:string[5, 32] * 描述: * body品牌商户系统内部的品牌红包批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 * 示例值:plfk2020042013 * </pre> */ @SerializedName("out_batch_no") private String outBatchNo; /** * <pre> * 字段名:品牌红包批次名称 * 变量名:batch_name * 是否必填:是 * 类型:string[1, 32] * 描述: * body该品牌红包批次的名称,展示在用户红包领取通知的红包活动名称 * 示例值:双十一营销用品牌红包 * </pre> */ @SerializedName("batch_name") private String batchName; /** * <pre> * 字段名:品牌红包批次备注 * 变量名:batch_remark * 是否必填:是 * 类型:string[1, 32] * 描述: * body该批次品牌红包的备注,仅用于品牌商户内部管理 * 示例值:双十一营销用品牌红包 * </pre> */ @SerializedName("batch_remark") private String batchRemark; /** * <pre> * 字段名:总金额 * 变量名:total_amount * 是否必填:是 * 类型:int * 描述: * body品牌红包总金额必须与品牌红包批次内所有品牌红包明细发送金额之和保持一致,否则无法发送品牌红包 * 示例值:10000 * </pre> */ @SerializedName("total_amount") private Integer totalAmount; /** * <pre> * 字段名:总笔数 * 变量名:total_num * 是否必填:是 * 类型:int * 描述: * body一个品牌红包批次单最多发送10笔品牌红包明细。品牌红包总笔数必须与批次内所有品牌红包明细之和保持一致,否则无法发送品牌红包 * 示例值:10 * </pre> */ @SerializedName("total_num") private Integer totalNum; /** * <pre> * 字段名:品牌红包明细列表 * 变量名:detail_list * 是否必填:否 * 类型:array * 描述: * body品牌红包明细列表,最多10笔 * </pre> */ @SpecEncrypt @SerializedName("detail_list") private List<BrandTransferDetail> detailList; @Data @Builder(builderMethodName = "newBuilder") @AllArgsConstructor @NoArgsConstructor public static class BrandTransferDetail { /** * <pre> * 字段名:商家品牌红包明细单号 * 变量名:out_detail_no * 是否必填:是 * 类型:string[1, 32] * 描述: * 品牌商户系统内部区分品牌红包批次单下不同品牌红包明细单的唯一标识,要求此参数只能由数字、大小写字母组成 * 示例值:x23zy545Bd5436 * </pre> */ @SerializedName("out_detail_no") private String outDetailNo; /** * <pre> * 字段名:红包金额(单位:分) * 变量名:amount * 是否必填:是 * 类型:int * 描述: * 红包金额单位为“分”,红包金额的最大限额取决于商户在商户平台的设置额度 * 示例值:100 * </pre> */ @SerializedName("amount") private Integer amount; /** * <pre> * 字段名:接收红包用户OpenID * 变量名:openid * 是否必填:是 * 类型:string[1, 64] * 描述: * 接收红包的用户OpenID,该OpenID为用户在上方指定的AppID下的唯一标识。 * 注:openid是微信用户在公众号appid下的唯一用户标识(appid不同,则获取到的openid就不同),可用于永久标记一个用户。 * 获取openid:https://pay.weixin.qq.com/wiki/doc/apiv3/terms_definition/chapter1_1_3.shtml * 示例值:o-MYE42l80oelYMDE34nYD456Xoy * </pre> */ @SerializedName("openid") private String openid; /** * <pre> * 字段名:接收红包用户姓名 * 变量名:user_name * 是否必填:否 * 类型:string[1, 1024] * 描述: * 1、明细转账金额 >= 2,000,收款用户姓名必填; * 2、同一批次转账明细中,收款用户姓名字段需全部填写、或全部不填写; * 3、若传入收款用户姓名,微信支付会校验用户OpenID与姓名是否一致,并提供电子回单; * 4、收款方姓名。采用标准RSA算法,公钥由微信侧提供 * 5、该字段需进行加密处理,加密方法详见敏感信息加密说明。(提醒:必须在HTTP头中上送Wechatpay-Serial) * 示例值:757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45 * </pre> */ @SpecEncrypt @SerializedName("user_name") private String userName; /** * <pre> * 字段名:红包备注 * 变量名:remark * 是否必填:是 * 类型:string[1, 32] * 描述: * 单个红包备注,会展示在客户端收款凭证的“红包说明”字段,UTF8编码,最多允许32个字符 * 示例值:来自XX的红包 * </pre> */ @SerializedName("remark") private String remark; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/request/BrandWxDetailsQueryRequest.java
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandmerchanttransfer/request/BrandWxDetailsQueryRequest.java
package com.github.binarywang.wxpay.bean.brandmerchanttransfer.request; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * 品牌红包微信支付明细单号查询明细单API参数 * * @author moran */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class BrandWxDetailsQueryRequest implements Serializable { private static final long serialVersionUID = 1L; /** * <pre> * 字段名:微信支付品牌红包批次单号 * 变量名:batch_no * 是否必填:是 * 类型:string[32, 64] * 描述: * path微信支付品牌红包批次单号,微信商家品牌红包系统返回的唯一标识 * 示例值:1030000071100999991182020050700019480001 * </pre> */ @SerializedName("batch_no") private String batchNo; /** * <pre> * 字段名:微信明细单号 * 变量名:detail_no * 是否必填:是 * 类型:string[32, 64] * 描述: * path微信支付系统内部区分品牌红包批次单下不同品牌红包明细单的唯一标识 * 示例值:1040000071100999991182020050700019500100 * </pre> */ @SerializedName("detail_no") private String detailNo; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false