支付宝的卡券使用,如果是与开发无关,那模板创建可以直接访问
https://alipassprod.alipay.com/builder/myAlipassIndex.htm
进行手动创建。当然今天我们要说的是,支付宝接口的卡券创建与使用。
1. 添加卡券模板
/*
* @todo: 组装基础卡券信息
*/
private function returnEvoucherInfo(){
$evoucherInfo = array();
$evoucherInfo["goodsId"] = '$goodsId$';
$evoucherInfo["title"] = '$discount_title$'; # 显示标题
$evoucherInfo["type"] = "coupon"; # 卡券类型
$evoucherInfo["product"] = "free"; # 产品类型
$evoucherInfo["startDate"] = '$startDate$'; # 有效期开始时间
$evoucherInfo["endDate"] = '$endDate$'; # 有效期结束时间
$evoucherInfo["operation"] = array( # 操作区域字段 轮播图区
array(
"format"=> "qrcode", # qrcode img url wave 声波 text barcode
"message"=> '$qrcode$',
"messageEncoding"=> "utf-8",
"altText"=> "核销码",
)
);
$einfo = array();
$einfo['logoText'] ='$discount_title$'; # 优惠标题
$einfo['secondLogoText'] = "第二标题"; # 第二个 logo 文字
$einfo['headFields'] = array( # 头部区域字段
array(
"key" => "discount_name",
"label"=> "优惠内容:",
"value"=> '$discount_name$',
"type"=> "text"
)
);
$einfo['primaryFields'] = array(
array(
"key" => "discount_name",
"label"=> "首先区块:",
"value"=> '$discount_name$',
"type"=> "text"
)
);
$einfo['secondaryFields'] = array(
array(
"key" => "discount_name",
"label"=> "其次区块:",
"value"=> '$discount_name$',
"type"=> "text"
)
);
$einfo['auxiliaryFields'] = array(
array(
"key" => "discount_desc",
"label" => "优惠说明 :",
"value" => '$discount_desc$',
"type" => "text"
)
);
# 这里是 详情
$einfo['backFields'] = array(
array(
"key"=> "description",
"label"=> "详情描述",
"value"=> "1.该优惠有效期:截止至2017年06月18日;\n2.凭此券可以享受以下优惠:\n享门市价优惠\n不与其他优惠同享。详