|
@@ -39,7 +39,7 @@ export class BusinessService extends BaseService {
|
|
|
* @param params
|
|
|
* @returns
|
|
|
*/
|
|
|
- async add(params) {
|
|
|
+ async add(params) {
|
|
|
const { merchant } = this.ctx.admin;
|
|
|
const merchantId = merchant.mchId;
|
|
|
const custom = {
|
|
@@ -48,18 +48,25 @@ export class BusinessService extends BaseService {
|
|
|
webhook_url: this.getWebhook_url(params),
|
|
|
customer_type: 'COMPANY',
|
|
|
openApi: this.ctx.admin?.openApi || false
|
|
|
- };
|
|
|
+ };
|
|
|
let res = await this.paymentService
|
|
|
.setChannel('SUNPAY')
|
|
|
.setCustomerInfo(custom);
|
|
|
+
|
|
|
if (merchantId) {
|
|
|
params.merchantId = params?.mch_id || params?.mchId || merchantId
|
|
|
}
|
|
|
- await super.add({
|
|
|
- ...params,
|
|
|
- ...params.company,
|
|
|
- customer_id: res.data.customer_id,
|
|
|
- });
|
|
|
+ try {
|
|
|
+ await super.add({
|
|
|
+ ...params,
|
|
|
+ ...params.company,
|
|
|
+ status: 0,
|
|
|
+ customer_id: res.data.customer_id,
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+
|
|
|
return res;
|
|
|
}
|
|
|
async update(param) {
|