Commit d32de7b1 by 许振钊

Merge branch 'feat_add_parms_220822' into 'master'

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

See merge request !1
parents b951c3f2 a20e4eed
...@@ -92,7 +92,12 @@ export type ToPayParams = { ...@@ -92,7 +92,12 @@ export type ToPayParams = {
* 微信h5支付回调地址 * 微信h5支付回调地址
* doc: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/combine/chapter10_1.shtml * 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 { export enum PayError {
......
...@@ -146,7 +146,7 @@ export class Payment { ...@@ -146,7 +146,7 @@ export class Payment {
} }
async toPay(params: ToPayParams): Promise<ToPayReturns> { 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 let quitUrl = params.quitUrl
// validate start >>> // validate start >>>
switch (payType) { switch (payType) {
...@@ -219,6 +219,8 @@ export class Payment { ...@@ -219,6 +219,8 @@ export class Payment {
quitUrl, quitUrl,
orderId, orderId,
payType, payType,
openId,
appId,
...this.computeAmount(totalAmount, this.balance), ...this.computeAmount(totalAmount, this.balance),
} }
if (payChannel !== null) { 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