mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-11-01 03:25:35 +08:00 
			
		
		
		
	🆕 #1305 增加商户开电子发票功能
This commit is contained in:
		| @ -1,13 +1,5 @@ | |||||||
| package me.chanjar.weixin.mp.bean.message; | package me.chanjar.weixin.mp.bean.message; | ||||||
|  |  | ||||||
| import java.io.IOException; |  | ||||||
| import java.io.InputStream; |  | ||||||
| import java.io.Serializable; |  | ||||||
| import java.nio.charset.StandardCharsets; |  | ||||||
| import java.util.Map; |  | ||||||
|  |  | ||||||
| import org.apache.commons.io.IOUtils; |  | ||||||
|  |  | ||||||
| import com.thoughtworks.xstream.annotations.XStreamAlias; | import com.thoughtworks.xstream.annotations.XStreamAlias; | ||||||
| import com.thoughtworks.xstream.annotations.XStreamConverter; | import com.thoughtworks.xstream.annotations.XStreamConverter; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| @ -19,6 +11,13 @@ import me.chanjar.weixin.mp.config.WxMpConfigStorage; | |||||||
| import me.chanjar.weixin.mp.util.crypto.WxMpCryptUtil; | import me.chanjar.weixin.mp.util.crypto.WxMpCryptUtil; | ||||||
| import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; | import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; | ||||||
| import me.chanjar.weixin.mp.util.xml.XStreamTransformer; | import me.chanjar.weixin.mp.util.xml.XStreamTransformer; | ||||||
|  | import org.apache.commons.io.IOUtils; | ||||||
|  |  | ||||||
|  | import java.io.IOException; | ||||||
|  | import java.io.InputStream; | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.nio.charset.StandardCharsets; | ||||||
|  | import java.util.Map; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * <pre> |  * <pre> | ||||||
| @ -645,6 +644,44 @@ public class WxMpXmlMessage implements Serializable { | |||||||
|   @XStreamAlias("bizmsgmenuid") |   @XStreamAlias("bizmsgmenuid") | ||||||
|   private String bizMsgMenuId; |   private String bizMsgMenuId; | ||||||
|  |  | ||||||
|  |   /*------------------ 电子发票 ------------------*/ | ||||||
|  |   /** | ||||||
|  |    * 授权成功的订单号,与失败订单号两者必显示其一 | ||||||
|  |    */ | ||||||
|  |   @XStreamAlias("SuccOrderId") | ||||||
|  |   private String succOrderId; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 授权失败的订单号,与成功订单号两者必显示其一 | ||||||
|  |    */ | ||||||
|  |   @XStreamAlias("FailOrderId") | ||||||
|  |   private String failOrderId; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 获取授权页链接的AppId | ||||||
|  |    */ | ||||||
|  |   @XStreamAlias("AuthorizeAppId") | ||||||
|  |   private String authorizeAppId; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 授权来源,web:公众号开票,app:app开票,wxa:小程序开票,wap:h5开票 | ||||||
|  |    */ | ||||||
|  |   @XStreamAlias("source") | ||||||
|  |   private String source; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 发票请求流水号,唯一识别发票请求的流水号 | ||||||
|  |    */ | ||||||
|  |   @XStreamAlias("fpqqlsh") | ||||||
|  |   private String fpqqlsh; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 纳税人识别码 | ||||||
|  |    */ | ||||||
|  |   @XStreamAlias("nsrsbh") | ||||||
|  |   private String nsrsbh; | ||||||
|  |  | ||||||
|  |  | ||||||
|   public static WxMpXmlMessage fromXml(String xml) { |   public static WxMpXmlMessage fromXml(String xml) { | ||||||
|     //修改微信变态的消息内容格式,方便解析 |     //修改微信变态的消息内容格式,方便解析 | ||||||
|     xml = xml.replace("</PicList><PicList>", ""); |     xml = xml.replace("</PicList><PicList>", ""); | ||||||
|  | |||||||
| @ -126,4 +126,19 @@ public class WxMpEventConstants { | |||||||
|     public static final String VERIFY_EXPIRED = "verify_expired"; |     public static final String VERIFY_EXPIRED = "verify_expired"; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 电子发票. | ||||||
|  |    */ | ||||||
|  |   public static class Invoice { | ||||||
|  |     /** | ||||||
|  |      * 用户授权事件. | ||||||
|  |      */ | ||||||
|  |     public static final String USER_AUTHORIZE_INVOICE = "user_authorize_invoice"; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 统一开票接口-异步通知开票结果. | ||||||
|  |      */ | ||||||
|  |     public static final String CLOUD_INVOICE_INVOICERESULT_EVENT = "cloud_invoice_invoiceresult_event"; | ||||||
|  |   } | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Mario Luo
					Mario Luo