Payment Method

class odoo.addons.payment.models.payment_method.PaymentMethod[源代码]
_get_compatible_payment_methods(provider_ids, partner_id, currency_id=None, force_tokenization=False, is_express_checkout=False, **kwargs)[源代码]

Search and return the payment methods matching the compatibility criteria.

The compatibility criteria are that payment methods must: be supported by at least one of the providers; support the country of the partner if it exists; be primary payment methods (not a brand). If provided, the optional keyword arguments further refine the criteria.

参数
  • provider_ids (list) – The list of providers by which the payment methods must be at least partially supported to be considered compatible, as a list of payment.provider ids.

  • partner_id (int) – The partner making the payment, as a res.partner id.

  • currency_id (int) – The payment currency, if known beforehand, as a res.currency id.

  • force_tokenization (bool) – Whether only payment methods supporting tokenization can be matched.

  • is_express_checkout (bool) – Whether the payment is made through express checkout.

  • kwargs (dict) – Optional data. This parameter is not used here.

返回

The compatible payment methods.

返回类型

payment.method

_get_from_code(code, mapping=None)[源代码]

Get the payment method corresponding to the given provider-specific code.

If a mapping is given, the search uses the generic payment method code that corresponds to the given provider-specific code.

参数
  • code (str) – The provider-specific code of the payment method to get.

  • mapping (dict) – A non-exhaustive mapping of generic payment method codes to provider-specific codes.

返回

The corresponding payment method, if any.

Type

payment.method