package com.zhiwei.weixin.card;

import net.sf.json.JSONObject;

import com.zhiwei.weixin.accesstoken.CreatAccessToken;
import com.zhiwei.weixin.http.HttpRequest;
import com.zhiwei.weixin.pojo.AccessToken;
import com.zhiwei.weixin.util.WeixinUtil;

/** 
 * @Package com.zhiwei.weixin.industry

 * @ClassName: CheckTickets

 * @Description: TODO(查看卡卷详情)

 * @author 志伟

 * @date 2015-3-27 下午10:09:54

 */
public class CheckCard {

	 // 第三方用户唯一凭证  
//    String appId = "wx7d6a533ed451e07e";     //wx22554dc3322ec3f1(数据洞察帐号) 
//    // 第三方用户唯一凭证密钥  
//    String appSecret = "217b1d655755033d74cb1fc27636288f";   //49a0abfc4507e90e6cab812414f005fb（数据洞察帐号）
    
    //
    public static String check_url = "https://api.weixin.qq.com/card/get?access_token=ACCESS_TOKEN";
    // 调用接口获取access_token  
    private static String token;
    
	public CheckCard() 
	{
		token = new CreatAccessToken().getAccessToken();
	}
	
	public  void check()
	{
		String url = check_url.replace("ACCESS_TOKEN", token);
		JSONObject json = new JSONObject();
		json.put("card_id","p_Vmbjs0WI73ZfC7PuKFg8Y_8qvs");
		
		JSONObject jsonObject = HttpRequest.httpRequest(url, "POST", json.toString());
		JSONObject info = jsonObject.getJSONObject("card").getJSONObject("meeting_ticket").getJSONObject("base_info");
		System.out.println(info.get("sku"));
	}
	
	public static void main(String[] args)
	{
		new CheckCard().check();
	}

}
