fix: a Site order names no Mercado Pago account in Tiny again; Tiny did not find 977344550 (DTF-API-C)
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 8m9s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m5s

Tiny refused #196 (card) and #198 (Pix) with "Meio de pagamento não
encontrado" on parcelas[0].meioPagamento.id. The payload is now the same as
before 2026-12-01's Tiny change; both orders go through on their next try.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-12-01 11:20:29 -03:00
parent fc9e6d2681
commit 2c0dd72098
2 changed files with 10 additions and 17 deletions

View File

@@ -150,11 +150,9 @@ PICKUP_EXACT = 'retirar pessoalmente'
_BOLETO = os.environ.get('TINY_RECEIPT_BOLETO', '').strip()
RECEIPT_METHODS = {'pix': 919478952, 'card': 977460722, 'cash': 919478944, 'credit': 987762591,
**({'faturado': int(_BOLETO)} if _BOLETO.isdigit() else {})}
# The account ("meio de pagamento") a Site payment lands in: MERCADO PAGO, the
# one the store's orders use (Marcus, 2026-12-01; not "MERCADO PAGO - NÃO
# USAR", 987326894). Only Pix and card paid on the Site, through Mercado Pago.
MERCADO_PAGO_ACCOUNT = 977344550
SITE_PAID = ('pix', 'card')
# A Pix or card paid on the Site names no account ("meio de pagamento"): Tiny
# answered "Meio de pagamento não encontrado" to MERCADO PAGO, 977344550, the id
# Marcus gave on 2026-12-01 (DTF-API-C, #196 and #198), so it waits for his answer.
PICKUP_CARRIER = 761565838
# Dropstar's answers: the financial category "DTF SITE" (RECEITAS, id sent on
# 2026-10-26; it goes in pagamento.categoria, and replaced the store's
@@ -673,10 +671,6 @@ def order_payload(payload, contact_id, today=None, product_id=None, shipping=Non
account = setting('TINY_BOLETO_ACCOUNT')
if method == 'faturado' and account.isdigit():
parcela['meioPagamento'] = {'id': int(account)}
# Paid on the Site: the money is in the Mercado Pago account. An order
# the team registered as paid outside (D-35) names no account.
elif method in SITE_PAID and not (payload.get('payment') or {}).get('outside'):
parcela['meioPagamento'] = {'id': MERCADO_PAGO_ACCOUNT}
pedido['pagamento'].update({'formaRecebimento': {'id': received}, 'parcelas': [parcela]})
destination = order.get('destination')
if destination: