Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add payment methods to BasePlugin
Jakub Draganek1c01757dc7c7
diff --git a/saleor/extensions/base_plugin.py b/saleor/extensions/base_plugin.pyindex 9bbb0cea57..b58b1db003 100644--- a/saleor/extensions/base_plugin.py+++ b/saleor/extensions/base_plugin.py@@ -13,7 +13,12 @@ if TYPE_CHECKING:from ..product.models import Productfrom ..account.models import Addressfrom ..order.models import OrderLine, Order- from ..payment.interface import GatewayConfig, GatewayResponse, PaymentData+ from ..payment.interface import (+ CustomerSource,+ GatewayConfig,+ GatewayResponse,+ PaymentData,+ )class BasePlugin:@@ -138,10 +143,40 @@ class BasePlugin:return NotImplementeddef authorize_payment(- self, payment_information: PaymentData, config: GatewayConfig, previous_value+ self, payment_information: PaymentData, previous_value) -> GatewayResponse:pass+ def capture_payment(+ self, payment_information: PaymentData, previous_value+ ) -> GatewayResponse:+ pass++ def refund_payment(+ self, payment_information: PaymentData, previous_value+ ) -> GatewayResponse:+ pass++ def void_payment(+ self, payment_information: PaymentData, previous_value+ ) -> GatewayResponse:+ pass++ def confirm_payment(+ self, payment_information: PaymentData, previous_value+ ) -> GatewayResponse:+ pass++ def process_payment(+ self, payment_information: PaymentData, previous_value+ ) -> GatewayResponse:+ pass++ def list_payment_sources(+ self, customer_id: str, previous_value+ ) -> List[CustomerSource]:+ pass+@classmethoddef _update_config_items(cls, configuration_to_update: List[dict], current_config: List[dict]