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

[微信小程序]微信支付 #243

Open
webVueBlog opened this issue Jul 30, 2020 · 0 comments
Open

[微信小程序]微信支付 #243

webVueBlog opened this issue Jul 30, 2020 · 0 comments

Comments

@webVueBlog
Copy link
Member

[微信小程序]

/**
 * 微信小程序支付,仅支持微信支付(后续可能集成网页支付宝支付web-view)
 *
 * @param : provider(String) ->付款商家
 * @param : timeStamp(String) ->时间戳(当前支付时间)
 * @param : nonceStr(String) ->支付密匙
 * @param : packages(String) ->支付id
 * @param : signType(String) ->加密方式(默认MD5)
 * @param : paySign(String)
 *
 *
 *
 * 小程序支付调用
 *
 * wePay(provider, timeStamp, nonceStr, packages, signType, paySign,res=>{},fail=>{})
 */
 
const wePay = (provider, timeStamp, nonceStr, packages, signType, paySign,success,fail) => (
    uni.requestPayment({
        provider,
        timeStamp,
        nonceStr,
        package: packages,
        signType,
        paySign,
        success(res) {
            success(JSON.stringify(res));
        },
        fail(err) {
            fail(JSON.stringify(err))
        }
    });
)
 
 
 
export default wePay;
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