fix: let Mercado Pago take the card issuer from the card number
All checks were successful
Build and deploy / Validate source (push) Successful in 4s
Build and deploy / Integration suite on a real stack (push) Successful in 2m9s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 50s

Paying with Mercado Pago's own test card failed with 10111 ("the issuer
does not have the BIN configured"): the issuer_id suggested by the card
form did not match the card. issuer_id is optional, and without it Mercado
Pago resolves the issuer from the BIN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-09-29 13:37:16 -03:00
parent e47f88a6d6
commit 8b5aafa299
2 changed files with 6 additions and 2 deletions

View File

@@ -85,8 +85,9 @@ class MercadoPagoPayment:
body.update(token=method['token'], payment_method_id=method['payment_method_id'],
installments=int(method.get('installments', 1)),
three_d_secure_mode='optional')
if method.get('issuer_id'):
body['issuer_id'] = method['issuer_id']
# No issuer_id: Mercado Pago takes the issuer from the card number.
# The form's suggestion was refused for its own test cards
# (10111, "the issuer does not have the BIN configured").
else:
raise ValueError('Unsupported payment method')
# A PIX retry must return the same code; a new one, after the last