
org.jeewx.api.coupon.qrcode.JwQrcodeAPI Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jeewx-api Show documentation
Show all versions of jeewx-api Show documentation
JEEWX-API(微信极速SDK、同时支持微信公众号\企业微信\支付窗\小程序\微博).
The newest version!
package org.jeewx.api.coupon.qrcode;
import net.sf.json.JSONObject;
import org.jeewx.api.core.exception.WexinReqException;
import org.jeewx.api.core.req.WeiXinReqService;
import org.jeewx.api.coupon.qrcode.model.Getticket;
import org.jeewx.api.coupon.qrcode.model.GetticketRtn;
import org.jeewx.api.coupon.qrcode.model.QrcodeInfo;
import org.jeewx.api.coupon.qrcode.model.QrcodeRtnInfo;
/**
* 微信卡券 - 卡券投放
* @author lihongxuan
*
*/
public class JwQrcodeAPI {
/**
* 创建二维码
* @throws WexinReqException
*/
public static QrcodeRtnInfo doAddQrcode(String accesstoken,QrcodeInfo qrcodeInfo) throws WexinReqException {
if (accesstoken != null) {
qrcodeInfo.setAccess_token(accesstoken);
JSONObject result = WeiXinReqService.getInstance().doWeinxinReqJson(qrcodeInfo);
QrcodeRtnInfo qrcodeRtnInfo = (QrcodeRtnInfo)JSONObject.toBean(result, QrcodeRtnInfo.class);
return qrcodeRtnInfo;
}
return null;
}
/**
* 获取api_ticket
*/
public static GetticketRtn doGetticket(String accesstoken)throws WexinReqException {
if (accesstoken != null) {
Getticket gk = new Getticket();
gk.setAccess_token(accesstoken);
JSONObject result = WeiXinReqService.getInstance().doWeinxinReqJson(gk);
GetticketRtn getticketRtn = (GetticketRtn)JSONObject.toBean(result, GetticketRtn.class);
return getticketRtn;
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy