update get status of tsp provider
This commit is contained in:
@@ -53,7 +53,7 @@ export class SalesInvoiceTspService {
|
||||
},
|
||||
})
|
||||
|
||||
const result = await trySend(this.tspSwitchService, payload)
|
||||
const result = await this.tspSwitchService.send(payload)
|
||||
return await onResult(this.prisma, result, attempt.id)
|
||||
}
|
||||
|
||||
@@ -152,31 +152,7 @@ export class SalesInvoiceTspService {
|
||||
business_activity.partner_token,
|
||||
)
|
||||
|
||||
if (!result) {
|
||||
throw new NotFoundException('نتیجه ارسال فاکتور یافت نشد.')
|
||||
}
|
||||
|
||||
const updatedAttempt = await this.prisma.saleInvoiceTspAttempts.update({
|
||||
where: {
|
||||
id: attempt.id,
|
||||
},
|
||||
data: {
|
||||
provider_response: JSON.parse(JSON.stringify(result)),
|
||||
status: result.status,
|
||||
received_at: result.received_at,
|
||||
},
|
||||
select: {
|
||||
status: true,
|
||||
invoice: true,
|
||||
message: true,
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
invoice: updatedAttempt.invoice,
|
||||
status: updatedAttempt.status,
|
||||
message: updatedAttempt.message,
|
||||
}
|
||||
return await onResult(this.prisma, result, attempt.id)
|
||||
}
|
||||
|
||||
async correctionSend(
|
||||
|
||||
Reference in New Issue
Block a user