|
@@ -55,7 +55,7 @@ export class PayeeService extends BaseService {
|
|
|
.setChannel(customer.channel)
|
|
|
.addPayee(custom);
|
|
|
params.beneficiary_id = res.data.id;
|
|
|
- params.customerId = customer.id;
|
|
|
+ params.customerId = customer.customer_id;
|
|
|
params.merchantId = merchant.mchId;
|
|
|
params.channel = customer.channel;
|
|
|
params.type = customer.type ? 'COMPANY' : 'INDIVIDUAL';
|
|
@@ -103,6 +103,20 @@ export class PayeeService extends BaseService {
|
|
|
return res;
|
|
|
}
|
|
|
async delete(params: any) {
|
|
|
+ if(this.ctx.admin?.openApi) {
|
|
|
+ const payee = await this.payeeEntity.findOneBy({
|
|
|
+ beneficiary_id: params.id
|
|
|
+ })
|
|
|
+ const res = await this.paymentService
|
|
|
+ .setChannel(params.channel || 'SUNPAY')
|
|
|
+ .deletePayee(params);
|
|
|
+ try{
|
|
|
+ payee && await super.delete([payee.id]);
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
+ return res
|
|
|
+ }
|
|
|
const res = await this.paymentService
|
|
|
.setChannel(params.channel)
|
|
|
.deletePayee(params);
|