fix: ppob callback
This commit is contained in:
parent
c26294ac50
commit
6f29457720
|
@ -43,6 +43,9 @@ export class CheckBillHistory extends BaseModel {
|
|||
@Column()
|
||||
product_code: string;
|
||||
|
||||
@Column()
|
||||
status: string;
|
||||
|
||||
@ManyToOne(() => ProductHistoryPrice, (product) => product.id)
|
||||
product_price: ProductHistoryPrice;
|
||||
}
|
||||
|
|
|
@ -158,14 +158,19 @@ export class TransactionController {
|
|||
@Get('check-bill-history')
|
||||
async getCheckBillHistory(
|
||||
@Param('id') id: string,
|
||||
@Query('page') page: number,
|
||||
@Query('pageSize') pageSize: number,
|
||||
@Request() req,
|
||||
) {
|
||||
const data = await this.transactionService.findAll(
|
||||
const [data, count] = await this.transactionService.findAll(
|
||||
req.user.userId,
|
||||
page,
|
||||
pageSize,
|
||||
);
|
||||
|
||||
return {
|
||||
...data,
|
||||
data,
|
||||
count,
|
||||
statusCode: HttpStatus.OK,
|
||||
message: 'success',
|
||||
};
|
||||
|
|
|
@ -887,6 +887,7 @@ export class TransactionService {
|
|||
product_code: orderTransactionDto.productCode,
|
||||
partner_trx_id: orderTransactionDto.trx_id,
|
||||
product_price: product_price,
|
||||
status: 'PENDING',
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -1399,9 +1400,9 @@ export class TransactionService {
|
|||
}
|
||||
}
|
||||
|
||||
async findAll(user: string) {
|
||||
async findAll(user: string, page, pageSize?) {
|
||||
try {
|
||||
return this.checkBillHistoryRepository.find({
|
||||
return await this.checkBillHistoryRepository.findAndCount({
|
||||
where: {
|
||||
user: user,
|
||||
},
|
||||
|
@ -1414,6 +1415,8 @@ export class TransactionService {
|
|||
'partner_trx_id',
|
||||
'createdAt',
|
||||
],
|
||||
skip: page * (pageSize || 10),
|
||||
take: pageSize || 10,
|
||||
order: {
|
||||
createdAt: 'DESC',
|
||||
}
|
||||
|
@ -1859,6 +1862,7 @@ export class TransactionService {
|
|||
{
|
||||
amount: amount + product_price.partner_fee + product_price.mark_up_price,
|
||||
admin_price: admin,
|
||||
status: status ? 'SUCCESS' : 'FAILED',
|
||||
},
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user