微信小程序支付

(1)支付要素:appId、merchantId(商家标志)、openId(用户标志)、totalFee(支付金额)。php

(2)openId获取方式html

小程序登录wx.login(),获取临时登陆凭证code,有效期五分钟,只能使用一次。小程序

登录凭证校验,获取open_id和session_key。  open_id永久有效,session_key有有效期。api

地址:session

      小程序登录接口     https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.htmlapp

      登录校验接口        https://developers.weixin.qq.com/miniprogram/dev/api-backend/auth.code2Session.htmlcode

(3)统一下单   https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_1       htm

        获取  prepay_id。该值有效期为2小时接口

(4)再次签名ip

        https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=7_7&index=3

(5)调起收银台

相关文章
相关标签/搜索