Skip to content

Commit

Permalink
fix: update order status after payment
Browse files Browse the repository at this point in the history
  • Loading branch information
Areo-Joe committed Oct 24, 2024
1 parent 3d7bb38 commit 2e8f5aa
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ Component({

try {
await pay({ id: order._id, totalPrice: order.totalPrice });
try {
await updateOrderStatus({ orderId: order._id, status: ORDER_STATUS.TO_SEND });
} catch (e) {
console.error(e);
this.triggerEvent(OPERATION_DONE_EVENT, {
type: OPERATION_TYPE.PAY,
message: 'pay failed',
success: false,
detail: e,
});
return;
}
} catch (e) {
this.triggerEvent(OPERATION_DONE_EVENT, {
type: OPERATION_TYPE.PAY,
Expand Down

0 comments on commit 2e8f5aa

Please sign in to comment.