fix: card goes back to forma de recebimento 977460722, which Tiny accepts; 919478945 is not enabled there (DTF-API-C)
All checks were successful
Build and deploy / Validate source (push) Successful in 54s
Build and deploy / Integration suite on a real stack (push) Successful in 8m24s
Build and deploy / Secret scan and release gate (push) Successful in 11s
Build and deploy / Publish images (push) Successful in 1m38s
All checks were successful
Build and deploy / Validate source (push) Successful in 54s
Build and deploy / Integration suite on a real stack (push) Successful in 8m24s
Build and deploy / Secret scan and release gate (push) Successful in 11s
Build and deploy / Publish images (push) Successful in 1m38s
Tiny refused a paid Site order with "Forma de recebimento não está habilitada" after card moved to 919478945. The order waits in the outbox and goes through on its next try. The MERCADO PAGO account stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -144,10 +144,11 @@ PICKUP_EXACT = 'retirar pessoalmente'
|
|||||||
# "CORREÇÃO DTF", used for it before, is for correction orders only. "Boleto" is
|
# "CORREÇÃO DTF", used for it before, is for correction orders only. "Boleto" is
|
||||||
# for a montador Venda order (front 7a.3); no id is known yet, and while
|
# for a montador Venda order (front 7a.3); no id is known yet, and while
|
||||||
# TINY_RECEIPT_BOLETO is empty the order goes without a forma de recebimento.
|
# TINY_RECEIPT_BOLETO is empty the order goes without a forma de recebimento.
|
||||||
# Cartão de crédito is 919478945 (Marcus, 2026-12-01; 977460722, read from a
|
# Cartão de crédito stays 977460722, read from a store order on 2026-10-19:
|
||||||
# store order on 2026-10-19, was not the forma he names).
|
# the 919478945 Marcus named on 2026-12-01 is not enabled in Tiny ("Forma de
|
||||||
|
# recebimento não está habilitada", DTF-API-C), so it waits for his answer.
|
||||||
_BOLETO = os.environ.get('TINY_RECEIPT_BOLETO', '').strip()
|
_BOLETO = os.environ.get('TINY_RECEIPT_BOLETO', '').strip()
|
||||||
RECEIPT_METHODS = {'pix': 919478952, 'card': 919478945, 'cash': 919478944, 'credit': 987762591,
|
RECEIPT_METHODS = {'pix': 919478952, 'card': 977460722, 'cash': 919478944, 'credit': 987762591,
|
||||||
**({'faturado': int(_BOLETO)} if _BOLETO.isdigit() else {})}
|
**({'faturado': int(_BOLETO)} if _BOLETO.isdigit() else {})}
|
||||||
# The account ("meio de pagamento") a Site payment lands in: MERCADO PAGO, the
|
# 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
|
# one the store's orders use (Marcus, 2026-12-01; not "MERCADO PAGO - NÃO
|
||||||
|
|||||||
@@ -485,9 +485,10 @@ class TinyStatusTests(FakeTinyCase):
|
|||||||
self.assertEqual(pickup['pagamento'], {'categoria': {'id': CATEGORY}, 'formaRecebimento': {'id': RECEIPT_METHODS['pix']},
|
self.assertEqual(pickup['pagamento'], {'categoria': {'id': CATEGORY}, 'formaRecebimento': {'id': RECEIPT_METHODS['pix']},
|
||||||
'parcelas': [{'dias': 0, 'data': '2026-09-24', 'valor': 84.72, 'formaRecebimento': {'id': RECEIPT_METHODS['pix']},
|
'parcelas': [{'dias': 0, 'data': '2026-09-24', 'valor': 84.72, 'formaRecebimento': {'id': RECEIPT_METHODS['pix']},
|
||||||
'meioPagamento': {'id': 977344550}}]})
|
'meioPagamento': {'id': 977344550}}]})
|
||||||
# The forma de recebimento ids Marcus listed on 2026-12-01.
|
# The forma de recebimento ids: card stays the one Tiny accepts, 977460722;
|
||||||
|
# 919478945, which Marcus named on 2026-12-01, is not enabled (DTF-API-C).
|
||||||
self.assertEqual((RECEIPT_METHODS['pix'], RECEIPT_METHODS['card'], RECEIPT_METHODS['credit']),
|
self.assertEqual((RECEIPT_METHODS['pix'], RECEIPT_METHODS['card'], RECEIPT_METHODS['credit']),
|
||||||
(919478952, 919478945, 987762591))
|
(919478952, 977460722, 987762591))
|
||||||
# Delivery: the Correios contract's PAC or SEDEX, or Jadlog; the date in working days.
|
# Delivery: the Correios contract's PAC or SEDEX, or Jadlog; the date in working days.
|
||||||
for service, method, frete in (('pac', 78, 781), ('sedex', 78, 782), ('jadlog', 80, 801)):
|
for service, method, frete in (('pac', 78, 781), ('sedex', 78, 782), ('jadlog', 80, 801)):
|
||||||
order = {**PAID['order'], 'freight': {'service': service, 'total_cents': 1500, 'days': 6}}
|
order = {**PAID['order'], 'freight': {'service': service, 'total_cents': 1500, 'days': 6}}
|
||||||
|
|||||||
Reference in New Issue
Block a user