Commit a20e4eed by liusl

feat(custom): add pay params appId\&openId

parent b951c3f2
......@@ -92,7 +92,12 @@ export type ToPayParams = {
* 微信h5支付回调地址
* doc: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/combine/chapter10_1.shtml
*/
redirectUrl?: string
redirectUrl?: string;
/**
* 用户在微信公众号或小程序的openId
*/
openId?: string;
appId?: string;
}
export enum PayError {
......
......@@ -146,7 +146,7 @@ export class Payment {
}
async toPay(params: ToPayParams): Promise<ToPayReturns> {
const {totalAmount, payType, returnUrl, orderId, redirectUrl} = params
const {totalAmount, payType, returnUrl, orderId, redirectUrl, openId, appId,} = params
let quitUrl = params.quitUrl
// validate start >>>
switch (payType) {
......@@ -219,6 +219,8 @@ export class Payment {
quitUrl,
orderId,
payType,
openId,
appId,
...this.computeAmount(totalAmount, this.balance),
}
if (payChannel !== null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment