Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
29b3b67a
Commit
29b3b67a
authored
4 years ago
by
Damien Bouvy
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] payment_stripe: iDEAL payments
closes odoo/odoo#50535 Signed-off-by:
Damien Bouvy (dbo)
<
dbo@odoo.com
>
parent
4c321d0b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addons/payment_stripe/models/payment.py
+8
-2
8 additions, 2 deletions
addons/payment_stripe/models/payment.py
with
8 additions
and
2 deletions
addons/payment_stripe/models/payment.py
+
8
−
2
View file @
29b3b67a
...
...
@@ -38,7 +38,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
,
...
...
@@ -49,6 +49,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
...
...
@@ -102,7 +105,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 -_-
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment