|
@@ -19,6 +19,8 @@ export class SunPayAdapter implements ChannelAdapter {
|
|
|
customerEntity: Repository<CustomerEntity>;
|
|
|
@Config(ALL)
|
|
|
globalConfig;
|
|
|
+ @Inject()
|
|
|
+ ctx;
|
|
|
private config: {
|
|
|
apiKey: string;
|
|
|
apiSecret: string;
|
|
@@ -371,6 +373,8 @@ export class SunPayAdapter implements ChannelAdapter {
|
|
|
* @returns
|
|
|
*/
|
|
|
async setCustomerInfo(params: any = {}) {
|
|
|
+ const { merchant } = this.ctx.admin;
|
|
|
+ const merchantId = merchant.mchId;
|
|
|
// 兼容 白标 和 va平台的身份认证, 根据 openApi 判断
|
|
|
// 保存客户信息
|
|
|
const customer = await this.customerEntity.findOne({
|
|
@@ -400,7 +404,7 @@ export class SunPayAdapter implements ChannelAdapter {
|
|
|
status: res.data.status,
|
|
|
webhook_url: params.webhook_url,
|
|
|
beneficiary_id: res.data.beneficiary_id,
|
|
|
- out_user_id: params.openApi ? params.out_user_id : null // 白标用户是有 out_user_id , va商户没有
|
|
|
+ out_user_id: params.openApi ? merchantId : null // 白标用户是有 out_user_id , va商户没有
|
|
|
});
|
|
|
|
|
|
return res;
|