When the WeChat interface calls payment jsapi and there are missing parameters, it means that the package field returned by the background is wrong.
When the front desk initiates payment, the front desk initiates an ajax request to the server. The server assembles the payment parameters and then returns them to the front desk. An error will be reported: Payment is missing parameters, as shown below.
Solution:
Change the package parameter in wx.requestPayment to package: "prepay_id=wx21**************", otherwise it will There are missing parameters when calling payment JSAPI.
Extended information:
Parameter regulations
1. Transaction type trade_type
JSAPI--JSAPI payment (or mini program payment), NATIVE--Native payment, APP--app payment, MWEB--H5 payment. Different trade_type determines the method of payment. Please upload it correctly according to the payment product
MICROPAY--payment code payment, payment code There is a separate payment interface for payment, so the interface does not need to be uploaded. This field will appear in the statement
2. Time
Standard Beijing time, the time zone is Dongba District; if the merchant The system time is non-standard Beijing time. The parameter value must first be converted to standard Beijing time according to the time zone where the merchant system is located. For example, if the merchant is located in London in time zone 0, the local time is 0:00:00 on November 11, 2014, which is converted to Beijing time in November 2014. 8:00:00 on the 11th.
3. Transaction amount
The transaction amount defaults to RMB transaction. The parameter payment amount unit in the interface is cents, and the parameter value cannot contain decimals. The transaction amount in the statement is in yuan.
The payment amount of foreign currency transactions is accurate to the smallest unit of the currency, and the parameter value cannot contain decimal points.
Reference materials: WeChat Payment - Development Documents