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

Login expired. Please log in again.

Feedback

0/300

Feedback

Submitted successfully

ok

Feedback

Network exception, please try again later

ok

開發(fā)指引

1. 接口規(guī)則

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

2. 開發(fā)環(huán)境搭建

為了幫助開發(fā)者調(diào)用開放接口,我們提供了JavaPHPGO語言版本的開發(fā)庫(kù),封裝了簽名生成、簽名驗(yàn)證、敏感信息加/解密、媒體文件上傳等基礎(chǔ)功能


3. 業(yè)務(wù)時(shí)序圖

3.1. 業(yè)務(wù)時(shí)序圖

3.2. API接入示例

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

注意

? 文檔中的代碼示例是用來闡述 API 基本使用方法,代碼中的示例參數(shù)需替換成商戶自己賬號(hào)及請(qǐng)求參數(shù)才能跑通。

? 以下接入步驟僅提供參考,請(qǐng)商戶結(jié)合自身業(yè)務(wù)需求進(jìn)行評(píng)估、修改。

3.2.1 身份信息校驗(yàn)

步驟說明:該接口允許商戶請(qǐng)求微信支付對(duì)用戶支付用戶的實(shí)名信息與入?yún)⒅械纳矸菪畔⑦M(jìn)行一致性校驗(yàn),商戶可以根據(jù)校驗(yàn)結(jié)果使用正確的信息進(jìn)行報(bào)關(guān)。

敏感信息字段:certificate_id 和 certificate_name 為用戶敏感信息,為避免被中間人截獲,保護(hù)用戶隱私,需要按照 微信支付APIv3 加密后傳輸。

加密方法

? 下載微信支付平臺(tái)證書,獲取證書序列號(hào)與證書公鑰。

? 在 HTTP header 中添加微信支付平臺(tái)證書序列號(hào),Wechatpay-Serial :${微信支付平臺(tái)證書序列號(hào)}。

? 使用微信支付平臺(tái)證書公鑰對(duì)敏感字段進(jìn)行RSA加密,填充方案選擇 RSAES-PKCS1-v1_5。

? 對(duì)密文進(jìn)行 base64 編碼后即可得到最終內(nèi)容。

代碼示例


//Id info verification API
    public void idVerification() throws IOException {
		String verifyIdInfoBody = """{
  "appid": "wxd678efh567hg6787",
  "mchid": "1230000109",
  "out_trade_no": "20150806125346",
  "transaction_id": "1000320306201511078440737890",
  "sub_order_no": "20150806125346",
  "customs": "SHANGHAI_ZS",
  "merchant_customs_no": "123456",
  "certificate_type": "IDCARD",
  "certificate_id": "HHp24MagiQ6i7c5yIow5cJP5x2cGsAA8hi5yIow5cJP5x", // sensitive field, encryption content
  "certificate_name": "HHp24MagiQ6i7c5yIow/9ZTk5Zt5cJP5x2cGsAA8hif07fRdb2" //sensitive field,encryption content
}""";
        HttpPost httpPost = new HttpPost("https://apihk.mch.weixin.qq.com/v3/global/customs/verify-certificate");
        httpPost.addHeader("Accept", "application/json");
        httpPost.addHeader("Content-type", "application/json; charset=utf-8");
        httpPost.addHeader("Wechatpay-Serial", "0798ABFDCBXXXXXXXXXXXXXXXXXXXXXXX054A761");
        httpPost.setEntity(new StringEntity(verifyIdInfoBody));
        CloseableHttpResponse response = httpClient.execute(httpPost);
        //Process the response
    }

//Call id verification API
func idVerification() {
   idVerificationBody := `{
  "appid": "wxd678efh567hg6787",
  "mchid": "1230000109",
  "out_trade_no": "20150806125346",
  "transaction_id": "1000320306201511078440737890",
  "sub_order_no": "20150806125346",
  "customs": "SHANGHAI_ZS",
  "merchant_customs_no": "123456",
  "certificate_type": "IDCARD",
  "certificate_id": "HHp24MagiQ6i7c5yIow5cJP5x2cGsAA8hi5yIow5cJP5x",
  "certificate_name": "HHp24MagiQ6i7c5yIow/9ZTk5Zt5cJP5x2cGsAA8hif07fRdb2"
}`
   header.Add("Wechatpay-Serial", "")
   header.Add("Idempotency-Key", "20220518-001")
   result, err := client.Post(ctx, "https://apihk.mch.weixin.qq.com/v3/global/customs/verify-certificate", header, nil, idVerificationBody, "application/json")
   if err != nil {
      // Process error
   }
   log.Printf("%s", result.Response.Body)
}

//Id info verification API
public function idInfoVerification($instance, $platformPublicKeyInstance, $platformCertificateSerial){
    $encryptor = static function(string $msg) use ($platformPublicKeyInstance): string {
        return Rsa::encrypt($msg, $platformPublicKeyInstance, OPENSSL_PKCS1_PADDING);
    };
    try {
        $resp = $instance
            ->chain('/v3/global/customs/verify-certificate')
            ->post([
                'json' => [
                    'appid' => 'wxdace12300000000',
                    'mchid' => '1900000000',
                    'out_trade_no' => 'YX001',
                    'transaction_id' => '420000000001500000089',
                    'customs' => 'SHANGHAI_ZS',
                    'merchant_customs_no' => '123456',
                    'sub_order_no' => '20150806125346',
                    'certificate_type' => 'IDCARD',
                    'certificate_id' => 'HHp24MagiQ6i7c5yIow5cJP5x2cGsAA8hi5yIow5cJP5x',
                    'certificate_name' => 'HHp24MagiQ6i7c5yIow/9ZTk5Zt5cJP5x2cGsAA8hif07fRdb2'
                ],
                'headers' => [
                    'Wechatpay-Serial' => $platformCertificateSerial
                ]
            ]);
        echo $resp->getStatusCode(), PHP_EOL;
        echo $resp->getBody(), PHP_EOL;
    } catch (\Exception $e) {
        // Exception handling
    }
}

									{
										"stock_id": "Python",
										"stock_creator_mchid": "123456",
										"limit": 10,
									}

其他重要參數(shù)請(qǐng)前往身份信息校驗(yàn)API文檔頁面參考。

3.2.2 訂單附加信息提交接口

步驟說明:商戶通過該接口請(qǐng)求微信支付向海關(guān)推送支付單的報(bào)關(guān)信息。微信支付在收到報(bào)關(guān)附加信息后,會(huì)異步向海關(guān)進(jìn)行支付單申報(bào)信息推送。

代碼示例


    //Customs Declaration API
    public void customsDeclaration() throws IOException {
		String customsDeclarationBody= """{
  "appid": "wxd678efh567hg6787",
  "mchid": "1230000109",
  "out_trade_no": "20150806125346",
  "transaction_id": "1000320306201511078440737890",
  "customs": "SHANGHAI_ZS",
  "merchant_customs_no": "123456",
  "duty": 888,
  "sub_order_no": "20150806125346",
  "fee_type": "CNY",
  "order_fee": 888,
  "transport_fee": 888,
  "product_fee": 888
}""";
        HttpPost httpPost = new HttpPost("https://apihk.mch.weixin.qq.com/v3/global/customs/orders");
        httpPost.addHeader("Accept", "application/json");
        httpPost.addHeader("Content-type", "application/json; charset=utf-8");
        httpPost.setEntity(new StringEntity(customsDeclarationBody));
        CloseableHttpResponse response = httpClient.execute(httpPost);
        //Process the response 
    }


//Call customs declaration API
func customsDeclaration() {
   customsDeclarationBody := `
{
  "appid": "wxd678efh567hg6787",
  "mchid": "1230000109",
  "out_trade_no": "20150806125346",
  "transaction_id": "1000320306201511078440737890",
  "customs": "SHANGHAI_ZS",
  "merchant_customs_no": "123456",
  "duty": 888,
  "sub_order_no": "20150806125346",
  "fee_type": "CNY",
  "order_fee": 888,
  "transport_fee": 888,
  "product_fee": 888
}
`
   result, err := client.Post(ctx, "https://apihk.mch.weixin.qq.com/v3/global/customs/orders", customsDeclarationBody)
   if err != nil {
      // Process error
   }
   log.Printf("%s", result.Response.Body)
}

//Customs Declaration API
public function customsDeclaration($instance){
    try {
        $resp = $instance
            ->chain('/v3/global/customs/orders')
            ->post([
                'json' => [
                    'appid' => 'wxd678efh567hg6787',
                    'mchid' => '1230000109',
                    'out_trade_no' => '20150806125346',
                    'transaction_id' => '1000320306201511078440737890',
                    'customs' => 'SHANGHAI_ZS',
                    'merchant_customs_no' => '123456',
                    'duty' => 888,
                    'sub_order_no' => '20150806125346',
                    'fee_type' => 'CNY',
                    'order_fee' => 888,
                    'transport_fee' => 888,
                    'product_fee' => 888
                ]
            ]);

        echo $resp->getStatusCode(), PHP_EOL;
        echo $resp->getBody(), PHP_EOL;
    } catch (\Exception $e) {
        // Exception handling
    }
}

									{
										"stock_id": "Python",
										"stock_creator_mchid": "123456",
										"limit": 10,
									}

其他重要參數(shù)請(qǐng)前往報(bào)關(guān)API文檔頁面參考。

3.2.3 報(bào)關(guān)信息修改接口

步驟說明:當(dāng)商戶錯(cuò)誤傳了報(bào)關(guān)信息的部分字段時(shí),可調(diào)用該接口對(duì)報(bào)關(guān)信息進(jìn)行修改。該接口只能修改如下5個(gè)字段:merchant_customs_no、duty、order_fee、transport_fee、product_fee

代碼示例


    //Modify Customs Declaration API
    public void modifyCustomsDeclarartionTest() throws IOException {
		String modifyCustomsDeclarationBody = """
{
   "appid": "wxd678efh567hg6787",
   "mchid": "1230000109",
   "out_trade_no": "20150806125346",
   "transaction_id": "1000320306201511078440737890",
   "sub_order_no": "20150806125346",
   "customs": "SHANGHAI_ZS",
   "merchant_customs_no": "123456",
   "duty": 888,
   "order_fee": 888,
   "transport_fee": 888,
   "product_fee": 888
}
""";
        HttpPatch httpPatch = new HttpPatch("https://apihk.mch.weixin.qq.com/v3/global/customs/orders");
        httpPatch.addHeader("Accept", "application/json");
        httpPatch.addHeader("Content-type", "application/json; charset=utf-8");
        httpPatch.setEntity(new StringEntity(modifyCustomsDeclarationBody));
        CloseableHttpResponse response = httpClient.execute(httpPatch);
        //Process the response 
    }

//Modify customs declaration API
func modifyCustomsDeclarartion() {
   modifyCustomsDeclarartionBody := `
{
   "appid": "wxd678efh567hg6787",
   "mchid": "1230000109",
   "out_trade_no": "20150806125346",
   "transaction_id": "1000320306201511078440737890",
   "sub_order_no": "20150806125346",
   "customs": "SHANGHAI_ZS",
   "merchant_customs_no": "123456",
   "duty": 888,
   "order_fee": 888,
   "transport_fee": 888,
   "product_fee": 888
}
`
   result, err := client.Patch(ctx, "https://apihk.mch.weixin.qq.com/v3/global/customs/orders", modifyCustomsDeclarartionBody)
   if err != nil {
      // Process error
   }
   log.Printf("%s", result.Response.Body)
}

//Modify Customs Declaration API
public function modifyCustomsDeclarartion($instance){
    try {
        $resp = $instance
            ->chain('/v3/global/customs/orders')
            ->patch([
                'json' => [
                    'appid' => 'wxd678efh567hg6787',
                    'mchid' => '1230000109',
                    'out_trade_no' => '20150806125346',
                    'transaction_id' => '1000320306201511078440737890',
                    'customs' => 'SHANGHAI_ZS',
                    'merchant_customs_no' => '123456',
                    'duty' => 888,
                    'sub_order_no' => '20150806125346',
                    'order_fee' => 888,
                    'transport_fee' => 888,
                    'product_fee' => 888
                ]
            ]);

        echo $resp->getStatusCode(), PHP_EOL;
        echo $resp->getBody(), PHP_EOL;
    } catch (\Exception $e) {
        // Exception handling
    }
}

									{
										"stock_id": "Python",
										"stock_creator_mchid": "123456",
										"limit": 10,
									}

其他重要參數(shù)請(qǐng)前往報(bào)關(guān)信息修改API文檔頁面參考。

3.2.4 訂單附加信息查詢接口

步驟說明:商戶可通過該接口查詢之前提交的報(bào)關(guān)附加信息,以及海關(guān)報(bào)關(guān)狀態(tài)。

代碼示例


    //Query Customs Declaration API
    public void queryCustomsDeclarationTest() throws IOException {
        HttpGet httpGet = new HttpGet("https://apihk.mch.weixin.qq.com/v3/global/customs/orders?appid=wxd678efh567hg6787&mchid=mchid&order_type=transaction_id&order_no=1000320306201511078440737890&customs=SHANGHAI_ZS&offset=1&limit=20");
        httpGet.addHeader("Accept", "application/json");
        httpGet.addHeader("Content-type", "application/json; charset=utf-8");
        CloseableHttpResponse response = httpClient.execute(httpGet);
        //Process the response 
    }

//Call query customs declaration API
func queryCustomsDeclaration() {
   result, err := client.Get(ctx, "https://apihk.mch.weixin.qq.com/v3/global/customs/orders?appid=wxd678efh567hg6787&mchid=mchid&order_type=transaction_id&order_no=1000320306201511078440737890&customs=SHANGHAI_ZS&offset=1&limit=20")
   if err != nil {
      // Process error
   }
   log.Printf("%s", result.Response.Body)
}

//Query Customs Declaration API
public function queryCustomsDeclaration($instance){
    try {
        $resp = $instance
            ->chain('/v3/global/customs/orders')
            ->get([
                'query' => [
                    'mchid' => '1900000000',
                    'appid' => 'wxd678efh567hg6787',
                    'order_type' => 'transaction_id',
                    'order_no' => '1000320306201511078440737890',
                    'customs' => 'SHANGHAI_ZS',
                    'offset' => 1,
					'limit' => 20
                ]
            ]);
        echo $resp->getStatusCode(), PHP_EOL;
        echo $resp->getBody(), PHP_EOL;
    } catch (\Exception $e) {
        // Exception handling
    }
}

									{
										"stock_id": "Python",
										"stock_creator_mchid": "123456",
										"limit": 10,
									}

其他重要參數(shù)請(qǐng)前往報(bào)關(guān)查詢API文檔頁面參考。

3.2.5 訂單附加信息重推接口

步驟說明:當(dāng)訂單已申報(bào)且海關(guān)要求商戶重新推送報(bào)關(guān)信息時(shí),商戶可通過該接口將報(bào)關(guān)信息再次發(fā)往海關(guān)。

代碼示例


    //Repush Customs Declaration API
    public void repushCustomsDeclarartionTest() throws IOException {
		String repushBody = """
{
  "appid": "wxd678efh567hg6787",
   "mchid": "1230000109",
   "out_trade_no": "20150806125346",
   "transaction_id": "1000320306201511078440737890",
   "sub_order_no": "20150806125346",
   "sub_order_id": "1000320306201511078440737891",
   "customs": "SHANGHAI_ZS",
   "merchant_customs_no": "123456"
}
""";
        HttpPost httpPost = new HttpPost("https://apihk.mch.weixin.qq.com/v3/global/customs/redeclare");
        httpPost.addHeader("Accept", "application/json");
        httpPost.addHeader("Content-type", "application/json; charset=utf-8");
        httpPost.setEntity(new StringEntity(repushBody));
        CloseableHttpResponse response = httpClient.execute(httpPost);
        //Process the response 
    }

//Repush customs declaration API
func repushCustomsDeclarartion() {
   repushBody := `
{
  "appid": "wxd678efh567hg6787",
   "mchid": "1230000109",
   "out_trade_no": "20150806125346",
   "transaction_id": "1000320306201511078440737890",
   "sub_order_no": "20150806125346",
   "sub_order_id": "1000320306201511078440737891",
   "customs": "SHANGHAI_ZS",
   "merchant_customs_no": "123456"
}
`
   result, err := client.Post(ctx, "https://apihk.mch.weixin.qq.com/v3/global/customs/redeclare", repushBody)
   if err != nil {
      // Process error
   }
   log.Printf("%s", result.Response.Body)
}

//Repush Customs Declaration API
public function repushCustomsDeclarartion($instance){
    try {
        $resp = $instance
            ->chain('v3/global/customs/redeclare')
            ->post([
                'json' => [
                    'mchid' => '1230000109',
                    'appid' => 'wxd678efh567hg6787',
                    'out_trade_no' => '20150806125346',
                    'transaction_id' => '1000320306201511078440737890',
                    'sub_order_no' => '20150806125346',
                    'sub_order_id' => '1000320306201511078440737891',
                    'customs' => 'SHANGHAI_ZS',
                    'merchant_customs_no' => '123456'
                ]
            ]);
        echo $resp->getStatusCode(), PHP_EOL;
        echo $resp->getBody(), PHP_EOL;
    } catch (\Exception $e) {
        // Exception handling
    }
}

									{
										"stock_id": "Python",
										"stock_creator_mchid": "123456",
										"limit": 10,
									}

其他重要參數(shù)請(qǐng)前往報(bào)關(guān)查詢API文檔頁面參考。

    頁面導(dǎo)航

About  WeChat  Pay

Powered By Tencent & Tenpay Copyright©

2005-2024 Tenpay All Rights Reserved.

Contact Us
Wechat Pay Global

WeChat Pay Global

置頂