Skip to content
Snippets Groups Projects
Commit 3b80166e authored by Damien Bouvy's avatar Damien Bouvy
Browse files

[FIX] payment_stripe: iDEAL payments


closes odoo/odoo#50546

X-original-commit: 29b3b67a
Signed-off-by: default avatarDamien Bouvy (dbo) <dbo@odoo.com>
parent db1cabc7
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ class PaymentAcquirerStripe(models.Model):
base_url = self.get_base_url()
stripe_session_data = {
'payment_method_types[]': 'card',
'payment_method_types[0]': 'card',
'line_items[][amount]': int(tx_values['amount'] if tx_values['currency'].name in INT_CURRENCIES else float_round(tx_values['amount'] * 100, 2)),
'line_items[][currency]': tx_values['currency'].name,
'line_items[][quantity]': 1,
......@@ -51,6 +51,9 @@ class PaymentAcquirerStripe(models.Model):
'payment_intent_data[description]': tx_values['reference'],
'customer_email': tx_values.get('partner_email') or tx_values.get('billing_partner_email'),
}
if tx_values.get('billing_partner_country').code.lower() == 'nl' and tx_values.get('currency').name.lower() == 'eur':
# enable iDEAL for NL-based customers (€ payments only)
stripe_session_data['payment_method_types[1]'] = 'ideal'
tx_values['session_id'] = self._create_stripe_session(stripe_session_data)
return tx_values
......@@ -104,7 +107,10 @@ class PaymentAcquirerStripe(models.Model):
@api.model
def stripe_s2s_form_process(self, data):
last4 = data.get('card', {}).get('last4')
if not data.get('card'):
# can't save the token if it's not a card (e.g. iDEAL)
return self.env['payment.token']
last4 = data.get('card').get('last4')
if not last4:
# PM was created with a setup intent, need to get last4 digits through
# yet another call -_-
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment