Skip to content

获取已设置的消息通知地址

用于查询已经设置的接收营销事件通知的URL。

请求参数类型描述
queryobject声明请求的查询参数
mchidstring商户号
php
$instance->v3->marketing->favor->callbacks->getAsync([
  'query' => [
    'mchid' => '9856888',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/favor/callbacks')->getAsync([
  'query' => [
    'mchid' => '9856888',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/favor/callbacks']->getAsync([
  'query' => [
    'mchid' => '9856888',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->favor->callbacks->get([
  'query' => [
    'mchid' => '9856888',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/favor/callbacks')->get([
  'query' => [
    'mchid' => '9856888',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/favor/callbacks']->get([
  'query' => [
    'mchid' => '9856888',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
mchidstring商户号
notify_urlstring通知地址

参阅 官方文档

设置消息通知地址

用于设置接收营销事件通知的URL,可接收营销相关的事件通知,包括核销、发放、退款等。

请求参数类型描述
jsonobject声明请求的JSON数据结构
mchidstring商户号
notify_urlstring通知url地址
switchboolean回调开关
php
$instance->v3->marketing->favor->callbacks->postAsync([
  'json' => [
    'mchid' => '9856888',
    'notify_url' => 'https://pay.weixin.qq.com',
    'switch' => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/favor/callbacks')->postAsync([
  'json' => [
    'mchid' => '9856888',
    'notify_url' => 'https://pay.weixin.qq.com',
    'switch' => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/favor/callbacks']->postAsync([
  'json' => [
    'mchid' => '9856888',
    'notify_url' => 'https://pay.weixin.qq.com',
    'switch' => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->favor->callbacks->post([
  'json' => [
    'mchid' => '9856888',
    'notify_url' => 'https://pay.weixin.qq.com',
    'switch' => true,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/favor/callbacks')->post([
  'json' => [
    'mchid' => '9856888',
    'notify_url' => 'https://pay.weixin.qq.com',
    'switch' => true,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/favor/callbacks']->post([
  'json' => [
    'mchid' => '9856888',
    'notify_url' => 'https://pay.weixin.qq.com',
    'switch' => true,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
update_timestring修改时间
notify_urlstring通知地址

参阅 官方文档

Published on the GitHub by TheNorthMemory