|
@@ -72,19 +72,34 @@ export class PayeeService extends BaseService {
|
|
|
}
|
|
|
async update(params: any) {
|
|
|
let customer = await this.getCustomer(params);
|
|
|
- const payee = await this.payeeEntity.findOneBy({
|
|
|
- id: params.id,
|
|
|
- });
|
|
|
+ let payee;
|
|
|
+ if(this.ctx.admin?.openApi) {
|
|
|
+ payee = await this.payeeEntity.findOneBy({
|
|
|
+ beneficiary_id: params.id,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ payee = await this.payeeEntity.findOneBy({
|
|
|
+ id: params.id,
|
|
|
+ });
|
|
|
+ }
|
|
|
const custom = {
|
|
|
...params,
|
|
|
customer_id: customer.customer_id,
|
|
|
beneficiary_type: customer.type ? 'COMPANY' : 'INDIVIDUAL',
|
|
|
- id: payee.beneficiary_id,
|
|
|
};
|
|
|
+ if(!this.ctx.admin?.openApi) {
|
|
|
+ custom.id = payee.beneficiary_id
|
|
|
+ }
|
|
|
const res = await this.paymentService
|
|
|
.setChannel(customer.channel)
|
|
|
.updatePayee(custom);
|
|
|
- await super.update(params);
|
|
|
+ await super.update({
|
|
|
+ ...params,
|
|
|
+ id: payee.id
|
|
|
+ });
|
|
|
+ if(this.ctx.admin?.openApi) {
|
|
|
+ return res
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
async delete(params: any) {
|