Skip to content

Commit

Permalink
[IMP] Add binary mode in payment acquirer
Browse files Browse the repository at this point in the history
  • Loading branch information
filoquin committed Jan 25, 2023
1 parent 47b2b27 commit 00ec372
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion payment_mercadopago/__manifest__.py
Expand Up @@ -3,7 +3,7 @@
'name': 'MercadoPago Payment Acquirer',
'category': 'Accounting/Payment',
'summary': 'Payment Acquirer: MercadoPago',
'version': '13.0.1.11.0',
'version': '13.0.1.12.0',
'author': 'ADHOC SA',
'website': 'www.adhoc.com.ar',
'description': """MercadoPago Payment Acquirer""",
Expand Down
2 changes: 1 addition & 1 deletion payment_mercadopago/models/mercadopago_request.py
Expand Up @@ -173,7 +173,7 @@ def payment(self, tx, amount, capture=True, cvv_token=None):
"transaction_amount": amount,
"description": _("Odoo ~ MercadoPago payment"),
"payment_method_id": tx.payment_token_id.acquirer_ref,
"binary_mode": True if tx.type != 'validation' else False,
"binary_mode": tx.acquirer_id.mercadopago_binary if tx.type != 'validation' else False,
"external_reference": tx.reference,
"payer": {
"type": "customer",
Expand Down
1 change: 1 addition & 0 deletions payment_mercadopago/models/payment.py
Expand Up @@ -47,6 +47,7 @@ class PaymentAcquirerMercadoPago(models.Model):
string='Capture method',
default='deferred_capture'
)
mercadopago_binary = fields.Boolean('Use binary mode')

def _get_feature_support(self):
"""Get advanced feature support by provider.
Expand Down
1 change: 1 addition & 0 deletions payment_mercadopago/views/payment_views.xml
Expand Up @@ -10,6 +10,7 @@
<field name="mercadopago_publishable_key" attrs="{'required': [('provider', '=', 'mercadopago'), ('state', '!=', 'disabled')]}"/>
<field name="mercadopago_access_token" password="True" attrs="{'required': [('provider', '=', 'mercadopago'), ('state', '!=', 'disabled')]}"/>
<field name="mercadopago_capture_method" attrs="{'invisible': [('payment_flow', '!=', 's2s')]}"/>
<field name="mercadopago_binary" attrs="{'invisible': [('payment_flow', '!=', 's2s')]}"/>
</group>
</xpath>
<xpath expr='//group[@name="acquirer"]' position='after'>
Expand Down

0 comments on commit 00ec372

Please sign in to comment.