Compare commits
2 Commits
8387d7ef3a
...
3c9f05041e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c9f05041e | ||
|
|
914c55c329 |
@@ -450,11 +450,14 @@ def check(auth=None, transport=None, orders=None):
|
|||||||
otherwise reports each read separately."""
|
otherwise reports each read separately."""
|
||||||
orders = orders or TinyOrders(auth=auth or TinyAuth(), transport=transport)
|
orders = orders or TinyOrders(auth=auth or TinyAuth(), transport=transport)
|
||||||
|
|
||||||
def listed(path):
|
def listed(path, **filters):
|
||||||
orders.request('GET', path, params={'limit': 1})
|
orders.request('GET', path, params={'limit': 1, **filters})
|
||||||
return 'ok'
|
return 'ok'
|
||||||
|
|
||||||
reads = [('pedidos', lambda: listed('/pedidos')), ('contatos', lambda: listed('/contatos'))]
|
# Unfiltered, a large account's order list times out ("Sua consulta levou
|
||||||
|
# muito tempo"): yesterday's orders prove the same permission.
|
||||||
|
since = (local_today() - timedelta(days=1)).isoformat()
|
||||||
|
reads = [('pedidos', lambda: listed('/pedidos', dataInicial=since)), ('contatos', lambda: listed('/contatos'))]
|
||||||
reads += [(PRODUCTS[mode], lambda mode=mode: configured_skus(orders, mode) if mode_codes(mode)
|
reads += [(PRODUCTS[mode], lambda mode=mode: configured_skus(orders, mode) if mode_codes(mode)
|
||||||
else configured_product(orders, mode)[1]) for mode in PRODUCT_SETTINGS]
|
else configured_product(orders, mode)[1]) for mode in PRODUCT_SETTINGS]
|
||||||
reads.append(('forma de envio de retirada', lambda: configured_pickup(orders)[1]))
|
reads.append(('forma de envio de retirada', lambda: configured_pickup(orders)[1]))
|
||||||
|
|||||||
@@ -193,6 +193,12 @@ amount is final.
|
|||||||
|
|
||||||
### Mercado Pago
|
### Mercado Pago
|
||||||
|
|
||||||
|
Card payments: up to 3 installments **with interest paid by the customer**;
|
||||||
|
1x has no interest (Wagner, 2026-10-14). Interest is Mercado Pago's: its card
|
||||||
|
form shows each option with the rate, and the order checks
|
||||||
|
`transaction_amount` (the price), not the total with interest. Keep "parcelamento
|
||||||
|
sem juros" off in the Mercado Pago account, or Dropstar pays the interest.
|
||||||
|
|
||||||
Required before production payment integration, not for the local mock milestone:
|
Required before production payment integration, not for the local mock milestone:
|
||||||
|
|
||||||
- Production credentials.
|
- Production credentials.
|
||||||
|
|||||||
@@ -151,6 +151,16 @@ class TinyTests(FakeTinyCase):
|
|||||||
self.assertIn('não está ativo', results['DTF UV 28,5 cm · folha montada'])
|
self.assertIn('não está ativo', results['DTF UV 28,5 cm · folha montada'])
|
||||||
self.assertEqual(results['DTF UV 28,5 cm · artes avulsas'], 'TINY_PRODUCT_UV_AVULSA sem id')
|
self.assertEqual(results['DTF UV 28,5 cm · artes avulsas'], 'TINY_PRODUCT_UV_AVULSA sem id')
|
||||||
self.assertEqual(results['pedidos'], 'ok')
|
self.assertEqual(results['pedidos'], 'ok')
|
||||||
|
# The order list is asked by date: unfiltered, Tiny times out on a large account.
|
||||||
|
asked = []
|
||||||
|
def timing_out(request):
|
||||||
|
if request.url.path.endswith('/pedidos'):
|
||||||
|
asked.append(dict(request.url.params))
|
||||||
|
if 'dataInicial' not in request.url.params:
|
||||||
|
return httpx.Response(400, json={'mensagem': 'Sua consulta levou muito tempo.'})
|
||||||
|
return self.handler(request)
|
||||||
|
self.assertEqual(check(auth=FakeAuth(), transport=httpx.MockTransport(timing_out))['pedidos'], 'ok')
|
||||||
|
self.assertEqual(asked[-1]['limit'], '1')
|
||||||
denied = check(auth=FakeAuth(), transport=httpx.MockTransport(lambda r: httpx.Response(403, text='forbidden')))
|
denied = check(auth=FakeAuth(), transport=httpx.MockTransport(lambda r: httpx.Response(403, text='forbidden')))
|
||||||
self.assertTrue(denied['pedidos'].startswith('GET /pedidos: 403'))
|
self.assertTrue(denied['pedidos'].startswith('GET /pedidos: 403'))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user