微信代金券–创建代金券批次
https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter9_1_1.shtml
//创建代金券批次
include "WePaySign/WeChatPaySign.php";
$available_begin_time = date("Y-m-d\TH:i:s",strtotime('+3 minutes')).'.120+08:00';
$out_request_no = "4546".time().rand(0,100);
$mchid = "";
$serialNo = "49D0157AB9EC13DCBFE13944206968E1E66027F5";
$timeStamp = time();
$nonceStr = generateNonceStr();
$method = "POST";
$canonicalUrl = "/v3/marketing/favor/coupon-stocks";
$url = "https://api.mch.weixin.qq.com/v3/marketing/favor/coupon-stocks";
//参数
$coupon_amount = 99;
$max_coupons = 100;
$max_amount = $coupon_amount * $max_coupons;
$temple = array(
"stock_name"=>"微信支付代金券批次",
"comment"=>"全场券",
"belong_merchant"=>"1602968454",
"available_begin_time"=>"$available_begin_time",
"available_end_time"=>"2021-05-02T13:29:35.120+08:00",
"stock_use_rule"=>array(
"max_coupons"=>$max_coupons,
"max_amount"=>$max_amount,
"max_coupons_per_user"=>1,
"natural_person_limit"=>false,
"prevent_api_abuse"=>false
),
"pattern_info"=>array