Skip to content

Commit ebab351

Browse files
committed
allow change order amount in paid hook
1 parent 9ff84ce commit ebab351

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

handlers/payments/tasks/orderPaid.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ module.exports = function() {
2525

2626
yield* order.onPaid();
2727

28-
yield order.persist({
29-
status: Order.STATUS_SUCCESS
30-
});
28+
order.status = Order.STATUS_SUCCESS;
29+
if ("amount" in args) {
30+
order.amount = +args.amount;
31+
}
32+
33+
yield order.persist();
3134

3235
});
3336

0 commit comments

Comments
 (0)