Odoo18-Base/addons/payment_stripe/utils.py
2025-03-10 11:12:23 +07:00

40 lines
1.4 KiB
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
def get_publishable_key(provider_sudo):
""" Return the publishable key for Stripe.
Note: This method serves as a hook for modules that would fully implement Stripe Connect.
:param recordset provider_sudo: The provider on which the key should be read, as a sudoed
`payment.provider` record.
:return: The publishable key
:rtype: str
"""
return provider_sudo.stripe_publishable_key
def get_secret_key(provider_sudo):
""" Return the secret key for Stripe.
Note: This method serves as a hook for modules that would fully implement Stripe Connect.
:param recordset provider_sudo: The provider on which the key should be read, as a sudoed
`payment.provider` record.
:return: The secret key
:rtype: str
"""
return provider_sudo.stripe_secret_key
def get_webhook_secret(provider_sudo):
""" Return the webhook secret for Stripe.
Note: This method serves as a hook for modules that would fully implement Stripe Connect.
:param recordset provider_sudo: The provider on which the key should be read, as a sudoed
`payment.provider` record.
:returns: The webhook secret
:rtype: str
"""
return provider_sudo.stripe_webhook_secret