视频一区二区三区自拍_千金肉奴隷1985未删减版在线观看_国产成人黄色视频在线播放_少女免费播放片高清在线观看_国产精品v欧美精品v

商戶進(jìn)件
特約商戶進(jìn)件
基礎(chǔ)支付
JSAPI支付
APP支付
H5支付
Native支付
小程序支付
合單支付
付款碼支付
經(jīng)營能力
支付即服務(wù)
點(diǎn)金計(jì)劃
行業(yè)方案
平臺(tái)收付通
智慧商圈
微信支付分停車服務(wù)
電子發(fā)票
營銷工具
代金券
商家券
委托營銷
支付有禮
小程序發(fā)券插件
H5發(fā)券
圖片上傳(營銷專用)
現(xiàn)金紅包
資金應(yīng)用
分賬
連鎖品牌分賬
風(fēng)險(xiǎn)合規(guī)
商戶開戶意愿確認(rèn)
消費(fèi)者投訴2.0
商戶平臺(tái)處置通知
其他能力
圖片上傳
視頻上傳
微信支付平臺(tái)證書

支付有禮開發(fā)指引

1. 接口規(guī)則

為了在保證支付安全的前提下,帶給商戶簡單、一致且易用的開發(fā)體驗(yàn),我們推出了全新的微信支付APIv3接口。該版本API的具體規(guī)則請(qǐng)參考“APIv3接口規(guī)則

2. 開發(fā)準(zhǔn)備

2.1. 搭建和配置開發(fā)環(huán)境

為了幫助開發(fā)者調(diào)用開放接口,我們提供了JAVA、PHP、GO三種語言版本的開發(fā)庫,封裝了簽名生成、簽名驗(yàn)證、敏感信息加/解密、媒體文件上傳等基礎(chǔ)功能(更多語言版本的開發(fā)庫將在近期陸續(xù)提供

測試步驟

1、根據(jù)自身開發(fā)語言,選擇對(duì)應(yīng)的開發(fā)庫并構(gòu)建項(xiàng)目,具體配置請(qǐng)參考下面鏈接的詳細(xì)說明:

    ? wechatpay-java(推薦)wechatpay-apache-httpclient,適用于Java開發(fā)者。

    ? wechatpay-php(推薦)、wechatpay-guzzle-middleware,適用于PHP開發(fā)者

    注:當(dāng)前開發(fā)指引接口PHP示例代碼采用wechatpay-guzzle-middleware版本

    ? wechatpay-go,適用于Go開發(fā)者

更多資源可前往微信支付開發(fā)者社區(qū)搜索查看

2、創(chuàng)建加載商戶私鑰、加載平臺(tái)證書、初始化httpClient的通用方法


@Before
public void setup() throws IOException {
    // 加載商戶私鑰(privateKey:私鑰字符串)
    PrivateKey merchantPrivateKey = PemUtil
            .loadPrivateKey(new ByteArrayInputStream(privateKey.getBytes("utf-8")));
 
    // 加載平臺(tái)證書(mchId:商戶號(hào),mchSerialNo:商戶證書序列號(hào),apiV3Key:V3密鑰)
    AutoUpdateCertificatesVerifier verifier = new AutoUpdateCertificatesVerifier(
            new WechatPay2Credentials(mchId, new PrivateKeySigner(mchSerialNo, merchantPrivateKey)),apiV3Key.getBytes("utf-8"));
 
    // 初始化httpClient
    httpClient = WechatPayHttpClientBuilder.create()
            .withMerchant(mchId, mchSerialNo, merchantPrivateKey)
            .withValidator(new WechatPay2Validator(verifier)).build();
}
 
@After
public void after() throws IOException {
    httpClient.close();
}

use GuzzleHttp\Exception\RequestException;
use WechatPay\GuzzleMiddleware\WechatPayMiddleware;
use WechatPay\GuzzleMiddleware\Util\PemUtil;
use GuzzleHttp\HandlerStack;
 
// 商戶相關(guān)配置,
$merchantId = '1000100'; // 商戶號(hào)
$merchantSerialNumber = 'XXXXXXXXXX'; // 商戶API證書序列號(hào)
$merchantPrivateKey = PemUtil::loadPrivateKey('./path/to/mch/private/key.pem'); // 商戶私鑰文件路徑
 
// 微信支付平臺(tái)配置
$wechatpayCertificate = PemUtil::loadCertificate('./path/to/wechatpay/cert.pem'); // 微信支付平臺(tái)證書文件路徑
 
// 構(gòu)造一個(gè)WechatPayMiddleware
$wechatpayMiddleware = WechatPayMiddleware::builder()
    ->withMerchant($merchantId, $merchantSerialNumber, $merchantPrivateKey) // 傳入商戶相關(guān)配置
    ->withWechatPay([ $wechatpayCertificate ]) // 可傳入多個(gè)微信支付平臺(tái)證書,參數(shù)類型為array
    ->build();
 
// 將WechatPayMiddleware添加到Guzzle的HandlerStack中
$stack = GuzzleHttp\HandlerStack::create();
$stack->push($wechatpayMiddleware, 'wechatpay');
 
// 創(chuàng)建Guzzle HTTP Client時(shí),將HandlerStack傳入,接下來,正常使用Guzzle發(fā)起API請(qǐng)求,WechatPayMiddleware會(huì)自動(dòng)地處理簽名和驗(yàn)簽
$client = new GuzzleHttp\Client(['handler' => $stack]);

/*
    Package core 微信支付api v3 go http-client 基礎(chǔ)庫,你可以使用它來創(chuàng)建一個(gè)client,并向微信支付發(fā)送http請(qǐng)求
    只需要你在初始化客戶端的時(shí)候,傳遞credential以及validator
    credential用來生成http header中的authorization信息
    validator則用來校驗(yàn)回包是否被篡改
    如果http請(qǐng)求返回的err為nil,一般response.Body 都不為空,你可以嘗試對(duì)其進(jìn)行序列化
    請(qǐng)注意及時(shí)關(guān)閉response.Body
    注意:使用微信支付apiv3 go庫需要引入相關(guān)的包,該示例代碼必須引入的包名有以下信息

    "context"
    "crypto/x509"
    "fmt"
    "io/ioutil"
    "log"
    "github.com/wechatpay-apiv3/wechatpay-go/core"
    "github.com/wechatpay-apiv3/wechatpay-go/core/option"
    "github.com/wechatpay-apiv3/wechatpay-go/utils"

    */
func SetUp() (opt []option.ClientOption, err error) {
    //商戶號(hào)
    mchID := ""
    //商戶證書序列號(hào)
    mchCertSerialNumber := ""
    //商戶私鑰文件路徑
    privateKeyPath := ""
    //平臺(tái)證書文件路徑
    wechatCertificatePath := ""

    // 加載商戶私鑰
    privateKey, err := utils.LoadPrivateKeyWithPath(privateKeyPath)
    if err != nil {
        log.Printf("load private err:%s", err.Error())
        return nil, err
    }
    // 加載微信支付平臺(tái)證書
    wechatPayCertificate, err := utils.LoadCertificateWithPath(wechatCertificatePath)
    if err != nil {
        log.Printf("load certificate err:%s",err)
        return nil, err
    }
    //設(shè)置header頭中authorization信息
    opts := []option.ClientOption{
        option.WithMerchant(mchID, mchCertSerialNumber, privateKey), // 設(shè)置商戶相關(guān)配置
        option.WithWechatPay([]*x509.Certificate{wechatPayCertificate}), // 設(shè)置微信支付平臺(tái)證書,用于校驗(yàn)回包信息用
    }
    return opts, nil
}

3、基于接口的示例代碼,替換請(qǐng)求參數(shù)后可發(fā)起測試

說明:

? 上面的開發(fā)庫為微信支付官方開發(fā)庫,其它沒有審核或者控制下的第三方工具和庫,微信支付不保證它們的安全性和可靠性

通過包管理工具引入SDK后,可根據(jù)下面每個(gè)接口的示例代碼替換相關(guān)參數(shù)后進(jìn)行快速測試

? 開發(fā)者如果想詳細(xì)了解簽名生成、簽名驗(yàn)證、敏感信息加/解密、媒體文件上傳等常用方法的具體代碼實(shí)現(xiàn),可閱讀下面的詳細(xì)說明:

    1.簽名生成

    2.簽名驗(yàn)證

    3.敏感信息加解密

    4.merchantPrivateKey(私鑰)

    5.wechatpayCertificates(平臺(tái)證書)

    6.APIV3Key(V3 key)

? 如想更詳細(xì)的了解我們的接口規(guī)則,可查看我們的接口規(guī)則指引文檔

3. 快速接入

3.1. 業(yè)務(wù)流程圖

業(yè)務(wù)流程時(shí)序圖:

重點(diǎn)步驟說明:

步驟5 商戶創(chuàng)建商家券后,可通過創(chuàng)建全場滿額送活動(dòng)接口創(chuàng)建支付有禮活動(dòng),微信支付生成支付有禮活動(dòng)并返回活動(dòng)ID給到商戶。

步驟20 支付有禮活動(dòng)創(chuàng)建后,商戶可通過《查詢活動(dòng)詳情接口》查詢管理活動(dòng)。

步驟22 活動(dòng)創(chuàng)建后,如需結(jié)束活動(dòng),可通過《終止活動(dòng)》接口,結(jié)束活動(dòng)。

3.2. API接入(含示例代碼)

文檔展示了如何使用微信支付服務(wù)端 SDK 快速接入支付有禮,完成與微信支付對(duì)接的部分。

注意

  • 文檔中的代碼示例是用來闡述 API 基本使用方法,代碼中的示例參數(shù)需替換成商戶自己賬號(hào)及請(qǐng)求參數(shù)才能跑通
  • 以下接入步驟僅提供參考,請(qǐng)商戶結(jié)合自身業(yè)務(wù)需求進(jìn)行評(píng)估、修改。
3.2.1. 【服務(wù)端】創(chuàng)建全場滿額送活動(dòng)

步驟說明:服務(wù)商可以創(chuàng)建滿額送活動(dòng),用戶支付后送全場券,提升交易額。

示例代碼


public void CreateActivity() throws Exception{
    //請(qǐng)求URL
    HttpPost httpPost = new HttpPost("https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/unique-threshold-activity");
    // 請(qǐng)求body參數(shù)
    String reqdata = "{"
            + "\"activity_base_info\": {"
            + "\"activity_name\":\"良品鋪?zhàn)踊仞伝顒?dòng)\","
            + "\"activity_second_title\":\"海飛絲的券\","
            + "\"merchant_logo_url\":\"https://tool.oschina.net/regex.jpg\","
            + "\"background_color\":\"COLOR010\","
            + "\"begin_time\":\"2015-05-20T13:29:35+08:00\","
            + "\"end_time\":\"2015-05-20T13:29:35+08:00\","
            + "\"available_periods\": {"
            + "\"available_time\": ["
            + "{"
            + "\"begin_time\":\"2015-05-20T00:00:00+08:00\","
            + "\"end_time\":\"2015-05-20T23:59:59+08:00\""
            + "}"
            + "],"
            + "\"available_day_time\": ["
            + "{"
            + "\"begin_day_time\":\"110000\","
            + "\"end_day_time\":\"135959\""
            + "}"
            + "]"
            + "},"
            + "\"out_request_no\":\"100002322019090134234sfdf\","
            + "\"delivery_purpose\":\"OFF_LINE_PAY\","
            + "\"mini_programs_appid\":\"wx23232232323\","
            + "\"mini_programs_path\":\"/path/index/index\""
            + "},"
            + "\"award_send_rule\": {"
            + "\"transaction_amount_minimum\":100,"
            + "\"send_content\":\"SINGLE_COUPON\","
            + "\"award_type\":\"BUSIFAVOR\","
            + "\"award_list\": ["
            + "{"
            + "\"stock_id\":\"98065001\","
            + "\"original_image_url\":\"https://tool.oschina.net/regex.jpg\","
            + "\"thumbnail_url\":\"https://tool.oschina.net/regex.jpg\""
            + "}"
            + "],"
            + "\"merchant_option\":\"MANUAL_INPUT_MERCHANT\","
            + "\"merchant_id_list\": ["
            + "\"0\":\"10000022\","
            + "\"1\":\"10000023\""
            + "]"
            + "},"
            + "\"advanced_setting\": {"
            + "\"delivery_user_category\":\"DELIVERY_MEMBER_PERSON\","
            + "\"merchant_member_appid\":\"34567890\","
            + "\"goods_tags\": ["
            + "\"0\":\"xxx\","
            + "\"1\":\"yyy\""
            + "]"
            + "}"
            + "}";
    StringEntity entity = new StringEntity(reqdata,"utf-8");
    entity.setContentType("application/json");
    httpPost.setEntity(entity);
    httpPost.setHeader("Accept", "application/json");

    //完成簽名并執(zhí)行請(qǐng)求
    CloseableHttpResponse response = httpClient.execute(httpPost);

    try {
        int statusCode = response.getStatusLine().getStatusCode();
        if (statusCode == 200) { //處理成功
            System.out.println("success,return body = " + EntityUtils.toString(response.getEntity()));
        } else if (statusCode == 204) { //處理成功,無返回Body
            System.out.println("success");
        } else {
            System.out.println("failed,resp code = " + statusCode+ ",return body = " + EntityUtils.toString(response.getEntity()));
            throw new IOException("request failed");
        }
    } finally {
        response.close();
    }
} 

try {
    $resp = $client->request(
        'POST',
        'https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/unique-threshold-activity', //請(qǐng)求URL
        [
            // JSON請(qǐng)求體
            'json' => [
                "activity_base_info" => [
                    "activity_name" => "良品鋪?zhàn)踊仞伝顒?dòng)", 
                    "activity_second_title" => "海飛絲的券", 
                    "merchant_logo_url" => "https://tool.oschina.net/regex.jpg", 
                    "background_color" => "COLOR010", 
                    "begin_time" => "2015-05-20T13:29:35+08:00", 
                    "end_time" => "2015-05-20T13:29:35+08:00", 
                    "available_periods" => [
                        "available_time" => [
                            [
                                "begin_time" => "2015-05-20T00:00:00+08:00", 
                                "end_time" => "2015-05-20T23:59:59+08:00", 
                            ],
                        ],
                        "available_day_time" => [
                            [
                                "begin_day_time" => "110000", 
                                "end_day_time" => "135959", 
                            ],
                        ],
                    ],
                    "out_request_no" => "100002322019090134234sfdf", 
                    "delivery_purpose" => "OFF_LINE_PAY", 
                    "mini_programs_appid" => "wx23232232323", 
                    "mini_programs_path" => "/path/index/index", 
                ],
                "award_send_rule" => [
                    "transaction_amount_minimum" => 100, 
                    "send_content" => "SINGLE_COUPON", 
                    "award_type" => "BUSIFAVOR", 
                    "award_list" => [
                        [
                            "stock_id" => "98065001", 
                            "original_image_url" => "https://tool.oschina.net/regex.jpg", 
                            "thumbnail_url" => "https://tool.oschina.net/regex.jpg", 
                        ],
                    ],
                    "merchant_option" => "MANUAL_INPUT_MERCHANT", 
                    "merchant_id_list" => [
                        "0" => "10000022", 
                        "1" => "10000023", 
                    ],
                ],
                "advanced_setting" => [
                    "delivery_user_category" => "DELIVERY_MEMBER_PERSON", 
                    "merchant_member_appid" => "34567890", 
                    "goods_tags" => [
                        "0" => "xxx", 
                        "1" => "yyy", 
                    ],
                ]
            ],
            'headers' => [ 'Accept' => 'application/json' ]
        ]
    );
    $statusCode = $resp->getStatusCode();
    if ($statusCode == 200) { //處理成功
        echo "success,return body = " . $resp->getBody()->getContents()."\n";
    } else if ($statusCode == 204) { //處理成功,無返回Body
        echo "success";
    }
} catch (RequestException $e) {
    // 進(jìn)行錯(cuò)誤處理
    echo $e->getMessage()."\n";
    if ($e->hasResponse()) {
        echo "failed,resp code = " . $e->getResponse()->getStatusCode() . " return body = " . $e->getResponse()->getBody() . "\n";
    }
    return;
}
      

func CreateActivity() {
       // 初始化客戶端
    ctx := context.TODO()
    opts, err := SetUp()
    if err != nil {
        return
    }
    client, err := core.NewClient(ctx, opts...,)
    if err != nil{
        log.Printf("init client err:%s",err)
        return
    }
  //設(shè)置請(qǐng)求地址
  URL := "https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/unique-threshold-activity"
  //設(shè)置請(qǐng)求信息,此處也可以使用結(jié)構(gòu)體來進(jìn)行請(qǐng)求
  mapInfo := map[string]interface{}{
    "activity_base_info": map[string]interface{}{
      "activity_name": "良品鋪?zhàn)踊仞伝顒?dòng)",
      "activity_second_title": "海飛絲的券",
      "merchant_logo_url": "https://tool.oschina.net/regex.jpg",
      "background_color": "COLOR010",
      "begin_time": "2015-05-20T13:29:35+08:00",
      "end_time": "2015-05-20T13:29:35+08:00",
      "available_periods": map[string]interface{}{
        "available_time": [...]interface{}{
          map[string]interface{}{
            "begin_time": "2015-05-20T00:00:00+08:00",
            "end_time": "2015-05-20T23:59:59+08:00",
       },
      },
        "available_day_time": [...]interface{}{
          map[string]interface{}{
            "begin_day_time": "110000",
            "end_day_time": "135959",
       },
      },
     },
      "out_request_no": "100002322019090134234sfdf",
      "delivery_purpose": "OFF_LINE_PAY",
      "mini_programs_appid": "wx23232232323",
      "mini_programs_path": "/path/index/index",
    },
    "award_send_rule": map[string]interface{}{
      "transaction_amount_minimum": 100,
      "send_content": "SINGLE_COUPON",
      "award_type": "BUSIFAVOR",
      "award_list": [...]interface{}{
        map[string]interface{}{
          "stock_id": "98065001",
          "original_image_url": "https://tool.oschina.net/regex.jpg",
          "thumbnail_url": "https://tool.oschina.net/regex.jpg",
      },
     },
      "merchant_option": "MANUAL_INPUT_MERCHANT",
      "merchant_id_list": [...]interface{}{
        "10000022",
        "10000023",
     },
    },
    "advanced_setting": map[string]interface{}{
      "delivery_user_category": "DELIVERY_MEMBER_PERSON",
      "merchant_member_appid": "34567890",
      "goods_tags": [...]interface{}{
        "xxx",
        "yyy",
     },
    },
  }

  // 發(fā)起請(qǐng)求
  response, err := client.Post(ctx, URL, mapInfo)
  if err != nil{
    log.Printf("client post err:%s",err)
    return
  }
  // 校驗(yàn)回包內(nèi)容是否有邏輯錯(cuò)誤
  err = core.CheckResponse(response)
  if err != nil{
    log.Printf("check response err:%s",err)
    return
  }
  // 讀取回包信息
  body, err := ioutil.ReadAll(response.Body)
  if err != nil{
    log.Printf("read response body err:%s",err)
    return
  }
  fmt.Println(string(body))
}

    

重要入?yún)⒄f明

? activity_name:活動(dòng)名稱

? activity_second_title:活動(dòng)副標(biāo)題

? merchant_logo_url:商戶logo,送出優(yōu)惠券時(shí)展示, 僅支持通過《圖片上傳API》接口獲取的圖片URL地址。

? out_request_no:商戶請(qǐng)求單號(hào),商戶創(chuàng)建批次憑據(jù)號(hào)(格式:商戶id+日期+流水號(hào)),商戶側(cè)需保持唯一性,可包含英文字母,數(shù)字,|,_,*,-等內(nèi)容,不允許出現(xiàn)其他不合法符號(hào)。

? delivery_purpose:投放目的。枚舉值:

OFF_LINE_PAY:拉用戶回店消費(fèi)
JUMP_MINI_APP:引導(dǎo)用戶前往小程序消費(fèi)

? send_content:發(fā)放內(nèi)容,可選單張券或禮包,選禮包時(shí)獎(jiǎng)品限定3-5個(gè)。枚舉值:

SINGLE_COUPON:單張券
GIFT_PACKAGE:禮包

注意

更多參數(shù)、響應(yīng)詳情及錯(cuò)誤碼請(qǐng)參見創(chuàng)建全場滿額送活動(dòng)接口文檔

3.2.2. 【服務(wù)端】查詢活動(dòng)詳情接口

步驟說明:服務(wù)商創(chuàng)建活動(dòng)后,可以通過該接口查詢支付有禮的活動(dòng)詳情,用于管理活動(dòng)。

示例代碼


public void QueryActivity() throws Exception{
    //請(qǐng)求URL
    HttpGet httpGet = new HttpGet("https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001");
    httpGet.setHeader("Accept", "application/json");

    //完成簽名并執(zhí)行請(qǐng)求
    CloseableHttpResponse response = httpClient.execute(httpGet);

    try {
        int statusCode = response.getStatusLine().getStatusCode();
        if (statusCode == 200) { //處理成功
            System.out.println("success,return body = " + EntityUtils.toString(response.getEntity()));
        } else if (statusCode == 204) { //處理成功,無返回Body
            System.out.println("success");
        } else {
            System.out.println("failed,resp code = " + statusCode+ ",return body = " + EntityUtils.toString(response.getEntity()));
            throw new IOException("request failed");
        }
    } finally {
        response.close();
    }
} 

try {
    $resp = $client->request(
        'GET',
        'https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001', //請(qǐng)求URL
        [
            'headers' => [ 'Accept' => 'application/json']
        ]
    );
    $statusCode = $resp->getStatusCode();
    if ($statusCode == 200) { //處理成功
        echo "success,return body = " . $resp->getBody()->getContents()."\n";
    } else if ($statusCode == 204) { //處理成功,無返回Body
        echo "success";
    }
} catch (RequestException $e) {
    // 進(jìn)行錯(cuò)誤處理
    echo $e->getMessage()."\n";
    if ($e->hasResponse()) {
        echo "failed,resp code = " . $e->getResponse()->getStatusCode() . " return body = " . $e->getResponse()->getBody() . "\n";
    }
    return;
}
      

func QueryActivity() {
       // 初始化客戶端
    ctx := context.TODO()
    opts, err := SetUp()
    if err != nil {
        return
    }
    client, err := core.NewClient(ctx, opts...,)
    if err != nil{
        log.Printf("init client err:%s",err)
        return
    }
  //設(shè)置請(qǐng)求地址
   URL := "https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001"
  // 發(fā)起請(qǐng)求
  response, err := client.Get(ctx, URL)
  if err != nil{
    log.Printf("client get err:%s",err)
    return
  }
  // 校驗(yàn)回包內(nèi)容是否有邏輯錯(cuò)誤
  err = core.CheckResponse(response)
  if err != nil{
    log.Printf("check response err:%s",err)
    return
  }
  // 讀取回包信息
  body, err := ioutil.ReadAll(response.Body)
  if err != nil{
    log.Printf("read response body err:%s",err)
    return
  }
  fmt.Println(string(body))
}
    

重要入?yún)⒄f明

? activity_id:活動(dòng)id

注意

更多參數(shù)、響應(yīng)詳情及錯(cuò)誤碼請(qǐng)參見查詢活動(dòng)詳情接口文檔

3.2.3. 【服務(wù)端】查詢活動(dòng)發(fā)券商戶號(hào)

步驟說明:服務(wù)商創(chuàng)建活動(dòng)后,可以通過該接口查詢支付有禮的發(fā)券商戶號(hào),用于管理活動(dòng)。

示例代碼


public void QueryActivityMch() throws Exception{
    //請(qǐng)求URL
    HttpGet httpGet = new HttpGet("https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/merchants");
    httpGet.setHeader("Accept", "application/json");

    //完成簽名并執(zhí)行請(qǐng)求
    CloseableHttpResponse response = httpClient.execute(httpGet);

    try {
        int statusCode = response.getStatusLine().getStatusCode();
        if (statusCode == 200) { //處理成功
            System.out.println("success,return body = " + EntityUtils.toString(response.getEntity()));
        } else if (statusCode == 204) { //處理成功,無返回Body
            System.out.println("success");
        } else {
            System.out.println("failed,resp code = " + statusCode+ ",return body = " + EntityUtils.toString(response.getEntity()));
            throw new IOException("request failed");
        }
    } finally {
        response.close();
    }
}

try {
    $resp = $client->request(
        'GET',
        'https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/merchants', //請(qǐng)求URL
        [
            'headers' => [ 'Accept' => 'application/json']
        ]
    );
    $statusCode = $resp->getStatusCode();
    if ($statusCode == 200) { //處理成功
        echo "success,return body = " . $resp->getBody()->getContents()."\n";
    } else if ($statusCode == 204) { //處理成功,無返回Body
        echo "success";
    }
} catch (RequestException $e) {
    // 進(jìn)行錯(cuò)誤處理
    echo $e->getMessage()."\n";
    if ($e->hasResponse()) {
        echo "failed,resp code = " . $e->getResponse()->getStatusCode() . " return body = " . $e->getResponse()->getBody() . "\n";
    }
    return;
}
      

func QueryActivityMch() {
       // 初始化客戶端
    ctx := context.TODO()
    opts, err := SetUp()
    if err != nil {
        return
    }
    client, err := core.NewClient(ctx, opts...,)
    if err != nil{
        log.Printf("init client err:%s",err)
        return
    }
    //設(shè)置請(qǐng)求地址
   URL := "https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/merchants?offset=1&limit=20"
  // 發(fā)起請(qǐng)求
  response, err := client.Get(ctx, URL)
  if err != nil{
    log.Printf("client get err:%s",err)
    return
  }
  // 校驗(yàn)回包內(nèi)容是否有邏輯錯(cuò)誤
  err = core.CheckResponse(response)
  if err != nil{
    log.Printf("check response err:%s",err)
    return
  }
  // 讀取回包信息
  body, err := ioutil.ReadAll(response.Body)
  if err != nil{
    log.Printf("read response body err:%s",err)
    return
  }
  fmt.Println(string(body))
}
    

重要入?yún)⒄f明

? activity_id:活動(dòng)id

注意

更多參數(shù)、響應(yīng)詳情及錯(cuò)誤碼請(qǐng)參見查詢活動(dòng)發(fā)券商戶號(hào)接口文檔

3.2.4. 【服務(wù)端】查詢活動(dòng)指定商品列表

步驟說明:服務(wù)商創(chuàng)建活動(dòng)后,可以通過該接口查詢支付有禮的活動(dòng)指定商品,用于管理活動(dòng)。

示例代碼


public void QueryActivityGoods() throws Exception{
    //請(qǐng)求URL
    HttpGet httpGet = new HttpGet("https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/goods");
    httpGet.setHeader("Accept", "application/json");

    //完成簽名并執(zhí)行請(qǐng)求
    CloseableHttpResponse response = httpClient.execute(httpGet);

    try {
        int statusCode = response.getStatusLine().getStatusCode();
        if (statusCode == 200) { //處理成功
            System.out.println("success,return body = " + EntityUtils.toString(response.getEntity()));
        } else if (statusCode == 204) { //處理成功,無返回Body
            System.out.println("success");
        } else {
            System.out.println("failed,resp code = " + statusCode+ ",return body = " + EntityUtils.toString(response.getEntity()));
            throw new IOException("request failed");
        }
    } finally {
        response.close();
    }
} 

try {
    $resp = $client->request(
        'GET',
        'https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/goods', //請(qǐng)求URL
        [
            'headers' => [ 'Accept' => 'application/json']
        ]
    );
    $statusCode = $resp->getStatusCode();
    if ($statusCode == 200) { //處理成功
        echo "success,return body = " . $resp->getBody()->getContents()."\n";
    } else if ($statusCode == 204) { //處理成功,無返回Body
        echo "success";
    }
} catch (RequestException $e) {
    // 進(jìn)行錯(cuò)誤處理
    echo $e->getMessage()."\n";
    if ($e->hasResponse()) {
        echo "failed,resp code = " . $e->getResponse()->getStatusCode() . " return body = " . $e->getResponse()->getBody() . "\n";
    }
    return;
}
      

func QueryActivityGoods() {
       // 初始化客戶端
    ctx := context.TODO()
    opts, err := SetUp()
    if err != nil {
        return
    }
    client, err := core.NewClient(ctx, opts...,)
    if err != nil{
        log.Printf("init client err:%s",err)
        return
    }
  //設(shè)置請(qǐng)求地址
  URL := "https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/goods?offset=1&limit=20"
  // 發(fā)起請(qǐng)求
  response, err := client.Get(ctx, URL)
  if err != nil{
    log.Printf("client get err:%s",err)
    return
  }
  // 校驗(yàn)回包內(nèi)容是否有邏輯錯(cuò)誤
  err = core.CheckResponse(response)
  if err != nil{
    log.Printf("check response err:%s",err)
    return
  }
  // 讀取回包信息
  body, err := ioutil.ReadAll(response.Body)
  if err != nil{
    log.Printf("read response body err:%s",err)
    return
  }
  fmt.Println(string(body))
}
    

重要入?yún)⒄f明

? activity_id:活動(dòng)id

注意

更多參數(shù)、響應(yīng)詳情及錯(cuò)誤碼請(qǐng)參見查詢活動(dòng)指定商品列表接口文檔

3.2.5. 【服務(wù)端】終止活動(dòng)

步驟說明:服務(wù)商可通過該接口停止支付有禮活動(dòng)。

示例代碼


public void TerminateActivity() throws Exception{
    //請(qǐng)求URL
    HttpPost httpPost = new HttpPost("https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/terminate");
    // 請(qǐng)求body參數(shù)
    String reqdata ="";
    StringEntity entity = new StringEntity(reqdata,"utf-8");
    entity.setContentType("application/json");
    httpPost.setEntity(entity);
    httpPost.setHeader("Accept", "application/json");

    //完成簽名并執(zhí)行請(qǐng)求
    CloseableHttpResponse response = httpClient.execute(httpPost);

    try {
        int statusCode = response.getStatusLine().getStatusCode();
        if (statusCode == 200) { //處理成功
            System.out.println("success,return body = " + EntityUtils.toString(response.getEntity()));
        } else if (statusCode == 204) { //處理成功,無返回Body
            System.out.println("success");
        } else {
            System.out.println("failed,resp code = " + statusCode+ ",return body = " + EntityUtils.toString(response.getEntity()));
            throw new IOException("request failed");
        }
    } finally {
        response.close();
    }
} 

try {
    $resp = $client->request(
        'POST',
        'https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/terminate', //請(qǐng)求URL
         [
            'headers' => [ 
                'Accept' => 'application/json',
                'Content-Type'=>'application/json'
            ]
        ]
    );
    $statusCode = $resp->getStatusCode();
    if ($statusCode == 200) { //處理成功
        echo "success,return body = " . $resp->getBody()->getContents()."\n";
    } else if ($statusCode == 204) { //處理成功,無返回Body
        echo "success";
    }
} catch (RequestException $e) {
    // 進(jìn)行錯(cuò)誤處理
    echo $e->getMessage()."\n";
    if ($e->hasResponse()) {
        echo "failed,resp code = " . $e->getResponse()->getStatusCode() . " return body = " . $e->getResponse()->getBody() . "\n";
    }
    return;
}
      

func TerminateActivity() {
       // 初始化客戶端
    ctx := context.TODO()
    opts, err := SetUp()
    if err != nil {
        return
    }
    client, err := core.NewClient(ctx, opts...,)
    if err != nil{
        log.Printf("init client err:%s",err)
        return
    }
  //設(shè)置請(qǐng)求地址
  URL := "https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/{activity_id}/terminate"
  //設(shè)置請(qǐng)求信息,此處也可以使用結(jié)構(gòu)體來進(jìn)行請(qǐng)求
  mapInfo := map[string]interface{}{}

  // 發(fā)起請(qǐng)求
  response, err := client.Post(ctx, URL, mapInfo)
  if err != nil{
    log.Printf("client post err:%s",err)
    return
  }
  // 校驗(yàn)回包內(nèi)容是否有邏輯錯(cuò)誤
  err = core.CheckResponse(response)
  if err != nil{
    log.Printf("check response err:%s",err)
    return
  }
  // 讀取回包信息
  body, err := ioutil.ReadAll(response.Body)
  if err != nil{
    log.Printf("read response body err:%s",err)
    return
  }
  fmt.Println(string(body))
}

    

重要入?yún)⒄f明

? activity_id:活動(dòng)id

注意

更多參數(shù)、響應(yīng)詳情及錯(cuò)誤碼請(qǐng)參見終止活動(dòng)接口文檔

3.2.6. 【服務(wù)端】新增活動(dòng)發(fā)券商戶號(hào)

步驟說明:服務(wù)商創(chuàng)建活動(dòng)后,可以通過該接口增加支付有禮的發(fā)券商戶號(hào),用于管理活動(dòng)。

示例代碼


public void GetActivityList() throws Exception{
  // 加載商戶私鑰(privateKey:私鑰字符串)
  PrivateKey merchantPrivateKey = PemUtil
          .loadPrivateKey(new ByteArrayInputStream(privateKey.getBytes("utf-8")));

  // 加載平臺(tái)證書(mchId:商戶號(hào),mchSerialNo:商戶證書序列號(hào),apiV3Key:V3秘鑰)
  AutoUpdateCertificatesVerifier verifier = new AutoUpdateCertificatesVerifier(
          new WechatPay2Credentials(mchId, new PrivateKeySigner(mchSerialNo, merchantPrivateKey)),apiV3Key.getBytes("utf-8"));

  CloseableHttpClient httpClient = HttpClients.createDefault();
  // 初始化httpClient
  httpClient = WechatPayHttpClientBuilder.create()
          .withMerchant(mchId, mchSerialNo, merchantPrivateKey)
          .withValidator(new WechatPay2Validator(verifier)).build();

  //請(qǐng)求URL
  HttpPost httpPost = new HttpPost("https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/merchants/add");
  // 請(qǐng)求body參數(shù)
  String reqdata = "{"
          + "\"merchant_id_list\": ["
          + "\"100123456\","
          + "\"100123457\""
          + "],"
          + "\"add_request_no\":\"100002322019090134234sfdf\""
          + "}";
  StringEntity entity = new StringEntity(reqdata,"utf-8");
  entity.setContentType("application/json");
  httpPost.setEntity(entity);
  httpPost.setHeader("Accept", "application/json");

  //完成簽名并執(zhí)行請(qǐng)求
  CloseableHttpResponse response = httpClient.execute(httpPost);

  try {
      int statusCode = response.getStatusLine().getStatusCode();
      if (statusCode == 200) { //處理成功
          System.out.println("success,return body = " + EntityUtils.toString(response.getEntity()));
      } else if (statusCode == 204) { //處理成功,無返回Body
          System.out.println("success");
      } else {
          System.out.println("failed,resp code = " + statusCode+ ",return body = " + EntityUtils.toString(response.getEntity()));
          throw new IOException("request failed");
      }
  } finally {
      response.close();
  }
} 

try {
    $resp = $client->request(
        'POST',
        'https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/merchants/add', //請(qǐng)求URL
        [
            // JSON請(qǐng)求體
            'json' => [
                "merchant_id_list" => [
                    "0" => "100123456", 
                    "1" => "100123457", 
                ],
                "add_request_no" => "100002322019090134234sfdf",
            ],
            'headers' => [ 'Accept' => 'application/json' ]
        ]
    );
    $statusCode = $resp->getStatusCode();
    if ($statusCode == 200) { //處理成功
        echo "success,return body = " . $resp->getBody()->getContents()."\n";
    } else if ($statusCode == 204) { //處理成功,無返回Body
        echo "success";
    }
} catch (RequestException $e) {
    // 進(jìn)行錯(cuò)誤處理
    echo $e->getMessage()."\n";
    if ($e->hasResponse()) {
        echo "failed,resp code = " . $e->getResponse()->getStatusCode() . " return body = " . $e->getResponse()->getBody() . "\n";
    }
    return;
}
      

func GetActivityList() {
       // 初始化客戶端
    ctx := context.TODO()
    opts, err := SetUp()
    if err != nil {
        return
    }
    client, err := core.NewClient(ctx, opts...,)
    if err != nil{
        log.Printf("init client err:%s",err)
        return
    }
  //設(shè)置請(qǐng)求地址
  URL := "https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/10028001/merchants/add"
  //設(shè)置請(qǐng)求信息,此處也可以使用結(jié)構(gòu)體來進(jìn)行請(qǐng)求
  mapInfo := map[string]interface{}{
    "merchant_id_list": [...]interface{}{
      "100123456",
      "100123457",
    },
    "add_request_no": "100002322019090134234sfdf",
  }

  // 發(fā)起請(qǐng)求
  response, err := client.Post(ctx, URL, mapInfo)
  if err != nil{
    log.Printf("client post err:%s",err)
    return
  }
  // 校驗(yàn)回包內(nèi)容是否有邏輯錯(cuò)誤
  err = core.CheckResponse(response)
  if err != nil{
    log.Printf("check response err:%s",err)
    return
  }
  // 讀取回包信息
  body, err := ioutil.ReadAll(response.Body)
  if err != nil{
    log.Printf("read response body err:%s",err)
    return
  }
  fmt.Println(string(body))
}

    

重要入?yún)⒄f明

? activity_id:活動(dòng)id

? add_request_no:請(qǐng)求業(yè)務(wù)單據(jù)號(hào),商戶添加發(fā)券商戶號(hào)的憑據(jù)號(hào),商戶側(cè)需保持唯一性

注意

更多參數(shù)、響應(yīng)詳情及錯(cuò)誤碼請(qǐng)參見新增活動(dòng)發(fā)券商戶號(hào)接口文檔

3.2.7. 【服務(wù)端】獲取支付有禮活動(dòng)列表

步驟說明:服務(wù)商根據(jù)一定過濾條件,查詢已創(chuàng)建的支付有禮活動(dòng)。

示例代碼


public void GetActivityList() throws Exception{
  // 加載商戶私鑰(privateKey:私鑰字符串)
  PrivateKey merchantPrivateKey = PemUtil
          .loadPrivateKey(new ByteArrayInputStream(privateKey.getBytes("utf-8")));

  // 加載平臺(tái)證書(mchId:商戶號(hào),mchSerialNo:商戶證書序列號(hào),apiV3Key:V3秘鑰)
  AutoUpdateCertificatesVerifier verifier = new AutoUpdateCertificatesVerifier(
          new WechatPay2Credentials(mchId, new PrivateKeySigner(mchSerialNo, merchantPrivateKey)),apiV3Key.getBytes("utf-8"));

  CloseableHttpClient httpClient = HttpClients.createDefault();
  // 初始化httpClient
  httpClient = WechatPayHttpClientBuilder.create()
          .withMerchant(mchId, mchSerialNo, merchantPrivateKey)
          .withValidator(new WechatPay2Validator(verifier)).build();

  //請(qǐng)求URL
  HttpGet httpGet = new HttpGet("https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities?offset=0&limit=10&activity_status=ONGOING_ACT_STATUS");
  httpGet.setHeader("Accept", "application/json");

  //完成簽名并執(zhí)行請(qǐng)求
  CloseableHttpResponse response = httpClient.execute(httpGet);

  try {
      int statusCode = response.getStatusLine().getStatusCode();
      if (statusCode == 200) { //處理成功
          System.out.println("success,return body = " + EntityUtils.toString(response.getEntity()));
      } else if (statusCode == 204) { //處理成功,無返回Body
          System.out.println("success");
      } else {
          System.out.println("failed,resp code = " + statusCode+ ",return body = " + EntityUtils.toString(response.getEntity()));
          throw new IOException("request failed");
      }
  } finally {
      response.close();
  }
}

try {
    $resp = $client->request(
        'GET',
        'https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities?offset=0&limit=10&activity_status=ONGOING_ACT_STATUS', //請(qǐng)求URL
        [
            'headers' => [ 'Accept' => 'application/json']
        ]
    );
    $statusCode = $resp->getStatusCode();
    if ($statusCode == 200) { //處理成功
        echo "success,return body = " . $resp->getBody()->getContents()."\n";
    } else if ($statusCode == 204) { //處理成功,無返回Body
        echo "success";
    }
} catch (RequestException $e) {
    // 進(jìn)行錯(cuò)誤處理
    echo $e->getMessage()."\n";
    if ($e->hasResponse()) {
        echo "failed,resp code = " . $e->getResponse()->getStatusCode() . " return body = " . $e->getResponse()->getBody() . "\n";
    }
    return;
}
      

func GetActivityList() {
       // 初始化客戶端
    ctx := context.TODO()
    opts, err := SetUp()
    if err != nil {
        return
    }
    client, err := core.NewClient(ctx, opts...,)
    if err != nil{
        log.Printf("init client err:%s",err)
        return
    }
  //設(shè)置請(qǐng)求地址
  URL := "https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities?offset=0&limit=10&activity_status=ONGOING_ACT_STATUS"
  // 發(fā)起請(qǐng)求
  response, err := client.Get(ctx, URL)
  if err != nil{
    log.Printf("client get err:%s",err)
    return
  }
  // 校驗(yàn)回包內(nèi)容是否有邏輯錯(cuò)誤
  err = core.CheckResponse(response)
  if err != nil{
    log.Printf("check response err:%s",err)
    return
  }
  // 讀取回包信息
  body, err := ioutil.ReadAll(response.Body)
  if err != nil{
    log.Printf("read response body err:%s",err)
    return
  }
  fmt.Println(string(body))
}
    

重要入?yún)⒄f明

? offset:分頁頁碼,頁面從0開始

? limit:分頁大小。特殊規(guī)則:最大取值為100,最小為1

注意

更多參數(shù)、響應(yīng)詳情及錯(cuò)誤碼請(qǐng)參見獲取支付有禮活動(dòng)列表接口文檔

3.2.8. 【服務(wù)端】刪除活動(dòng)發(fā)券商戶號(hào)

步驟說明:服務(wù)商創(chuàng)建活動(dòng)后,可以通過該接口刪除支付有禮的發(fā)券商戶號(hào),用于管理活動(dòng)。

示例代碼


public void DelActivityMch() throws Exception{
  // 加載商戶私鑰(privateKey:私鑰字符串)
  PrivateKey merchantPrivateKey = PemUtil
          .loadPrivateKey(new ByteArrayInputStream(privateKey.getBytes("utf-8")));

  // 加載平臺(tái)證書(mchId:商戶號(hào),mchSerialNo:商戶證書序列號(hào),apiV3Key:V3秘鑰)
  AutoUpdateCertificatesVerifier verifier = new AutoUpdateCertificatesVerifier(
          new WechatPay2Credentials(mchId, new PrivateKeySigner(mchSerialNo, merchantPrivateKey)),apiV3Key.getBytes("utf-8"));

  CloseableHttpClient httpClient = HttpClients.createDefault();
  // 初始化httpClient
  httpClient = WechatPayHttpClientBuilder.create()
          .withMerchant(mchId, mchSerialNo, merchantPrivateKey)
          .withValidator(new WechatPay2Validator(verifier)).build();

  //請(qǐng)求URL
  HttpPost httpPost = new HttpPost("https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/126002309/merchants/delete");
  // 請(qǐng)求body參數(shù)
  String reqdata = "{"
          + "\"merchant_id_list\": ["
          + "\"100123456\","
          + "\"100123457\""
          + "],"
          + "\"delete_request_no\":\"100002322019090134234sfdf\""
          + "}";
  StringEntity entity = new StringEntity(reqdata,"utf-8");
  entity.setContentType("application/json");
  httpPost.setEntity(entity);
  httpPost.setHeader("Accept", "application/json");

  //完成簽名并執(zhí)行請(qǐng)求
  CloseableHttpResponse response = httpClient.execute(httpPost);

  try {
      int statusCode = response.getStatusLine().getStatusCode();
      if (statusCode == 200) { //處理成功
          System.out.println("success,return body = " + EntityUtils.toString(response.getEntity()));
      } else if (statusCode == 204) { //處理成功,無返回Body
          System.out.println("success");
      } else {
          System.out.println("failed,resp code = " + statusCode+ ",return body = " + EntityUtils.toString(response.getEntity()));
          throw new IOException("request failed");
      }
  } finally {
      response.close();
  }
}  

try {
    $resp = $client->request(
        'POST',
        'https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/126002309/merchants/delete', //請(qǐng)求URL
        [
            // JSON請(qǐng)求體
            'json' => [
                "merchant_id_list" => [
                    "0" => "100123456", 
                    "1" => "100123457", 
                ],
                "delete_request_no" => "100002322019090134234sfdf",
            ],
            'headers' => [ 'Accept' => 'application/json' ]
        ]
    );
    $statusCode = $resp->getStatusCode();
    if ($statusCode == 200) { //處理成功
        echo "success,return body = " . $resp->getBody()->getContents()."\n";
    } else if ($statusCode == 204) { //處理成功,無返回Body
        echo "success";
    }
} catch (RequestException $e) {
    // 進(jìn)行錯(cuò)誤處理
    echo $e->getMessage()."\n";
    if ($e->hasResponse()) {
        echo "failed,resp code = " . $e->getResponse()->getStatusCode() . " return body = " . $e->getResponse()->getBody() . "\n";
    }
    return;
}
      

func DelActivityMch() {
       // 初始化客戶端
    ctx := context.TODO()
    opts, err := SetUp()
    if err != nil {
        return
    }
    client, err := core.NewClient(ctx, opts...,)
    if err != nil{
        log.Printf("init client err:%s",err)
        return
    }
  //設(shè)置請(qǐng)求地址
  URL := "https://api.mch.weixin.qq.com/v3/marketing/paygiftactivity/activities/126002309/merchants/delete"
  //設(shè)置請(qǐng)求信息,此處也可以使用結(jié)構(gòu)體來進(jìn)行請(qǐng)求
  mapInfo := map[string]interface{}{
    "merchant_id_list": [...]interface{}{
      "100123456",
      "100123457",
    },
    "delete_request_no": "100002322019090134234sfdf",
  }

  // 發(fā)起請(qǐng)求
  response, err := client.Post(ctx, URL, mapInfo)
  if err != nil{
    log.Printf("client post err:%s",err)
    return
  }
  // 校驗(yàn)回包內(nèi)容是否有邏輯錯(cuò)誤
  err = core.CheckResponse(response)
  if err != nil{
    log.Printf("check response err:%s",err)
    return
  }
  // 讀取回包信息
  body, err := ioutil.ReadAll(response.Body)
  if err != nil{
    log.Printf("read response body err:%s",err)
    return
  }
  fmt.Println(string(body))
}
    

重要入?yún)⒄f明

? activity_id:活動(dòng)id

注意

更多參數(shù)、響應(yīng)詳情及錯(cuò)誤碼請(qǐng)參見刪除活動(dòng)發(fā)券商戶號(hào)接口文檔

4. 常見問題

Q1:支付有禮創(chuàng)建全場滿額送活動(dòng)API返回“發(fā)券商戶號(hào)校驗(yàn)失敗,請(qǐng)核實(shí)是否滿足同品牌等規(guī)則”

A1:支付有禮活動(dòng)的曝光商戶號(hào)必須是商家券歸屬商戶號(hào)的同品牌。同品牌商戶號(hào)是指同一企業(yè)/集團(tuán)/品牌/公司旗下,如果存在多個(gè)微信支付商戶號(hào),該企業(yè)/集團(tuán)/品牌/公司可以授權(quán)財(cái)付通支付科技有限公司將其旗下的多個(gè)商戶號(hào)創(chuàng)建為同品牌商戶號(hào)組合。主要用于更便利使用免充值營銷產(chǎn)品功能,包括開通產(chǎn)品權(quán)限、配置組合內(nèi)商戶號(hào)為可用商戶、配置活動(dòng)后可用商戶免審核等

Q2:支付有禮創(chuàng)建全場滿額送活動(dòng)API返回“商家券信息不滿足活動(dòng)規(guī)則,請(qǐng)核實(shí)券有效期或code”

A2:支付有禮中投放批次的校驗(yàn),請(qǐng)按照以下幾點(diǎn)排查

1. 單張券/券包中所有的券開始時(shí)間需早于支付有禮活動(dòng)的開始時(shí)間,結(jié)束時(shí)間需晚于支付有禮的結(jié)束時(shí)間
2. 如果批次為上傳code模式,需先上傳code再投放到支付有禮
3. 添加券包時(shí),庫存、限領(lǐng)和歸屬商戶號(hào)需要保持一致
4. 曝光商戶號(hào)、批次的歸屬商戶號(hào)需要全部為同品牌,創(chuàng)建活動(dòng)的商戶號(hào)為服務(wù)商時(shí),需要是曝光/歸屬商戶號(hào)的父商戶

Q3:支付有禮創(chuàng)建全場滿額送活動(dòng)API,開始時(shí)間和結(jié)束時(shí)間描述的“最長可以配置1年內(nèi)的活動(dòng)”中的“1年”如何計(jì)算?

A3:間隔需要小于31536000s,即需要小于365天

Q4:支付有禮創(chuàng)建全場滿額送活動(dòng)API上傳了merchant_id_list字段,接著調(diào)用了獲取支付有禮活動(dòng)列表API,并沒有merchant_id_list返回,該字段在什么情況下才返回?

A4:查詢活動(dòng)發(fā)券商戶號(hào)API才會(huì)有這個(gè)字段返回,接口文檔地址

Q5:支付有禮發(fā)放商家券,用戶領(lǐng)券沒有收到領(lǐng)券事件通知openid

A5:請(qǐng)檢查對(duì)應(yīng)的批次,調(diào)用創(chuàng)建商家券接口時(shí)是否有設(shè)置事件通知APPID參數(shù)(notify_appid)



技術(shù)咨詢

文檔反饋