feat: the team no longer gets alert e-mails; the Kanban user form drops the option
All checks were successful
Build and deploy / Validate source (push) Successful in 47s
Build and deploy / Integration suite on a real stack (push) Successful in 3m38s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m20s
All checks were successful
Build and deploy / Validate source (push) Successful in 47s
Build and deploy / Integration suite on a real stack (push) Successful in 3m38s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m20s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -107,8 +107,6 @@ def create_order(c, quote, payment):
|
||||
{'order_id': str(order['id']), 'number': order['number'],
|
||||
'event': 'payment_approved', 'order': approved,
|
||||
'payment': {'method': paid['method']} if paid else {}})
|
||||
mail.alert(c, f"Pedido #{order['number']} pago · {mail.money(approved['total_cents'])}",
|
||||
['Um pedido novo foi pago e está em Arte recebida.', '', *mail.summary(approved)], '/')
|
||||
return order, True
|
||||
|
||||
|
||||
@@ -127,19 +125,8 @@ def apply(c, event):
|
||||
|
||||
Outcomes starting 'refused' (money arrived, no order) or 'attention' (an
|
||||
order exists but its payment was reversed) stay on the Kanban until an
|
||||
operator records a resolution, and the team is told by e-mail.
|
||||
operator records a resolution.
|
||||
"""
|
||||
outcome = _apply(c, event)
|
||||
if outcome.startswith(('refused', 'attention')):
|
||||
paid = mail.money(event.amount_cents) if type(event.amount_cents) is int else 'valor não informado'
|
||||
mail.alert(c, f'Pagamento precisa de atenção · {paid}',
|
||||
['O Mercado Pago avisou de um pagamento que não virou pedido, ou que foi estornado depois.',
|
||||
'Abra Pagamentos no Kanban para ver o que aconteceu e registrar a resolução.', '',
|
||||
f'Situação: {event.status} · cotação {event.reference or "—"}', f'Registro: {outcome}'], '/')
|
||||
return outcome
|
||||
|
||||
|
||||
def _apply(c, event):
|
||||
provider_id = event.raw.get('payment_id')
|
||||
if provider_id:
|
||||
c.execute('''UPDATE dtf_local.payment_intents SET status=%s, updated_at=now()
|
||||
|
||||
Reference in New Issue
Block a user