table of Contents
- 190 626 today to update this, the time will continue to add and follow the code section.
- H5 pay code has been attached to the end of the text in the Appendix
Web micro-channel payment paid
Micro-letter web payment is more commonly used method of payment, the current domestic ordinary business popular web pays to have H5 payment, JSAPI payments, other micro-channel payment methods as well: App payment applet payment, Native payments, will highlight the H5 payment and JSAPI pay
micro-channel official document of an entry: [micro] ordinary letter to pay the merchant access the document .
H5 payment and payment JSAPI
Two kinds of payments the same page, a lot of people new to the micro-letter web payments do not know how to choose, H5 pay for the 微信外的浏览器
call, and JSAPI pay for the 公众号开发的微信内的网页
call
Features | H5 pay | JSAPI pay |
---|---|---|
scenes to be used | User 微信以外的手机浏览器 payment request micro-letter |
User by scanning the two-dimensional code, number, etc. to enter public attention H5 business page and 微信内调用JSSDK complete the payment |
Preparatory | A public number (need to be certified and opened a micro-channel micro-channel pay) a merchant number (number needed to bind the business public in the above No.) subscribe to pay H5 configuration H5 paid domain configuration API key (Merchant Center - Account Security Center -API set) |
A public number one business number configuration authoritative name configured public number directory payment authorization configuration API key |
Development Process | 1, the user completes the merchant side single use micro-channel payment payment 2, initiates the order request (call unified single interface) by the merchant back to the micro-channel payment 注 : transaction type trade_type=MWEB 3, a unified single interface has returned merchant background paid parameters to If payment jump url (parameter name "mweb_url"), the merchant by mweb_url invoking the micro-channel pay middle page check 4, intermediate pages H5 permissions, security checks 5. successful payment, the merchant back-end receives the micro channel side asynchronous notification 6, the user has completed the micro-channel pay the cashier to pay or cancel payment and return the merchant page (the default page for the return payment initiation) 7, the merchant page in the show guide the user initiates the query result of payment of 8,9, business background judge whether the results received to pay income micro-channel side of the notice, and if not, call our order back to confirm the order status query interface 10, showing the final result of the payment order to the user |
Set authorization domain settings paid directories calls JSSDK evoke pay configure the domain name and paid directory listings . |
Brief step | 1. Click Select payment products to pay (for example, their business: pay for a click background to create an order) 2. backstage after (their business) to create an order to initiate a micro-channel payment 统一下单 request 3 single successful micro-channel will return to the pre-payment transaction links, That is mweb_url , the merchant payment by visiting this link for payment transfer from the micro-channel 4. successful payment, micro-channel pay will push address asynchronous notification to the merchant configuration, if canceled payment or failure will return payment initiation page 注 : the rest of the process, you can compare 开发流程 the steps, where only to better understand the development process |
Payment page introduction jssdk use of micro-channel pay jssdk evoke pay micro-channel JS-SDK documentation and Download . |
Since both the payment 统一下单
parameters should be noted that where an individual can easily be overlooked.
When you select the JSAPI支付
time openid
that must pass parameters when you select the H5支付
time scene_info
that must pass parameters . Elsewhere particular note is 交易类型
the value of different types of payment transactions is also different.
注
: JSAPI-JSAPI pay (or applet payment), NATIVE-Native payment, APP-app payments, MWEB-H5 pay, different trade_type determines how transfer payments from
MICROPAY- payment code payment, payment code to pay a separate payment interface, the interface does not require uploading, this field will appear in the statement
Parameter comparison | H5 pay | JSAPI pay |
---|---|---|
- | Click to view the API documentation . | Click to view the API documentation . |
Transaction Typetrade_type |
MWEB |
JSAPI |
User identityopenid |
- | trade_type = JSAPI (i.e. JSAPI payment), this parameter must be passed, this parameter uniquely identifies the user corresponding to the micro-channel under appid merchant. How to get openid . |
Scene informationscene_info |
Will pass | - |
Public account IDappid |
Will pass | Will pass |
business numbermch_id |
Will pass | Will pass |
Random stringnonce_str |
Will pass | Will pass |
signaturesign |
It will pass H5 pay - the signature generation algorithm . |
It will pass JSAPI pay - the signature generation algorithm . |
product descriptionbody |
Will pass | Will pass |
Merchant Order Numberout_trade_no |
Will pass | Will pass |
total amounttotal_fee |
Will pass | Will pass |
IP terminalspbill_create_ip |
Will pass | Will pass |
Asynchronous Notification addressnotify_url |
Will pass | Will pass |
注
: H5 pay unified under a single return call there is a special parameter pre-payment information mweb_url
, the merchant paid through micro letter H5 jump this link.
Payment for the micro-channel pull mweb_url page intermediate cash register, a micro channel can be pulled by the client to access the url, to complete the payment, mweb_url period of 5 minutes.
appendix
Micro-channel pay -H5 payment page open process .
Micro-channel pay H5 - coding practices .
Micro-channel pay H5 - FAQ .
Micro-channel JSAPI payments - FAQ .