utils.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  2. def get_publishable_key(provider_sudo):
  3. """ Return the publishable key for Stripe.
  4. Note: This method serves as a hook for modules that would fully implement Stripe Connect.
  5. :param recordset provider_sudo: The provider on which the key should be read, as a sudoed
  6. `payment.provider` record.
  7. :return: The publishable key
  8. :rtype: str
  9. """
  10. return provider_sudo.stripe_publishable_key
  11. def get_secret_key(provider_sudo):
  12. """ Return the secret key for Stripe.
  13. Note: This method serves as a hook for modules that would fully implement Stripe Connect.
  14. :param recordset provider_sudo: The provider on which the key should be read, as a sudoed
  15. `payment.provider` record.
  16. :return: The secret key
  17. :rtype: str
  18. """
  19. return provider_sudo.stripe_secret_key
  20. def get_webhook_secret(provider_sudo):
  21. """ Return the webhook secret for Stripe.
  22. Note: This method serves as a hook for modules that would fully implement Stripe Connect.
  23. :param recordset provider_sudo: The provider on which the key should be read, as a sudoed
  24. `payment.provider` record.
  25. :returns: The webhook secret
  26. :rtype: str
  27. """
  28. return provider_sudo.stripe_webhook_secret