创建微信卡券 php
public function createCoupon()
{
$data['card_type'] = $this->input->post_get('card_type');//代金券、兑换券、优惠券、折扣券
$data['brand_name'] = $this->input->post_get('brand_name');//商户名字
$data['title'] = $this->input->post_get('title');//卡券名
$data['color'] = $this->input->post_get('color');//卡券颜色
$data['notice'] = $this->input->post_get('notice');//操作提示
$data['service_phone'] = $this->input->post_get('service_phone');//客服电话
$data['description'] = $this->input->post_get('description');//使用须知
$data['begin_timestamp'] = $this->input->post_get('begin_timestamp');//开始时间
$data['end_timestamp'] = $this->input->post_get('end_timestamp');//结束时间
$data['fixed_term'] = $this->input->post_get('fixed_term');//表示自领取后多少天内有效
$data['location_id_list'] = $this->input->post_get('location_id_list');//门店id
// $data['use_limit'] = $this->input->post_get('use_limit');//每人可领券的数量限制,不填写默认为50
// $data['get_limit'] = $this->input->post_get('get_limit');//每人可核销的数量限制,不填写默认为50
// $data['can_share'] = $this->input->post_get('can_share');//卡券领取页面是否可分享
// $data['can_give_friend'] = $this->input->post_get('can_give_friend');//卡券是否可转赠
// $data['quantity'] = $this->input->post_get('quantity');//库存多少张
$res = $this->couponDo($data);
var_dump($res);
}
public function couponDo($data)
{
$array = array(
"card" => array(
"card_type" => $data['card_type'],
strtolower($data['card_type']) => array( //用传过来的卡券类型当键 必须是小写
"base_info" => array(
"logo_url" => "", //已经上传过的logo url
"code_type" => 'CODE_TYPE_QRCODE',
"brand_name" => $data['brand_name'],
"title" => $data['title'],
"color" => $data['color'],
"notice" => $data['notice'],
"description" => $data['description'],
"sku" => array("quantity" => 0), //自定义code码为0
"date_info" => array(
"type" => 'DATE_TYPE_FIX_TIME_RANGE',
"begin_timestamp" => $data['begin_timestamp'],
"end_timestamp" => $data['end_timestamp'],
"fixed_term" => $data['fixed_term'],
"fixed_begin_term" => 0
),
"service_phone" => $data['service_phone'],
"location_id_list" => [$data['location_id_list']],
"use_limit" => 1,
"get_limit" => 1,
"use_custom_code" => true, //自定义code码为true
"bind_openid" => false,
"can_share" => true,
"can_give_friend" => true,
"get_custom_code_mode" => "GET_CUSTOM_CODE_MODE_DEPOSIT" //自定义code码
),
// "least_cost" => 0, //满多少可用 单位 分
// "reduce_cost" => 50000, //减多少
)
)
);
$url = "https://api.weixin.qq.com/card/create?access_token=" . $this->token;
return curl_post($url, json_encode($array, JSON_UNESCAPED_UNICODE));
}
创建微信卡券 php相关推荐
- 【微信公众平台对接】有关【创建发票卡券模板】调用示例
1.微信开放平台接口说明: 2.代码示例 /*** 创建发票卡券模板** @param token* @return*/@PostMapping("createCard")publ ...
- 【实战教程】使用知晓云完成微信卡券消息的处理
知晓云新推出「消息推送」功能,该功能通过「消息推送」类型的触发器接收微信推送过来的消息,开发者可以对此消息实行相关操作. 此教程将带领大家体验这个新功能,实现一个「微信消息推送」类型的触发器. 该触发 ...
- 第三期:如何通过知晓云处理微信卡券消息
作者:知晓云 - 小程序开发快人一步 来源:知晓课堂 知晓云新推出「消息推送」功能,该功能通过「消息推送」类型的触发器接收微信推送过来的消息,开发者可以对此消息实行相关操作. 此教程将带领大家体验这个 ...
- 微信商业闭环谈论之微信开放平台实现微信卡券投放实践(附部分JAVA源码)
一.微信卡券及现状 先认识几个概念:微信开放平台.公众号第三方平台和微信公众平台开发者模式. 微信开放平台:简单的说,是用于微信生态平台,该平台提供各种接口,第三方App通过接口接入微信登录.微信分享 ...
- 微信卡券之众多坑总结(Java)---优惠券
1.建议一个字一个字读微信文档,从头到尾,不要只看卡券那一栏 https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Rede ...
- 微信卡券 java_微信小程序领取卡券(java)
最近做了个领取微信卡券的小程序,看了很多文档资料以及花了很多时间才算搞定的,不过也算是好事多磨,这边记录分享一下,也算给一点提升. 一.开发前准备 1:申请微信公众号 和 微信小程序,这是两个不同的东 ...
- PHP创建微信代金券流程
创建微信代金券接口文档地址 https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/marketing/convention/chapter3_1.shtml 注 ...
- 会员卡系统接入微信卡券那些事儿
前言 在中国日常生活中,微信使用的频率以及占用的时长最多.东家有自己的会员卡系统,在移动互联网时代,线下门店使用还需客户拿着物理会员卡太不方便了,于是接入微信卡券提上了计划的日程.在接入的过程中,碰到 ...
- 卡包 php,微信卡券,在卡包中跳转到小程序的字段怎么填写
期望实现的功能微信卡券领取到卡包之后,点立即兑换按钮跳转到小程序 这是官方文档的说明: 卡券内跳转小程序 场景介绍 商户创建卡券时可以将卡.券内的服务入口设置进入小程序服务. 步骤 1.开发者须将小程 ...
- 微信卡券跳转小程序遇到的小坑
作者: 苍茫小一关注 需求背景 在2019年8月13日之前,微信卡包里的卡券都是跳转到对应公众号的页面,但是在2019年7月26日时,微信发布通告:微信卡券"网页链接跳转"能力即将 ...
最新文章
- Failed to resolve:com.android.support:appcompat-v7:27.+
- 公示 | 清华大学大数据研究中心“RONG”奖学金获奖名单
- 深圳python培训比较好的机构-深圳十大python培训机构排名
- laravel 队列queue
- flot中文API(转载)
- [Bootstrap-插件使用]Jcrop+fileinput组合实现头像上传功能
- java char指针数组_sizeof与strlen使用,字符串指针数组
- ActiveMQ在windows下启动失败解决方案
- Given two binary trees, write a function to check if they areequal or not.
- Linux 内核版本命名
- 无线接口配置 DHCP配置
- 有哪些方法下载外文文献?
- 输入两个正整数num1、num2,计算并输出它们的和、差、积、整数商和余数
- 项目成功关键要素和项目成功关键要素
- 芯动联科在科创板IPO过会:拟募资10亿元,金晓冬为实际控制人
- 数据挖掘-朴素贝叶斯算法
- 用手写板向计算机输入汉字是什么技术,使用手写板输入文字的简单介绍
- 什么是 Ubuntu?
- 金属有机骨架mof载药|阿霉素药物载体La/Tm-MOFs@SiO复合材料|PCN-224负载环丙沙星
- 基于JAVA校园疫情防控系统(Springboot框架) 开题报告