set status to paid just for pending payment
This commit is contained in:
@@ -203,8 +203,11 @@ export class PaymentsService {
|
||||
this.failPayment(payment);
|
||||
return payment;
|
||||
}
|
||||
|
||||
this.markPaid(payment, result.referenceId);
|
||||
this.confirmOrder(payment.order);
|
||||
if(payment.order.status === OrderStatus.PENDING_PAYMENT) {
|
||||
payment.order.status = OrderStatus.PAID;
|
||||
}
|
||||
|
||||
await em.flush();
|
||||
return payment;
|
||||
@@ -259,7 +262,7 @@ export class PaymentsService {
|
||||
payment.order.status = OrderStatus.CANCELED;
|
||||
}
|
||||
|
||||
private confirmOrder(order: Order) {
|
||||
private markAsPaid(order: Order) {
|
||||
order.status = OrderStatus.PAID;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user