国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
1. Customs declaration interface API
Interface address
應(yīng)答參數(shù)列表
錯(cuò)誤碼
二、SDK實(shí)現(xiàn)
三、調(diào)用方式
三、返回結(jié)果
Home WeChat Applet WeChat Development WeChat public platform develops WeChat payment customs declaration interface

WeChat public platform develops WeChat payment customs declaration interface

Mar 08, 2017 pm 04:49 PM
WeChat development

This article introduces the development process of the customs declaration interface under WeChat payment. WeChat Customs Declaration is used by merchants to submit order information required by customs.

1. Customs declaration interface API


Interface address

https://api.mch.weixin.qq.com/cgi-bin/mch/customs/customdeclareorder

Do you need a certificate?

No.


Request method: post Data format: xml Signature method: MD5

Note: The amount of the merchant's order number is subject to what is recorded in the payment system. There is no need to upload. If there is a sub-order number, the amount payable, logistics fee, and product price of the sub-order must be uploaded (amount payable = logistics fee + product price).

##Field nameVariable nameRequiredTypeExample valueDescriptionSignaturesign is String(32)C380BEC2BFD727A4B6845133519F3AD6Signature, see signature generation algorithmPublic account IDappidisString(32)wxd678efh567hg6787The public account ID assigned by WeChatBusiness numbermch_id is String(32)1230000109The merchant number assigned by WeChat paymentMerchant order numberout_trade_no isString(32)20150806125346The internal order number of the merchant systemWeChat payment order numbertransaction_id isString(28)1000320306201511078440737890 The order number customscustoms returned by WeChat Pay is String(32)SHANGHAI Merchant Customs Registration Numbermch_customs_noNoString(32)123456The registration number of the merchant registered at the customs, customs is not NO, this parameter is requiredTariffdutyNo Int888Tariff, in cents
NO No need to report to customs

GUANGZHOU Guangzhou

HANGZHOU Hangzhou

NINGBO Ningbo

ZHENGZHOU_BS Zhengzhou (Bonded Logistics Center)

CHONGQING Chongqing

XIAN Xi'an

SHANGHAI Shanghai

ZHENGZHOU_ZH Zhengzhou (Comprehensive Bonded Area)

SHENZHEN Shenzhen

The following fields must be passed when splitting an order or re-declaring customs

Field nameVariable nameRequiredTypeExample value DescriptionMerchant sub-order numbersub_order_noNoString (32)20150806125346 Merchant sub-order number, if there is a split order, currencyfee_typeNoString(3)CNYThe currency used when paying WeChat payment orders. Currently, only RMB CNY is supported. If there is an order split, Must pass. Amount payableorder_feeNoInt888Sub-order The amount, in cents, cannot exceed the original order amount, order_fee=transport_fee+product_fee (amount payable = logistics fee + product price), if there is a split order, it must be sent. Logistics feetransport_feeNoInt888Logistics fee , divided into units. If there is any split order, it must be transmitted. Product priceproduct_feeNoInt888 Product fee , divided into units. If there is any split order, it must be transmitted.

The following fields are required when WeChat lacks user information. If the merchant has uploaded user information, the information uploaded by the merchant shall prevail.

##Field nameCertificate typeCertificate numberName

舉例如下:

<xml>
   <appid>wx2421b1c4370ec43b</appid>
   <customs>ZHENGZHOU_BS</customs>
   <mch_customs_no>D00411</mch_customs_no>
   <mch_id>1262544101</mch_id>
   <order_fee>13110</order_fee>
   <out_trade_no>15112496832609</out_trade_no>
   <product_fee>13110</product_fee>
   <sign>8FF6CEF879FB9555CD580222E671E9D4</sign>
   <transaction_id>1006930610201511241751403478</transaction_id>
   <transport_fee>0</transport_fee>
   <fee_type>CNY</fee_type>
   <sub_order_no>15112496832609001</sub_order_no>
   </xml>

注:參數(shù)值用XML轉(zhuǎn)義即可,CDATA標(biāo)簽用于說(shuō)明數(shù)據(jù)不被XML解析器解析。


應(yīng)答參數(shù)列表


Variable name Required Type Example value Description
cert_type No String(32) IDCARD Currently only supports ID cards. This parameter refers to user information. If the merchant has user information, it can be submitted. The system will be based on the data uploaded by the merchant. , perform customs clearance reporting;
cert_id No String(64) 330821198809085211 ID number, this parameter refers to user information. If the merchant has user information, it can be uploaded. The system will take the data uploaded by the merchant as the basis for customs clearance reporting;
name No String(64) 張三 User name, the Parameters refer to user information. If the merchant has user information, it can be submitted. The system will use the data uploaded by the merchant as the basis for customs clearance reporting;
字段名變量名必填類(lèi)型示例值說(shuō)明
返回狀態(tài)碼return_codeString(16)SUCCESS

SUCCESS/FAIL

此字段是通信標(biāo)識(shí),非交易標(biāo)識(shí),交易是否成功需要查看result_code來(lái)判斷

返回信息return_msgString(128)簽名失敗

返回信息,如非空,為錯(cuò)誤原因

簽名失敗

參數(shù)格式校驗(yàn)錯(cuò)誤

以下字段在return_code為SUCCESS的時(shí)候有返回

字段名變量名必填類(lèi)型示例值描述
簽名類(lèi)型sign_typeString(32)MD5暫只支持MD5
簽名signString(32)C380BEC2BFD727A4B6845133519F3AD6簽名,詳見(jiàn)簽名生成算法
公眾賬號(hào)IDappidString(32)wxd678efh567hg6787微信分配的公眾賬號(hào)ID
商戶號(hào)mch_idString(32)1230000109微信支付分配的商戶號(hào)
業(yè)務(wù)結(jié)果result_codeString(16)SUCCESSSUCCESS/FAIL
錯(cuò)誤代碼err_codeString(32)SYSTEMERROR詳細(xì)參見(jiàn)錯(cuò)誤列表
錯(cuò)誤代碼描述err_code_desString(128)系統(tǒng)錯(cuò)誤錯(cuò)誤返回的信息描述

以下字段在return_code 和result_code都為SUCCESS的時(shí)候有返回

字段名變量名必填類(lèi)型示例值描述
狀態(tài)碼stateString(2)UNDECLARED

狀態(tài)碼

UNDECLARED -- 未申報(bào)

SUBMITTED -- 申報(bào)已提交(訂單已經(jīng)送海關(guān),商戶重新申報(bào),并且海關(guān)還有修改接口,那么記錄的狀態(tài)會(huì)是這個(gè))

PROCESSING -- 申報(bào)中

SUCCESS -- 申報(bào)成功

FAIL-- 申報(bào)失敗

EXCEPT --海關(guān)接口異常

微信支付訂單號(hào)transaction_idString(28)1000320306201511078440737890微信支付返回的訂單號(hào)
商戶訂單號(hào)out_trade_noString(32)20150806125346商戶系統(tǒng)內(nèi)部的訂單號(hào)
商戶子訂單號(hào)sub_order_noString(32)20150806125346商戶子訂單號(hào),如有拆單則必傳
微信子訂單號(hào)sub_order_idString(32)20150806125346微信子訂單號(hào)
最后更新時(shí)間modify_timeString(14)20091227091010最后更新時(shí)間,格式為yyyyMMddhhmmss,如2009年12月27日9點(diǎn)10分10秒表示為20091227091010。時(shí)區(qū)為GMT+8 beijing。該時(shí)間取自微信服務(wù)器


錯(cuò)誤碼


名稱(chēng)描述原因解決方案
132011004參數(shù)錯(cuò)誤報(bào)關(guān)時(shí)僅傳入訂單號(hào),不傳入子訂單號(hào)(sub_order_no)時(shí),不能填費(fèi)用信息,須以支付系統(tǒng)中的值為準(zhǔn)請(qǐng)檢查參數(shù)是否都正確
132021028交易幣種與商戶結(jié)算幣種不一致】報(bào)關(guān)時(shí)傳入子訂單號(hào)(sub_order_no)時(shí),幣種參數(shù)(fee_type)必填請(qǐng)檢查所傳幣種參數(shù)(fee_type)是否為空
MCHID_NOT_SET商戶號(hào)未設(shè)置商戶號(hào)為必傳參數(shù),請(qǐng)求時(shí)必傳請(qǐng)檢查商戶號(hào)是否為空
MCHID_INVALID_LENGTH無(wú)效的商戶號(hào)長(zhǎng)度報(bào)關(guān)接口只支持12開(kāi)頭10位數(shù)字的商戶號(hào)請(qǐng)檢查商戶號(hào)長(zhǎng)度是否為10位
CUSTOMSCONFIG_NOT_SET海關(guān)配置未設(shè)置報(bào)關(guān)接口需要商戶已配置過(guò)海關(guān)信息才可以訪問(wèn)請(qǐng)參照上文中的海關(guān)備案指引,進(jìn)行海關(guān)信息報(bào)備
FEETYPE_NOT_SET幣種類(lèi)型未設(shè)置拆單情況下,幣種為必填參數(shù)請(qǐng)檢查fee_type是否為空
OUTTRADENO_NOT_SET商戶訂單號(hào)(out_trade_no)未設(shè)置商戶訂單號(hào)為必傳參數(shù)請(qǐng)檢查商戶訂單號(hào)(out_trade_no)是否為空
TRANSACTION_ID_NOT_SET微信訂單號(hào)(transaction_id)未設(shè)置微信訂單號(hào)(transaction_id)為必傳參數(shù)請(qǐng)檢查微信訂單號(hào)(transaction_id)是否為空
INVALID_TRANSACTION_ID無(wú)效的微信訂單號(hào)長(zhǎng)度微信訂單號(hào)為28位數(shù)字,請(qǐng)確保長(zhǎng)度一致請(qǐng)檢查微信訂單號(hào)(transaction_id)是否正確
CUSTOMS_NOT_SET海關(guān)信息未設(shè)置海關(guān)信息為必傳字段請(qǐng)檢查海關(guān)信息是否為空
CHCUSTOMSNO_NOT_SET海關(guān)備案號(hào)未設(shè)置海關(guān)備案號(hào)為必傳字段請(qǐng)檢查備案號(hào)是否為空
INVALID_MCHCUSTOMSNO無(wú)效的海關(guān)備案號(hào)長(zhǎng)度海關(guān)備案號(hào)一般為6位字符串請(qǐng)檢查海關(guān)備案號(hào)是否正確
PAYFEE_NOT_MATCH金額不匹配報(bào)關(guān)的訂單金額必須和支付的金額一致請(qǐng)檢查報(bào)關(guān)訂單的金額是否正確
INVALID_SUBORDER_NO無(wú)效的子訂單號(hào)長(zhǎng)度(sub_order_no)子訂單號(hào)要求是32位以內(nèi)的字符串請(qǐng)檢查子訂單號(hào)長(zhǎng)度是否正確
APPID_NOT_EXISTAppId未設(shè)置(sub_order_no)appid為必傳字段請(qǐng)檢查appid是否正確
MCHID_NOT_EXIST商戶號(hào)(mch_id)未設(shè)置MCH_ID為必傳字段請(qǐng)檢查mch_id是否正確
AUTHORITY_NOT_FOUND未開(kāi)通自助清關(guān)功能須先開(kāi)通自助清關(guān)功能才可成功調(diào)用接口請(qǐng)檢查是否已開(kāi)通自助清關(guān)功能,開(kāi)通路徑:微信支付商戶平臺(tái)-產(chǎn)品中心-自助清關(guān)中申請(qǐng)開(kāi)通。
NO_AUTH無(wú)權(quán)限未獲得此接口的調(diào)用權(quán)限請(qǐng)檢查當(dāng)前商戶號(hào)是否已獲得此接口的調(diào)用權(quán)限

二、SDK實(shí)現(xiàn)

sdk定義

微信公眾平臺(tái)開(kāi)發(fā)微信支付報(bào)關(guān)接口

微信公眾平臺(tái)開(kāi)發(fā)微信支付報(bào)關(guān)接口

三、調(diào)用方式

微信公眾平臺(tái)開(kāi)發(fā)微信支付報(bào)關(guān)接口

三、返回結(jié)果

發(fā)送數(shù)據(jù)如下

array(6) {
  ["appid"]=>
  string(18) "wxa8092dd025e45123"
  ["mch_id"]=>
  string(10) "1238298123"
  ["out_trade_no"]=>
  string(22) "SH20160824095750086988"
  ["transaction_id"]=>
  string(28) "4006742001201608242098415582"
  ["customs"]=>
  string(6) "NINGBO"
  ["mch_customs_no"]=>
  string(10) "3302461123"
}

接收到的數(shù)據(jù)如下

array(12) {
  ["return_code"]=>
  string(7) "SUCCESS"
  ["return_msg"]=>
  string(6) "成功"
  ["sign"]=>
  string(32) "91EFCEEAAD4322F331F3F63C4D8F1279"
  ["appid"]=>
  string(18) "wxa8092dd025e45123"
  ["mch_id"]=>
  string(10) "1238298123"
  ["result_code"]=>
  string(7) "SUCCESS"
  ["err_code"]=>
  string(1) "0"
  ["err_code_des"]=>
  string(2) "OK"
  ["state"]=>
  string(9) "SUBMITTED"
  ["transaction_id"]=>
  string(28) "4006742001201608242098415582"
  ["out_trade_no"]=>
  string(22) "SH20160824095750086988"
  ["modify_time"]=>
  string(14) "20160825111049"
}

?

The above is the detailed content of WeChat public platform develops WeChat payment customs declaration interface. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP WeChat development: How to implement message encryption and decryption PHP WeChat development: How to implement message encryption and decryption May 13, 2023 am 11:40 AM

PHP is an open source scripting language that is widely used in web development and server-side programming, especially in WeChat development. Today, more and more companies and developers are starting to use PHP for WeChat development because it has become a truly easy-to-learn and easy-to-use development language. In WeChat development, message encryption and decryption are a very important issue because they involve data security. For messages without encryption and decryption methods, hackers can easily obtain the data, posing a threat to users.

PHP WeChat development: How to implement voting function PHP WeChat development: How to implement voting function May 14, 2023 am 11:21 AM

In the development of WeChat public accounts, the voting function is often used. The voting function is a great way for users to quickly participate in interactions, and it is also an important tool for holding events and surveying opinions. This article will introduce you how to use PHP to implement WeChat voting function. Obtain the authorization of the WeChat official account. First, you need to obtain the authorization of the WeChat official account. On the WeChat public platform, you need to configure the API address of the WeChat public account, the official account, and the token corresponding to the public account. In the process of our development using PHP language, we need to use the PH officially provided by WeChat

Using PHP to develop WeChat mass messaging tools Using PHP to develop WeChat mass messaging tools May 13, 2023 pm 05:00 PM

With the popularity of WeChat, more and more companies are beginning to use it as a marketing tool. The WeChat group messaging function is one of the important means for enterprises to conduct WeChat marketing. However, if you only rely on manual sending, it is an extremely time-consuming and laborious task for marketers. Therefore, it is particularly important to develop a WeChat mass messaging tool. This article will introduce how to use PHP to develop WeChat mass messaging tools. 1. Preparation work To develop WeChat mass messaging tools, we need to master the following technical points: Basic knowledge of PHP WeChat public platform development Development tools: Sub

PHP WeChat development: How to implement customer service chat window management PHP WeChat development: How to implement customer service chat window management May 13, 2023 pm 05:51 PM

WeChat is currently one of the social platforms with the largest user base in the world. With the popularity of mobile Internet, more and more companies are beginning to realize the importance of WeChat marketing. When conducting WeChat marketing, customer service is a crucial part. In order to better manage the customer service chat window, we can use PHP language for WeChat development. 1. Introduction to PHP WeChat development PHP is an open source server-side scripting language that is widely used in the field of Web development. Combined with the development interface provided by WeChat public platform, we can use PHP language to conduct WeChat

PHP WeChat development: How to implement user tag management PHP WeChat development: How to implement user tag management May 13, 2023 pm 04:31 PM

In the development of WeChat public accounts, user tag management is a very important function, which allows developers to better understand and manage their users. This article will introduce how to use PHP to implement the WeChat user tag management function. 1. Obtain the openid of the WeChat user. Before using the WeChat user tag management function, we first need to obtain the user's openid. In the development of WeChat public accounts, it is a common practice to obtain openid through user authorization. After the user authorization is completed, we can obtain the user through the following code

PHP WeChat development: How to implement group message sending records PHP WeChat development: How to implement group message sending records May 13, 2023 pm 04:31 PM

As WeChat becomes an increasingly important communication tool in people's lives, its agile messaging function is quickly favored by a large number of enterprises and individuals. For enterprises, developing WeChat into a marketing platform has become a trend, and the importance of WeChat development has gradually become more prominent. Among them, the group sending function is even more widely used. So, as a PHP programmer, how to implement group message sending records? The following will give you a brief introduction. 1. Understand the development knowledge related to WeChat public accounts. Before understanding how to implement group message sending records, I

Steps to implement WeChat public account development using PHP Steps to implement WeChat public account development using PHP Jun 27, 2023 pm 12:26 PM

How to use PHP to develop WeChat public accounts WeChat public accounts have become an important channel for promotion and interaction for many companies, and PHP, as a commonly used Web language, can also be used to develop WeChat public accounts. This article will introduce the specific steps to use PHP to develop WeChat public accounts. Step 1: Obtain the developer account of the WeChat official account. Before starting the development of the WeChat official account, you need to apply for a developer account of the WeChat official account. For the specific registration process, please refer to the official website of WeChat public platform

How to use PHP for WeChat development? How to use PHP for WeChat development? May 21, 2023 am 08:37 AM

With the development of the Internet and mobile smart devices, WeChat has become an indispensable part of the social and marketing fields. In this increasingly digital era, how to use PHP for WeChat development has become the focus of many developers. This article mainly introduces the relevant knowledge points on how to use PHP for WeChat development, as well as some of the tips and precautions. 1. Development environment preparation Before developing WeChat, you first need to prepare the corresponding development environment. Specifically, you need to install the PHP operating environment and the WeChat public platform

See all articles