We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0449b33 commit fb2de27Copy full SHA for fb2de27
packages/apps/pagarme-v5/src/pagarme-cancel-expireds.ts
@@ -31,6 +31,7 @@ export const cancelExpiredOrders = async () => {
31
return app?.intermediator?.code === 'pagarme';
32
});
33
if (!transaction) return;
34
+ if (transaction.status?.current !== 'pending') return;
35
const transactionDate = transaction.created_at && new Date(transaction.created_at);
36
if (!transactionDate) return;
37
const paymentMethod = transaction.payment_method.code;
@@ -43,6 +44,7 @@ export const cancelExpiredOrders = async () => {
43
44
} else {
45
return;
46
}
47
+ logger.info(`Canceling order ${_id}`, { transaction });
48
api.post(`orders/${_id}/payments_history`, {
49
transaction_id: transaction._id,
50
date_time: new Date().toISOString(),
0 commit comments