API
Class

WxPay ($UI/system/api/native/wxPay)

使用范围:UI2

Contents

class WxPay ($UI/system/api/native/wxPay)

微信支付

 
	 
			var wxPay = require('$UI/system/api/native/wxPay');
			var tradeNo = justep.UUID.createUUID();
			var notifyUrl = location.origin + "/baas/weixin/weixin/notify";
			wxPay.pay({
				body : "x5外卖",
				mchId : "1305137601",
				notifyUrl : notifyUrl,
				outTradeNo : tradeNo,
				totalFee : "1",
				success : function(e) {
					alert(JSON.stringify(e))
				},
				cancel : function(e) {
					alert(JSON.stringify(e))
				},
				fail : function(e) {
					alert(JSON.stringify(e))
				}
			});
	

Constructor Top

  WxPay ()

Static Methods Top

void pay (Object options)

Constructor details Top

public WxPay ()

微信支付

 
	 
			var wxPay = require('$UI/system/api/native/wxPay');
			var tradeNo = justep.UUID.createUUID();
			var notifyUrl = location.origin + "/baas/weixin/weixin/notify";
			wxPay.pay({
				body : "x5外卖",
				mchId : "1305137601",
				notifyUrl : notifyUrl,
				outTradeNo : tradeNo,
				totalFee : "1",
				success : function(e) {
					alert(JSON.stringify(e))
				},
				cancel : function(e) {
					alert(JSON.stringify(e))
				},
				fail : function(e) {
					alert(JSON.stringify(e))
				}
			});
	

Static Methods Detail Top

static public void pay (Object options)

发起支付

Parameters

Object options

选项
结构如下:

{ "body" : {string} 标题, "mchId" : {string} 合作商户ID, "notifyUrl" : {string} 成功通知url, "outTradeNo" : {string} 订单号, "totalFee" : {string} 金额(分), "success" : {function} success 回调函数 "cancel" : {function} cancel 回调函数 "fail" : {function} fail 回调函数 }

Return Value

void