Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code enhancement #34

Open
cybersky opened this issue Aug 8, 2017 · 0 comments
Open

code enhancement #34

cybersky opened this issue Aug 8, 2017 · 0 comments

Comments

@cybersky
Copy link

cybersky commented Aug 8, 2017

WXPay.mix('getBrandWCPayRequestParams', function(order, fn){

order.trade_type = "JSAPI";
var _this = this;
this.createUnifiedOrder(order, function(err, data){

//TODO: check data['return_code'] and data['return_msg'] response here, otherwise client will get a callback data with like {..., nonceStr: undefined, package: "prepay_id=undefined"... } without any further debug infomation.

	var reqparam = {
		appId: _this.options.appid,
		timeStamp: Math.floor(Date.now()/1000)+"",
		nonceStr: data.nonce_str,
		package: "prepay_id="+data.prepay_id,
		signType: "MD5"
	};
	reqparam.paySign = _this.sign(reqparam);
	fn(err, reqparam);
});

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant