Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove authorize.net plugin (#19142)
Lukasz Ostrowski6dc148db9ffd
diff --git a/.github/workflows/check-licenses.yaml b/.github/workflows/check-licenses.yamlindex ac9366afb9..922ef56903 100644--- a/.github/workflows/check-licenses.yaml+++ b/.github/workflows/check-licenses.yaml@@ -48,7 +48,3 @@ jobs:reason: >-Proprietary licenses are not compatible with BSD-3-Clause.They need to be reviewed on a case-by-case basis.- exceptions:- # Authorize.Net Python SDK was reviewed as compatible with our project.- # License: https://github.com/AuthorizeNet/sdk-python/blob/bfcfb73ac74e33544845e435bb2ad54a22641583/LICENSE.txt- - authorizenetdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex 94e2f293dc..74064a936e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,6 +6,8 @@ All notable, unreleased changes to this project will be documented in this file.### Breaking changes+- Removed the deprecated Authorize.Net payment gateway plugin (`mirumee.payments.authorize_net`).+### GraphQL API### Webhooksdiff --git a/pyproject.toml b/pyproject.tomlindex 307cb10a7b..2308114676 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -13,7 +13,6 @@ license = "BSD-3-Clause"dependencies = ["asgiref>=3.7.2,<4","authlib>=1.6.9,<2",- "authorizenet>=1.1.5,<2","azure-common>=1.1.28,<2","azure-storage-blob>=12.23.1,<13","azure-storage-common>=2.1.0,<3",diff --git a/saleor/payment/gateways/authorize_net/__init__.py b/saleor/payment/gateways/authorize_net/__init__.pydeleted file mode 100644index 9b4ca13ff4..0000000000--- a/saleor/payment/gateways/authorize_net/__init__.py+++ /dev/null@@ -1,463 +0,0 @@-import json-from typing import Any, Union--from authorizenet import apicontractsv1-from authorizenet.apicontrollers import (- constants,- createTransactionController,- getCustomerProfileController,-)-from lxml import etree-from lxml.objectify import ObjectifiedElement--from ....core.http_client import HTTPClient-from ... import TransactionKind-from ...interface import (- CustomerSource,- GatewayConfig,- GatewayResponse,- PaymentData,- PaymentMethodInfo,-)---def authenticate_test(- name: str, transaction_key: str, use_sandbox: bool-) -> tuple[bool, str]:- """Check if credentials are correct.-- This API is not present in the authorizenet Python package.- https://developer.authorize.net/api/reference/index.html#gettingstarted-section-section-header- """- if use_sandbox is True:- url = constants.SANDBOX- else:- url = constants.PRODUCTION- data = {- "authenticateTestRequest": {- "merchantAuthentication": {"name": name, "transactionKey": transaction_key}- }- }- response = HTTPClient.send_request(- "POST",- url,- json=data,- headers={"content-type": "application/json"},- allow_redirects=False,- )- # Response content is utf-8-sig, which requires usage of json.loads- result = json.loads(response.content)- message = ""- if result.get("messages", {}).get("resultCode") == "Ok":- return True, ""- response_message = result.get("messages", {}).get("message")- if len(response_message) > 0:- message = response_message[0].get("text", "")- return False, message---def process_payment(- payment_information: PaymentData,- config: GatewayConfig,- user_id: int | None = None,-) -> GatewayResponse:- return authorize(payment_information, config, user_id=user_id)---def capture(payment_information: PaymentData, config: GatewayConfig) -> GatewayResponse:- merchant_auth = _get_merchant_auth(config.connection_params)-- transaction_request = apicontractsv1.transactionRequestType()- transaction_request.transactionType = "priorAuthCaptureTransaction"- transaction_request.amount = payment_information.amount- transaction_request.currencyCode = payment_information.currency- transaction_request.refTransId = payment_information.token-- create_transaction_request = apicontractsv1.createTransactionRequest()- create_transaction_request.merchantAuthentication = merchant_auth- create_transaction_request.transactionRequest = transaction_request-- response = _make_request(create_transaction_request, config.connection_params)-- (- success,- error,- transaction_id,- transaction_response,- raw_response,- ) = _handle_authorize_net_response(response)- payment_method_info = _authorize_net_account_to_payment_method_info(- transaction_response- )- return GatewayResponse(- is_success=success,- action_required=False,- transaction_id=transaction_id,- amount=payment_information.amount,- currency=payment_information.currency,- error=error,- payment_method_info=payment_method_info,- kind=TransactionKind.CAPTURE,- raw_response=raw_response,- customer_id=payment_information.customer_id,- )---def authorize(- payment_information: PaymentData,- config: GatewayConfig,- user_id: int | None = None,-) -> GatewayResponse:- """Based on AcceptSuite create-an-accept-payment-transaction example.-- https://github.com/AuthorizeNet/sample-code-python/blob/master/AcceptSuite/create-an-accept-payment-transaction.py- """- kind = TransactionKind.CAPTURE if config.auto_capture else TransactionKind.AUTH- merchant_auth = _get_merchant_auth(config.connection_params)-- # The Saleor token is the authorize.net "opaque data"- opaque_data = apicontractsv1.opaqueDataType()- opaque_data.dataDescriptor = "COMMON.ACCEPT.INAPP.PAYMENT"- opaque_data.dataValue = payment_information.token-- payment_one = apicontractsv1.paymentType()- payment_one.opaqueData = opaque_data-- order = apicontractsv1.orderType()- order.invoiceNumber = payment_information.order_id- order.description = payment_information.graphql_payment_id-- # An auth.net "profile" id is the id generated by auth.net.- # It is not the Saleor user id.- customer_id = (- payment_information.customer_id if payment_information.reuse_source else None- )-- customer_data = apicontractsv1.customerDataType()- customer_data.type = "individual"- if user_id:- customer_data.id = str(user_id)- customer_data.email = payment_information.customer_email-- transaction_request = apicontractsv1.transactionRequestType()- transaction_request.transactionType = (- "authCaptureTransaction" if config.auto_capture else "authOnlyTransaction"- )- transaction_request.amount = payment_information.amount- transaction_request.currencyCode = payment_information.currency- transaction_request.order = order- transaction_request.payment = payment_one- transaction_request.customer = customer_data-- if payment_information.reuse_source and customer_id is None:- profile = apicontractsv1.customerProfilePaymentType()- profile.createProfile = True- transaction_request.profile = profile-- if payment_information.billing:- customer_address = apicontractsv1.customerAddressType()- customer_address.firstName = payment_information.billing.first_name- customer_address.lastName = payment_information.billing.last_name- customer_address.company = payment_information.billing.company_name- # authorize.net support says we should not attempt submitting street_address_2- customer_address.address = payment_information.billing.street_address_1- customer_address.city = payment_information.billing.city- customer_address.state = payment_information.billing.country_area- customer_address.zip = payment_information.billing.postal_code- customer_address.country = payment_information.billing.country- transaction_request.billTo = customer_address-- create_transaction_request = apicontractsv1.createTransactionRequest()- create_transaction_request.merchantAuthentication = merchant_auth- create_transaction_request.refId = str(payment_information.payment_id)- create_transaction_request.transactionRequest = transaction_request-- response = _make_request(create_transaction_request, config.connection_params)-- (- success,- error,- transaction_id,- transaction_response,- raw_response,- ) = _handle_authorize_net_response(response)- psp_reference = None- if transaction_id:- psp_reference = transaction_id- elif payment_information.token:- transaction_id = payment_information.token-- if hasattr(response, "profileResponse") and hasattr(- response.profileResponse, "customerProfileId"- ):- customer_id = response.profileResponse.customerProfileId-- payment_method_info = _authorize_net_account_to_payment_method_info(- transaction_response- )-- return GatewayResponse(- is_success=success,- action_required=False,- transaction_id=transaction_id,- amount=payment_information.amount,- currency=payment_information.currency,- error=error,- payment_method_info=payment_method_info,- kind=kind,- raw_response=raw_response,- customer_id=customer_id,- psp_reference=str(psp_reference) if psp_reference else None,- )---def void(payment_information: PaymentData, config: GatewayConfig) -> GatewayResponse:- merchant_auth = _get_merchant_auth(config.connection_params)-- transaction_request = apicontractsv1.transactionRequestType()- transaction_request.transactionType = "voidTransaction"- transaction_request.refTransId = payment_information.token-- create_transaction_request = apicontractsv1.createTransactionRequest()- create_transaction_request.merchantAuthentication = merchant_auth- create_transaction_request.transactionRequest = transaction_request-- response = _make_request(create_transaction_request, config.connection_params)-- (- success,- error,- transaction_id,- transaction_response,- raw_response,- ) = _handle_authorize_net_response(response)- payment_method_info = _authorize_net_account_to_payment_method_info(- transaction_response- )- return GatewayResponse(- is_success=success,- action_required=False,- transaction_id=transaction_id,- amount=payment_information.amount,- currency=payment_information.currency,- error=error,- payment_method_info=payment_method_info,- kind=TransactionKind.VOID,- raw_response=raw_response,- customer_id=payment_information.customer_id,- )---def list_client_sources(- config: GatewayConfig, customer_id: str-) -> list[CustomerSource]:- merchant_auth = _get_merchant_auth(config.connection_params)-- get_customer_profile = apicontractsv1.getCustomerProfileRequest()- get_customer_profile.merchantAuthentication = merchant_auth- get_customer_profile.customerProfileId = customer_id- get_customer_profile.unmaskExpirationDate = True- controller = getCustomerProfileController(get_customer_profile)- if not config.connection_params.get("use_sandbox"):- controller.setenvironment(constants.PRODUCTION)- controller.execute()-- response = controller.getresponse()- results = []-- if hasattr(response, "profile") and hasattr(response.profile, "paymentProfiles"):- for payment_profile in response.profile.paymentProfiles:- if hasattr(payment_profile, "payment") and hasattr(- payment_profile.payment, "creditCard"- ):- name = None- if hasattr(payment_profile, "billTo"):- first = payment_profile.billTo.firstName.pyval- last = payment_profile.billTo.lastName.pyval- if first:- name = first + " " + last- else:- name = last- card = payment_profile.payment.creditCard- expiration_year, expiration_month = _normalize_card_expiration(- card.expirationDate.pyval- )- results.append(- CustomerSource(- id=payment_profile.customerPaymentProfileId.pyval,- gateway="authorize.net",- credit_card_info=PaymentMethodInfo(- exp_year=expiration_year,- exp_month=expiration_month,- last_4=_normalize_last_4(card.cardNumber.pyval),- brand=card.cardType.pyval,- name=name,- ),- )- )- return results---def refund(- payment_information: PaymentData, cc_last_digits: str, config: GatewayConfig-) -> GatewayResponse:- merchant_auth = _get_merchant_auth(config.connection_params)-- credit_card = apicontractsv1.creditCardType()- credit_card.cardNumber = cc_last_digits- credit_card.expirationDate = "XXXX"-- payment = apicontractsv1.paymentType()- payment.creditCard = credit_card-- transaction_request = apicontractsv1.transactionRequestType()- transaction_request.transactionType = "refundTransaction"- transaction_request.amount = payment_information.amount- transaction_request.currencyCode = payment_information.currency- # set refTransId to transId of a settled transaction- transaction_request.refTransId = payment_information.token- transaction_request.payment = payment-- create_transaction_request = apicontractsv1.createTransactionRequest()- create_transaction_request.merchantAuthentication = merchant_auth-- create_transaction_request.transactionRequest = transaction_request- response = _make_request(create_transaction_request, config.connection_params)-- (- success,- error,- transaction_id,- transaction_response,- raw_response,- ) = _handle_authorize_net_response(response)- payment_method_info = _authorize_net_account_to_payment_method_info(- transaction_response- )-- return GatewayResponse(- is_success=success,- action_required=False,- transaction_id=transaction_id,- amount=payment_information.amount,- currency=payment_information.currency,- error=error,- payment_method_info=payment_method_info,- kind=TransactionKind.REFUND,- raw_response=raw_response,- customer_id=payment_information.customer_id,- )---def _handle_authorize_net_response(- response: ObjectifiedElement,-) -> tuple[bool, str | None, str, Any, Any]:- success = False- error: str | None = None- transaction_id: int | None = None- transaction_response: Any = None- raw_response = ""- if response is not None:- raw_response = etree.tostring(response).decode()- if hasattr(response, "transactionResponse"):- transaction_response = response.transactionResponse[0]- if (- hasattr(transaction_response, "transId")- and transaction_response.transId- ):- transaction_id = transaction_response.transId.pyval- if response.messages.resultCode == "Ok":- if hasattr(response.transactionResponse, "messages"):- success = True- elif hasattr(response.transactionResponse, "errors"):- error = response.transactionResponse.errors.error[0].errorText.pyval- else:- if hasattr(response, "transactionResponse") and hasattr(- response.transactionResponse, "errors"- ):- error = response.transactionResponse.errors.error[0].errorText.pyval- else:- error = response.messages.message[0]["text"].text- else:- error = "Null Response"- transaction_id = str(transaction_id) if transaction_id else ""- return (- success,- error,- transaction_id,- transaction_response,- raw_response,- )---def _authorize_net_account_to_payment_method_info(- transaction_response: Union["ObjectifiedElement", None],-) -> PaymentMethodInfo | None:- """Transform Authorize.Net transactionResponse to Saleor credit card.-- accountNumber: "XXXX0015"- accountType: "Mastercard"-- becomes-- last_4="0015"- brand="mastercard"- """- if (- transaction_response is not None- and hasattr(transaction_response, "accountNumber")- and hasattr(transaction_response, "accountType")- ):- return PaymentMethodInfo(- last_4=_normalize_last_4(transaction_response.accountNumber.pyval),- brand=transaction_response.accountType.pyval.lower(),- type="card",- )- return None---def _get_merchant_auth(connection_params: dict[str, Any]):- merchant_auth = apicontractsv1.merchantAuthenticationType()- merchant_auth.name = connection_params.get("api_login_id")- merchant_auth.transactionKey = connection_params.get("transaction_key")- return merchant_auth---def _make_request(create_transaction_request, connection_params: dict[str, Any]):- """Create an auth.net transaction controller and execute the request.-- Returns auth.net response object- """- create_transaction_controller = createTransactionController(- create_transaction_request- )- if connection_params.get("use_sandbox") is False:- create_transaction_controller.setenvironment(constants.PRODUCTION)-- create_transaction_controller.execute()-- response = create_transaction_controller.getresponse()- return response---def _normalize_last_4(account_number: str):- """Convert authorize.net account number to Saleor "last_4" format.-- Example: XXXX1111 > 1111- """- return account_number.strip("X")---def _normalize_card_expiration(expiration_date: str) -> list[int | None]:- """Convert authorize.net combined expiration date into month and year.-- Example: 2021-02 > [2021, 2]- Always return List of length 2- """- dates = expiration_date.split("-")- if len(dates) == 2:- try:- return [int(dates[0]), int(dates[1])]- except ValueError:- pass- return [None, None]diff --git a/saleor/payment/gateways/authorize_net/plugin.py b/saleor/payment/gateways/authorize_net/plugin.pydeleted file mode 100644index 0d496ac6f9..0000000000--- a/saleor/payment/gateways/authorize_net/plugin.py+++ /dev/null@@ -1,214 +0,0 @@-from typing import TYPE_CHECKING--from django.core.exceptions import ValidationError--from saleor.account.models import User-from saleor.plugins.base_plugin import BasePlugin, ConfigurationTypeField-from saleor.plugins.error_codes import PluginErrorCode--from ... import PaymentError-from ...models import Payment-from ..utils import get_supported_currencies-from . import (- GatewayConfig,- authenticate_test,- authorize,- capture,- list_client_sources,- process_payment,- refund,- void,-)--GATEWAY_NAME = "Authorize.Net"--if TYPE_CHECKING:- from ...interface import CustomerSource- from ..models import PluginConfiguration- from . import GatewayResponse, PaymentData---class AuthorizeNetGatewayPlugin(BasePlugin):- PLUGIN_NAME = GATEWAY_NAME- PLUGIN_ID = "mirumee.payments.authorize_net"- CONFIGURATION_PER_CHANNEL = True-- DEFAULT_CONFIGURATION = [- {"name": "api_login_id", "value": None},- {"name": "transaction_key", "value": None},- {"name": "client_key", "value": None},- {"name": "use_sandbox", "value": True},- {"name": "store_customers_card", "value": False},- {"name": "automatic_payment_capture", "value": True},- {"name": "supported_currencies", "value": ""},- ]-- CONFIG_STRUCTURE = {- "api_login_id": {- "type": ConfigurationTypeField.STRING,- "help_text": "Provide public Authorize.Net Login ID.",- "label": "API Login ID",- },- "transaction_key": {- "type": ConfigurationTypeField.SECRET,- "help_text": "Provide private Authorize.Net Transaction Key.",- "label": "Transaction Key",- },- "client_key": {- "type": ConfigurationTypeField.STRING,- "help_text": "Provide public Authorize.Net Client Key.",- "label": "Client Key",- },- "use_sandbox": {- "type": ConfigurationTypeField.BOOLEAN,- "help_text": (- "Determines if Saleor should use Authorize.Net sandbox environment."- ),- "label": "Use sandbox",- },- "store_customers_card": {- "type": ConfigurationTypeField.BOOLEAN,- "help_text": "Determines if Saleor should store cards on payments "- "in Stripe customer.",- "label": "Store customers card",- },- "automatic_payment_capture": {- "type": ConfigurationTypeField.BOOLEAN,- "help_text": "Determines if Saleor should automatically capture payments.",- "label": "Automatic payment capture",- },- "supported_currencies": {- "type": ConfigurationTypeField.STRING,- "help_text": "Determines currencies supported by gateway."- " Please enter currency codes separated by a comma.",- "label": "Supported currencies",- },- }-- def __init__(self, *args, **kwargs):- super().__init__(*args, **kwargs)- configuration = {item["name"]: item["value"] for item in self.configuration}- self.config = GatewayConfig(- gateway_name=GATEWAY_NAME,- auto_capture=configuration["automatic_payment_capture"],- supported_currencies=configuration["supported_currencies"],- connection_params={- "api_login_id": configuration["api_login_id"],- "transaction_key": configuration["transaction_key"],- "client_key": configuration["client_key"],- "use_sandbox": configuration["use_sandbox"],- },- store_customer=configuration["store_customers_card"],- )-- def _get_gateway_config(self) -> GatewayConfig:- return self.config-- @classmethod- def validate_plugin_configuration(- cls, plugin_configuration: "PluginConfiguration", **kwargs- ):- """Validate if provided configuration is correct."""- configuration = {- item["name"]: item["value"] for item in plugin_configuration.configuration- }-- api_login_id = configuration.get("api_login_id", None)- transaction_key = configuration.get("transaction_key", None)-- # Only check when active and both credentials are set- # Otherwise the dashboard is hard to use- if plugin_configuration.active and api_login_id and transaction_key:- use_sandbox = True if configuration.get("use_sandbox") else False- success, message = authenticate_test(- api_login_id, transaction_key, use_sandbox- )- if not success:- raise ValidationError(- {- "api_login_id": ValidationError(- message,- code=PluginErrorCode.PLUGIN_MISCONFIGURED.value,- ),- "transaction_key": ValidationError(- message,- code=PluginErrorCode.PLUGIN_MISCONFIGURED.value,- ),- }- )-- def authorize_payment(- self, payment_information: "PaymentData", previous_value- ) -> "GatewayResponse":- if not self.active:- return previous_value- return authorize(payment_information, self._get_gateway_config())-- def capture_payment(- self, payment_information: "PaymentData", previous_value- ) -> "GatewayResponse":- if not self.active:- return previous_value- return capture(payment_information, self._get_gateway_config())-- def refund_payment(- self, payment_information: "PaymentData", previous_value- ) -> "GatewayResponse":- if not self.active:- return previous_value- try:- payment = Payment.objects.get(pk=payment_information.payment_id)- except Payment.DoesNotExist as e:- raise PaymentError(- f"Cannot find Payment {payment_information.payment_id}."- ) from e- return refund(- payment_information, payment.cc_last_digits, self._get_gateway_config()- )-- def void_payment(- self, payment_information: "PaymentData", previous_value- ) -> "GatewayResponse":- if not self.active:- return previous_value- return void(payment_information, self._get_gateway_config())-- def process_payment(- self, payment_information: "PaymentData", previous_value- ) -> "GatewayResponse":- if not self.active:- return previous_value- user = User.objects.filter(- checkouts__payments__id=payment_information.payment_id- ).first()- user_id = user.id if user else None- return process_payment(payment_information, self._get_gateway_config(), user_id)-- def list_payment_sources(- self, customer_id: str, previous_value- ) -> list["CustomerSource"]:- if not self.active:- return previous_value- sources = list_client_sources(self._get_gateway_config(), customer_id)- previous_value.extend(sources)- return previous_value-- def get_supported_currencies(self, previous_value):- if not self.active:- return previous_value- config = self._get_gateway_config()- return get_supported_currencies(config, GATEWAY_NAME)-- def get_payment_config(self, previous_value):- if not self.active:- return previous_value- config = self._get_gateway_config()- return [- {- "field": "api_login_id",- "value": config.connection_params["api_login_id"],- },- {"field": "client_key", "value": config.connection_params["client_key"]},- {"field": "use_sandbox", "value": config.connection_params["use_sandbox"]},- {"field": "store_customer_card", "value": config.store_customer},- ]diff --git a/saleor/payment/gateways/authorize_net/tests/__init__.py b/saleor/payment/gateways/authorize_net/tests/__init__.pydeleted file mode 100644index e69de29bb2..0000000000diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_authenticate_test.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_authenticate_test.yamldeleted file mode 100644index 387203b654..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_authenticate_test.yaml+++ /dev/null@@ -1,52 +0,0 @@-interactions:-- request:- body: '{"authenticateTestRequest": {"merchantAuthentication": {"name": "test",- "transactionKey": "test"}}}'- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '119'- User-Agent:- - python-requests/2.24.0- content-type:- - application/json- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF{\"messages\":{\"resultCode\":\"Ok\",\"message\":[{\"code\":\"\- I00001\",\"text\":\"Successful.\"}]}}"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '86'- Content-Type:- - application/json; charset=utf-8- Date:- - Thu, 19 Nov 2020 22:30:28 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_c9f35a24-6245-4c60-b286-cafec65de713-17248-8881942- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_authenticate_test_failure.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_authenticate_test_failure.yamldeleted file mode 100644index 7576b8b407..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_authenticate_test_failure.yaml+++ /dev/null@@ -1,53 +0,0 @@-interactions:-- request:- body: '{"authenticateTestRequest": {"merchantAuthentication": {"name": "test",- "transactionKey": "test"}}}'- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '99'- User-Agent:- - python-requests/2.24.0- content-type:- - application/json- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF{\"messages\":{\"resultCode\":\"Error\",\"message\":[{\"code\"\- :\"E00007\",\"text\":\"User authentication failed due to invalid authentication\- \ values.\"}]}}"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '142'- Content-Type:- - application/json; charset=utf-8- Date:- - Thu, 19 Nov 2020 22:28:46 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_290dc2bf-5583-4847-b033-96a7ce2ac41d-21372-1078193- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_authorize_and_capture.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_authorize_and_capture.yamldeleted file mode 100644index 4cfd4b3809..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_authorize_and_capture.yaml+++ /dev/null@@ -1,117 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>a</name><transactionKey>test</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><refId>42</refId><transactionRequest><transactionType>authOnlyTransaction</transactionType><amount>10.0</amount><payment><opaqueData><dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor><dataValue>eyJjb2RlIjoiNTBfMl8wNjAwMDUzMDc0QjVBOTUxQjQxRTA2NTFGRDk5RjJFNjU5MTVCODNEMTM4MDczNjAxOTg3NDA5MzM4QUNBQzkxNzk2RDVCMjk5OUZENENEQkQwRjUzRTQxMDhDOUZDOUI1MEZFMzk3IiwidG9rZW4iOiI5NjA2NzUwNjg3MzY1NzgwNDA0NjAxIiwidiI6IjEuMSJ9</dataValue></opaqueData></payment><order><description></description></order><customer><type>individual</type><email>[email protected]</email></customer></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '892'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><refId>42</refId><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><transactionResponse><responseCode>1</responseCode><authCode>434GW8</authCode><avsResultCode>Y</avsResultCode><cvvResultCode>P</cvvResultCode><cavvResultCode>2</cavvResultCode><transId>60157160930</transId><refTransID\- \ /><transHash /><testRequest>0</testRequest><accountNumber>XXXX1111</accountNumber><accountType>Visa</accountType><messages><message><code>1</code><description>This\- \ transaction has been approved.</description></message></messages><transHashSha2\- \ /><networkTransId>UKYPLGTXHYKGCE2VTHCM41Y</networkTransId></transactionResponse></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '912'- Content-Type:- - application/xml; charset=utf-8- Date:- - Mon, 30 Nov 2020 15:38:34 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_c9f35a24-6245-4c60-b286-cafec65de713-17248-26985594- status:- code: 200- message: OK-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>test</name><transactionKey>test</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><transactionRequest><transactionType>priorAuthCaptureTransaction</transactionType><amount>10.0</amount><refTransId>60157160930</refTransId></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '459'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><transactionResponse><responseCode>1</responseCode><authCode>434GW8</authCode><avsResultCode>P</avsResultCode><cvvResultCode\- \ /><cavvResultCode /><transId>60157160930</transId><refTransID>60157160930</refTransID><transHash\- \ /><testRequest>0</testRequest><accountNumber>XXXX1111</accountNumber><accountType>Visa</accountType><messages><message><code>1</code><description>This\- \ transaction has been approved.</description></message></messages><transHashSha2\- \ /></transactionResponse></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '830'- Content-Type:- - application/xml; charset=utf-8- Date:- - Mon, 30 Nov 2020 15:38:34 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_fcd54fbe-2b11-4415-adab-ba5b7df2b869-17340-26993432- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_list_client_sources.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_list_client_sources.yamldeleted file mode 100644index fd93851bf9..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_list_client_sources.yaml+++ /dev/null@@ -1,57 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><getCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><customerProfileId>1929079648</customerProfileId><unmaskExpirationDate>true</unmaskExpirationDate></getCustomerProfileRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '399'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><getCustomerProfileResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><profile><merchantCustomerId>21</merchantCustomerId><email>[email protected]</email><customerProfileId>1929079648</customerProfileId><paymentProfiles><customerType>individual</customerType><billTo><firstName>John</firstName><lastName>Doe</lastName><address>1470\- \ Pinewood Avenue</address><city>MICHIGAN</city><state>MI</state><zip>49855</zip><country>US</country></billTo><customerPaymentProfileId>1841309241</customerPaymentProfileId><payment><creditCard><cardNumber>XXXX1111</cardNumber><expirationDate>2021-02</expirationDate><cardType>Visa</cardType></creditCard></payment></paymentProfiles><profileType>regular</profileType></profile></getCustomerProfileResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '997'- Content-Type:- - application/xml; charset=utf-8- Date:- - Mon, 14 Dec 2020 15:38:38 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_0ac565cf-65dd-471f-87e8-1ccb37ba4dc7-21900-10720310- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_list_client_sources_other_name.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_list_client_sources_other_name.yamldeleted file mode 100644index 81012aeffb..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_list_client_sources_other_name.yaml+++ /dev/null@@ -1,57 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><getCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><customerProfileId>1929079648</customerProfileId><unmaskExpirationDate>true</unmaskExpirationDate></getCustomerProfileRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '399'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><getCustomerProfileResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><profile><merchantCustomerId>21</merchantCustomerId><email>[email protected]</email><customerProfileId>1929079648</customerProfileId><paymentProfiles><customerType>individual</customerType><billTo><firstName></firstName><lastName>Doe</lastName><address>1470\- \ Pinewood Avenue</address><city>MICHIGAN</city><state>MI</state><zip>49855</zip><country>US</country></billTo><customerPaymentProfileId>1841309241</customerPaymentProfileId><payment><creditCard><cardNumber>XXXX1111</cardNumber><expirationDate>2021-02</expirationDate><cardType>Visa</cardType></creditCard></payment></paymentProfiles><profileType>regular</profileType></profile></getCustomerProfileResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '997'- Content-Type:- - application/xml; charset=utf-8- Date:- - Mon, 14 Dec 2020 15:38:38 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_0ac565cf-65dd-471f-87e8-1ccb37ba4dc7-21900-10720310- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_payment_gateway_process_payment_production_failure.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_payment_gateway_process_payment_production_failure.yamldeleted file mode 100644index b251d57c95..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_payment_gateway_process_payment_production_failure.yaml+++ /dev/null@@ -1,58 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><refId>295</refId><transactionRequest><transactionType>authCaptureTransaction</transactionType><amount>10.0</amount><currencyCode>USD</currencyCode><payment><opaqueData><dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor><dataValue>a</dataValue></opaqueData></payment><order><description></description></order><customer><type>individual</type><email>[email protected]</email></customer></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '697'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.25.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://api2.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><refId>295</refId><messages><resultCode>Error</resultCode><message><code>E00007</code><text>User\- \ authentication failed due to invalid authentication values.</text></message></messages><transactionResponse\- \ /></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '450'- Content-Type:- - application/xml; charset=utf-8- Date:- - Tue, 15 Dec 2020 19:23:02 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_1a9b7ff9-4819-4b1b-ab05-09c2bc22785f-13476-279180052- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment.yamldeleted file mode 100644index 14959f70d9..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment.yaml+++ /dev/null@@ -1,59 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><refId>37</refId><transactionRequest><transactionType>authCaptureTransaction</transactionType><amount>10.0</amount><payment><opaqueData><dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor><dataValue>Y29kZTo1MF8yXzA2MDAwIHRva2VuOjEgdjoxLjE=</dataValue></opaqueData></payment><order><description></description></order><customer><type>individual</type><email>[email protected]</email></customer></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '895'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><refId>37</refId><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><transactionResponse><responseCode>1</responseCode><authCode>RFR4FT</authCode><avsResultCode>Y</avsResultCode><cvvResultCode>P</cvvResultCode><cavvResultCode>2</cavvResultCode><transId>60156217587</transId><refTransID\- \ /><transHash /><testRequest>0</testRequest><accountNumber>XXXX1111</accountNumber><accountType>Visa</accountType><messages><message><code>1</code><description>This\- \ transaction has been approved.</description></message></messages><transHashSha2\- \ /><networkTransId>3HCLCGEXAZNFG4JR6JMEF3Q</networkTransId></transactionResponse></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '912'- Content-Type:- - application/xml; charset=utf-8- Date:- - Tue, 17 Nov 2020 15:00:09 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_c9f35a24-6245-4c60-b286-cafec65de713-17248-1239206- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment_error_response.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment_error_response.yamldeleted file mode 100644index 5fcb7f69de..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment_error_response.yaml+++ /dev/null@@ -1,58 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><refId>40</refId><transactionRequest><transactionType>authCaptureTransaction</transactionType><amount>10.0</amount><payment><opaqueData><dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor><dataValue>Y29kZTo1MF8yXzA2MDAwIHRva2VuOjEgdjoxLjE=</dataValue></opaqueData></payment><order><description></description></order><customer><type>individual</type><email>[email protected]</email></customer></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '703'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><refId>40</refId><messages><resultCode>Error</resultCode><message><code>E00007</code><text>User\- \ authentication failed due to invalid authentication values.</text></message></messages><transactionResponse\- \ /></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '449'- Content-Type:- - application/xml; charset=utf-8- Date:- - Tue, 17 Nov 2020 15:34:33 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_fcd54fbe-2b11-4415-adab-ba5b7df2b869-17340-1324744- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment_reuse_source.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment_reuse_source.yamldeleted file mode 100644index 7f04438d0d..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment_reuse_source.yaml+++ /dev/null@@ -1,60 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><refId>215</refId><transactionRequest><transactionType>authCaptureTransaction</transactionType><amount>10.0</amount><currencyCode>USD</currencyCode><payment><opaqueData><dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor><dataValue>eyJjb2RlIjoiNTBfMl8wNjAwMDUyODA2OTkzMkM1MUVGMTUxODBCNEJBMTQ2NTk5OTI3QTM1RUUzMzAzODRDNEQ2RkQ5MkU0NzA0NUZGQzQyNENEN0VBNUZEMTNFNjdDOTFGMzU5ODIzRUIzMkY4RTUxQjlCIiwidG9rZW4iOiI5NjA4MDU1OTc0NTk2MDc4NjA0NjAxIiwidiI6IjEuMSJ9</dataValue></opaqueData></payment><profile><createProfile>true</createProfile></profile><order><description></description></order><customer><type>individual</type><id>124</id><email>[email protected]</email></customer></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '994'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.25.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><refId>215</refId><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><transactionResponse><responseCode>1</responseCode><authCode>VV8YV5</authCode><avsResultCode>Y</avsResultCode><cvvResultCode>P</cvvResultCode><cavvResultCode>2</cavvResultCode><transId>60158222968</transId><refTransID\- \ /><transHash /><testRequest>0</testRequest><accountNumber>XXXX1111</accountNumber><accountType>Visa</accountType><messages><message><code>1</code><description>This\- \ transaction has been approved.</description></message></messages><transHashSha2\- \ /><networkTransId>DOSERDWEAEJ83YIVZY3AB6B</networkTransId></transactionResponse><profileResponse><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><customerProfileId>1929153842</customerProfileId><customerPaymentProfileIdList><numericString>1841389488</numericString></customerPaymentProfileIdList><customerShippingAddressIdList\- \ /></profileResponse></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '1242'- Content-Type:- - application/xml; charset=utf-8- Date:- - Tue, 15 Dec 2020 18:14:58 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_0ac565cf-65dd-471f-87e8-1ccb37ba4dc7-21900-12345128- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment_with_user.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment_with_user.yamldeleted file mode 100644index 3c20ed5661..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_process_payment_with_user.yaml+++ /dev/null@@ -1,61 +0,0 @@-interactions:-- request:- body: "<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionRequest xmlns=\"\- AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><refId>200</refId><transactionRequest><transactionType>authCaptureTransaction</transactionType><amount>10.0</amount><currencyCode>USD</currencyCode><payment><opaqueData><dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor><dataValue>eyJjb2RlIjoiNTBfMl8wNjAwMDUzNTkwQTBCNEMwRDg3RkY2RTdBQ0YxNUMzRTg4ODRDOEI1ODIwODA5NUExQ0U2ODM3MUJCNzIwMTZGQ0E5NDdGNjY5ODAyMTU2NTkxQjI4MDM0OTBGRDRCODcxMDgwNTQxIiwidG9rZW4iOiI5NjA4MDUxMDYzMDAxMDYxNTA0NjAxIiwidiI6IjEuMSJ9</dataValue></opaqueData></payment><order><description></description></order><customer><type>individual</type><id>123</id><email>[email protected]</email></customer><billTo><firstName>John</firstName><lastName>Doe</lastName><company>Mirumee\- \ Software</company><address>T\u0119czowa 7</address><city>WROC\u0141AW</city><state></state><zip>53-601</zip><country>PL</country></billTo></transactionRequest></createTransactionRequest>"- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '1146'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.25.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><refId>200</refId><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><transactionResponse><responseCode>1</responseCode><authCode>CYC2CI</authCode><avsResultCode>Y</avsResultCode><cvvResultCode>P</cvvResultCode><cavvResultCode>2</cavvResultCode><transId>60158219030</transId><refTransID\- \ /><transHash /><testRequest>0</testRequest><accountNumber>XXXX1111</accountNumber><accountType>Visa</accountType><messages><message><code>1</code><description>This\- \ transaction has been approved.</description></message></messages><transHashSha2\- \ /><networkTransId>YUB9211Y3WQH5BO8WVGTPK2</networkTransId></transactionResponse></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '913'- Content-Type:- - application/xml; charset=utf-8- Date:- - Tue, 15 Dec 2020 16:51:39 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_0ac565cf-65dd-471f-87e8-1ccb37ba4dc7-21900-12262522- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_refund.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_refund.yamldeleted file mode 100644index a94242fefb..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_refund.yaml+++ /dev/null@@ -1,60 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>test</name><transactionKey>test</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><transactionRequest><transactionType>refundTransaction</transactionType><amount>10.0</amount><payment><creditCard><cardNumber>1111</cardNumber><expirationDate>XXXX</expirationDate></creditCard></payment><refTransId>60156675146</refTransId></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '559'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><transactionResponse><responseCode>1</responseCode><authCode\- \ /><avsResultCode>P</avsResultCode><cvvResultCode /><cavvResultCode /><transId>60156757629</transId><refTransID>60156675146</refTransID><transHash\- \ /><testRequest>0</testRequest><accountNumber>XXXX1111</accountNumber><accountType>Visa</accountType><messages><message><code>1</code><description>This\- \ transaction has been approved.</description></message></messages><transHashSha2\- \ /></transactionResponse></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '815'- Content-Type:- - application/xml; charset=utf-8- Date:- - Tue, 24 Nov 2020 20:49:09 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_c9f35a24-6245-4c60-b286-cafec65de713-17248-17900192- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_refund_error.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_refund_error.yamldeleted file mode 100644index a682175843..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_refund_error.yaml+++ /dev/null@@ -1,58 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><transactionRequest><transactionType>refundTransaction</transactionType><amount>10.0</amount><payment><creditCard><cardNumber>1111</cardNumber><expirationDate>XXXX</expirationDate></creditCard></payment><refTransId>test</refTransId></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '536'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><messages><resultCode>Error</resultCode><message><code>E00007</code><text>User\- \ authentication failed due to invalid authentication values.</text></message></messages><transactionResponse\- \ /></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '432'- Content-Type:- - application/xml; charset=utf-8- Date:- - Tue, 24 Nov 2020 20:43:15 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_fcd54fbe-2b11-4415-adab-ba5b7df2b869-17340-17896222- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_void.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_void.yamldeleted file mode 100644index 1c7b9f4ba0..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_void.yaml+++ /dev/null@@ -1,60 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><transactionRequest><transactionType>voidTransaction</transactionType><refTransId>60157165182</refTransId></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '426'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><transactionResponse><responseCode>1</responseCode><authCode>Y2P72J</authCode><avsResultCode>P</avsResultCode><cvvResultCode\- \ /><cavvResultCode /><transId>60157165182</transId><refTransID>60157165182</refTransID><transHash\- \ /><testRequest>0</testRequest><accountNumber>XXXX1111</accountNumber><accountType>Visa</accountType><messages><message><code>1</code><description>This\- \ transaction has been approved.</description></message></messages><transHashSha2\- \ /></transactionResponse></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '830'- Content-Type:- - application/xml; charset=utf-8- Date:- - Mon, 30 Nov 2020 18:38:37 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_fcd54fbe-2b11-4415-adab-ba5b7df2b869-17340-27161825- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_void_duplicate.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_void_duplicate.yamldeleted file mode 100644index 95fcb39436..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_void_duplicate.yaml+++ /dev/null@@ -1,60 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><transactionRequest><transactionType>voidTransaction</transactionType><refTransId>60157165182</refTransId></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '426'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><transactionResponse><responseCode>1</responseCode><authCode\- \ /><avsResultCode>P</avsResultCode><cvvResultCode /><cavvResultCode /><transId>0</transId><refTransID>60157165182</refTransID><transHash\- \ /><testRequest>0</testRequest><accountNumber /><accountType>Visa</accountType><messages><message><code>310</code><description>This\- \ transaction has already been voided.</description></message></messages><transHashSha2\- \ /></transactionResponse></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '791'- Content-Type:- - application/xml; charset=utf-8- Date:- - Mon, 30 Nov 2020 18:40:19 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_c9f35a24-6245-4c60-b286-cafec65de713-17248-27154982- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_void_failure.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_void_failure.yamldeleted file mode 100644index 5a1833f3ce..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_authorize_net/test_void_failure.yaml+++ /dev/null@@ -1,61 +0,0 @@-interactions:-- request:- body: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>public</name><transactionKey>secret</transactionKey></merchantAuthentication><clientId>sdk-python-1.1.3</clientId><transactionRequest><transactionType>voidTransaction</transactionType><refTransId>601572</refTransId></transactionRequest></createTransactionRequest>- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '421'- Content-Type:- - application/xml- User-Agent:- - python-requests/2.24.0- encoding:- - utf-8- version:- - '1.0'- method: POST- uri: https://apitest.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><createTransactionResponse\- \ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\- \ xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"><messages><resultCode>Error</resultCode><message><code>E00027</code><text>The\- \ transaction was unsuccessful.</text></message></messages><transactionResponse><responseCode>3</responseCode><authCode\- \ /><avsResultCode>P</avsResultCode><cvvResultCode /><cavvResultCode /><transId>0</transId><refTransID>601572</refTransID><transHash\- \ /><testRequest>0</testRequest><accountNumber /><accountType /><errors><error><errorCode>16</errorCode><errorText>The\- \ transaction cannot be found.</errorText></error></errors><shipTo /><transHashSha2\- \ /></transactionResponse></createTransactionResponse>"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '793'- Content-Type:- - application/xml; charset=utf-8- Date:- - Mon, 30 Nov 2020 18:42:50 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_fcd54fbe-2b11-4415-adab-ba5b7df2b869-17340-27164037- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/cassettes/test_plugin/test_payment_gateway_validate_production.yaml b/saleor/payment/gateways/authorize_net/tests/cassettes/test_plugin/test_payment_gateway_validate_production.yamldeleted file mode 100644index 7d0d444048..0000000000--- a/saleor/payment/gateways/authorize_net/tests/cassettes/test_plugin/test_payment_gateway_validate_production.yaml+++ /dev/null@@ -1,53 +0,0 @@-interactions:-- request:- body: '{"authenticateTestRequest": {"merchantAuthentication": {"name": "public",- "transactionKey": "secret"}}}'- headers:- Accept:- - '*/*'- Accept-Encoding:- - gzip, deflate- Connection:- - keep-alive- Content-Length:- - '119'- User-Agent:- - python-requests/2.25.0- content-type:- - application/json- method: POST- uri: https://api2.authorize.net/xml/v1/request.api- response:- body:- string: "\uFEFF{\"messages\":{\"resultCode\":\"Error\",\"message\":[{\"code\"\- :\"E00007\",\"text\":\"User authentication failed due to invalid authentication\- \ values.\"}]}}"- headers:- Access-Control-Allow-Credentials:- - 'true'- Access-Control-Allow-Headers:- - x-requested-with,cache-control,content-type,origin,method,SOAPAction- Access-Control-Allow-Methods:- - PUT,OPTIONS,POST,GET- Access-Control-Allow-Origin:- - '*'- Cache-Control:- - no-store- Content-Length:- - '142'- Content-Type:- - application/json; charset=utf-8- Date:- - Tue, 15 Dec 2020 18:30:45 GMT- Pragma:- - no-cache- Strict-Transport-Security:- - max-age=31536000- X-Cnection:- - close- X-OPNET-Transaction-Trace:- - a2_bd8a9e88-53fb-4f58-844a-185161afee3c-9716-278767299- status:- code: 200- message: OK-version: 1diff --git a/saleor/payment/gateways/authorize_net/tests/conftest.py b/saleor/payment/gateways/authorize_net/tests/conftest.pydeleted file mode 100644index 831481cb27..0000000000--- a/saleor/payment/gateways/authorize_net/tests/conftest.py+++ /dev/null@@ -1,75 +0,0 @@-from unittest import mock--import pytest--from .....plugins.manager import get_plugins_manager-from ....interface import GatewayConfig-from ..plugin import AuthorizeNetGatewayPlugin---def authorize_net_gateway_config():- return GatewayConfig(- gateway_name="authorize_net",- auto_capture=True,- supported_currencies="USD",- connection_params={- "api_login_id": "public",- "transaction_key": "secret",- "client_key": "public",- "use_sandbox": True,- },- )---def authorize_net_payment(payment_dummy):- payment_dummy.gateway = "mirumee.payments.authorize_net"- return payment_dummy--- "saleor.payment.gateways.authorize_net.plugin.AuthorizeNetGatewayPlugin"- ".validate_plugin_configuration"-)-def authorize_net_plugin(_, settings, channel_USD, authorize_net_gateway_config):- settings.PLUGINS = [- "saleor.payment.gateways.authorize_net.plugin.AuthorizeNetGatewayPlugin"- ]- manager = get_plugins_manager(allow_replica=False)-- connection_params = authorize_net_gateway_config.connection_params-- manager.save_plugin_configuration(- AuthorizeNetGatewayPlugin.PLUGIN_ID,- channel_USD.slug,- {- "active": True,- "configuration": [- {"name": "api_login_id", "value": connection_params["api_login_id"]},- {- "name": "transaction_key",- "value": connection_params["transaction_key"],- },- {"name": "client_key", "value": connection_params["client_key"]},- {"name": "use_sandbox", "value": connection_params["use_sandbox"]},- {- "name": "store_customers_card",- "value": authorize_net_gateway_config.store_customer,- },- {- "name": "automatic_payment_capture",- "value": authorize_net_gateway_config.auto_capture,- },- {- "name": "supported_currencies",- "value": authorize_net_gateway_config.supported_currencies,- },- ],- },- )-- manager = get_plugins_manager(allow_replica=False)- manager.get_all_plugins()- return manager.plugins_per_channel[channel_USD.slug][0]diff --git a/saleor/payment/gateways/authorize_net/tests/test_authorize_net.py b/saleor/payment/gateways/authorize_net/tests/test_authorize_net.pydeleted file mode 100644index e3480cabf9..0000000000--- a/saleor/payment/gateways/authorize_net/tests/test_authorize_net.py+++ /dev/null@@ -1,286 +0,0 @@-import pytest--from .... import TransactionKind-from ....interface import PaymentData-from .. import (- authenticate_test,- capture,- list_client_sources,- process_payment,- refund,- void,-)--INVALID_TOKEN = "Y29kZTo1MF8yXzA2MDAwIHRva2VuOjEgdjoxLjE="-SUCCESS_TRANSACTION_ID = "60156217587"-REFUND_AMOUNT = 10.0-REFUND_TOKEN = "test"---def test_authenticate_test():- success, _ = authenticate_test("test", "test", True)- assert success---def test_authenticate_test_failure():- success, message = authenticate_test("test", "test", True)- assert not success- assert message == "User authentication failed due to invalid authentication values."---def test_process_payment(dummy_payment_data, authorize_net_gateway_config):- dummy_payment_data.token = INVALID_TOKEN- response = process_payment(dummy_payment_data, authorize_net_gateway_config)- assert not response.error- assert response.transaction_id == SUCCESS_TRANSACTION_ID- assert response.kind == TransactionKind.CAPTURE- assert response.is_success- assert response.amount == dummy_payment_data.amount- assert response.currency == dummy_payment_data.currency- assert not response.action_required---def test_process_payment_with_user(- dummy_payment_data, authorize_net_gateway_config, address-):- dummy_payment_data.token = INVALID_TOKEN- dummy_payment_data.billing = address- user_id = 123- response = process_payment(- dummy_payment_data, authorize_net_gateway_config, user_id- )- assert not response.error- assert response.kind == TransactionKind.CAPTURE- assert response.is_success- assert response.amount == dummy_payment_data.amount- assert response.currency == dummy_payment_data.currency---def test_process_payment_reuse_source(dummy_payment_data, authorize_net_gateway_config):- dummy_payment_data.token = INVALID_TOKEN- dummy_payment_data.reuse_source = True- user_id = 124- response = process_payment(- dummy_payment_data, authorize_net_gateway_config, user_id- )- assert not response.error- assert response.kind == TransactionKind.CAPTURE- assert response.is_success- assert response.customer_id == 1929153842---def test_process_payment_error_response(- dummy_payment_data, authorize_net_gateway_config-):- dummy_payment_data.token = INVALID_TOKEN- response = process_payment(dummy_payment_data, authorize_net_gateway_config)- assert (- response.error- == "User authentication failed due to invalid authentication values."- )- assert response.transaction_id == INVALID_TOKEN- assert response.kind == TransactionKind.CAPTURE- assert not response.is_success- assert response.amount == dummy_payment_data.amount- assert response.currency == dummy_payment_data.currency- assert not response.action_required---def test_process_payment_error_response_null(- dummy_payment_data, authorize_net_gateway_config-):- dummy_payment_data.token = INVALID_TOKEN- response = process_payment(dummy_payment_data, authorize_net_gateway_config)- assert response.error == "Null Response"- assert not response.is_success---def test_refund(authorize_net_payment, authorize_net_gateway_config):- payment_data = PaymentData(- authorize_net_payment.gateway,- REFUND_AMOUNT,- "USD",- None,- None,- payment_id=authorize_net_payment.pk,- graphql_payment_id=None,- order_id=authorize_net_payment.order_id,- customer_ip_address=authorize_net_payment.customer_ip_address,- customer_email=authorize_net_payment.billing_email,- token=REFUND_TOKEN,- )- response = refund(- payment_data,- authorize_net_payment.cc_last_digits,- authorize_net_gateway_config,- )- assert not response.error- assert response.kind == TransactionKind.REFUND- assert response.is_success---def test_refund_error(authorize_net_payment, authorize_net_gateway_config):- payment_data = PaymentData(- authorize_net_payment.gateway,- REFUND_AMOUNT,- "USD",- None,- None,- payment_id=authorize_net_payment.pk,- graphql_payment_id=None,- order_id=authorize_net_payment.order_id,- customer_ip_address=authorize_net_payment.customer_ip_address,- customer_email=authorize_net_payment.billing_email,- token=REFUND_TOKEN,- )- response = refund(- payment_data,- authorize_net_payment.cc_last_digits,- authorize_net_gateway_config,- )- assert response.error- assert response.kind == TransactionKind.REFUND- assert not response.is_success---def test_authorize_and_capture(dummy_payment_data, authorize_net_gateway_config):- dummy_payment_data.token = INVALID_TOKEN- authorize_net_gateway_config.auto_capture = False-- response = process_payment(dummy_payment_data, authorize_net_gateway_config)- transaction_id = response.transaction_id- assert not response.error- assert response.kind == TransactionKind.AUTH- assert response.is_success- assert response.amount == dummy_payment_data.amount- assert response.currency == dummy_payment_data.currency- assert not response.action_required-- dummy_payment_data.token = str(transaction_id)- response = capture(dummy_payment_data, authorize_net_gateway_config)- assert not response.error- assert response.kind == TransactionKind.CAPTURE- assert response.is_success- assert response.amount == dummy_payment_data.amount- assert response.currency == dummy_payment_data.currency- assert not response.action_required---def test_void(authorize_net_payment, authorize_net_gateway_config):- payment_data = PaymentData(- authorize_net_payment.gateway,- None,- None,- None,- None,- payment_id=authorize_net_payment.pk,- graphql_payment_id=None,- order_id=authorize_net_payment.order_id,- customer_ip_address=authorize_net_payment.customer_ip_address,- customer_email=authorize_net_payment.billing_email,- token="1",- )- response = void(- payment_data,- authorize_net_gateway_config,- )- assert not response.error- assert response.kind == TransactionKind.VOID- assert response.is_success---def test_void_duplicate(authorize_net_payment, authorize_net_gateway_config):- """Test that duplicate voids are considered successful."""- payment_data = PaymentData(- authorize_net_payment.gateway,- None,- None,- None,- None,- payment_id=authorize_net_payment.pk,- graphql_payment_id=None,- order_id=authorize_net_payment.order_id,- customer_ip_address=authorize_net_payment.customer_ip_address,- customer_email=authorize_net_payment.billing_email,- token="1",- )- response = void(- payment_data,- authorize_net_gateway_config,- )- assert not response.error- assert response.kind == TransactionKind.VOID- assert response.is_success---def test_void_failure(authorize_net_payment, authorize_net_gateway_config):- """Test void with invalid transaction ID."""- payment_data = PaymentData(- authorize_net_payment.gateway,- None,- None,- None,- None,- payment_id=authorize_net_payment.pk,- graphql_payment_id=None,- order_id=authorize_net_payment.order_id,- customer_ip_address=authorize_net_payment.customer_ip_address,- customer_email=authorize_net_payment.billing_email,- token="1",- )- response = void(- payment_data,- authorize_net_gateway_config,- )- assert response.error- assert response.kind == TransactionKind.VOID- assert not response.is_success---def test_list_client_sources(authorize_net_gateway_config):- customer_id = "1929079648"- response = list_client_sources(authorize_net_gateway_config, customer_id)- assert len(response) == 1- assert response[0].id == 1841309241- assert response[0].credit_card_info.last_4 == "1111"- assert response[0].credit_card_info.exp_year == 2021- assert response[0].credit_card_info.exp_month == 2- assert response[0].credit_card_info.brand == "Visa"- assert response[0].credit_card_info.name == "John Doe"---def test_list_client_sources_other_name(authorize_net_gateway_config):- customer_id = "1929079648"- response = list_client_sources(authorize_net_gateway_config, customer_id)- assert len(response) == 1- assert response[0].credit_card_info.name == "Doe"diff --git a/saleor/payment/gateways/authorize_net/tests/test_plugin.py b/saleor/payment/gateways/authorize_net/tests/test_plugin.pydeleted file mode 100644index 4be9869c7c..0000000000--- a/saleor/payment/gateways/authorize_net/tests/test_plugin.py+++ /dev/null@@ -1,159 +0,0 @@-from unittest import mock--import pytest-from django.core.exceptions import ValidationError--from .... import PaymentError-from ..plugin import AuthorizeNetGatewayPlugin---def test_get_payment_gateway_for_checkout(- authorize_net_plugin,- checkout_with_single_item,- address,- checkout_info,- checkout_lines_info,-):- checkout_with_single_item.billing_address = address- checkout_with_single_item.save()- response = authorize_net_plugin.get_payment_gateways(- currency=None,- checkout_info=checkout_info,- checkout_lines=checkout_lines_info,- previous_value=None,- )[0]- assert response.id == authorize_net_plugin.PLUGIN_ID- assert response.name == authorize_net_plugin.PLUGIN_NAME- config = response.config- assert len(config) == 4- assert config[0] == {- "field": "api_login_id",- "value": authorize_net_plugin.config.connection_params["api_login_id"],- }- assert config[1] == {- "field": "client_key",- "value": authorize_net_plugin.config.connection_params["client_key"],- }- assert config[2] == {- "field": "use_sandbox",- "value": authorize_net_plugin.config.connection_params["use_sandbox"],- }- assert config[3] == {- "field": "store_customer_card",- "value": authorize_net_plugin.config.store_customer,- }---def test_get_payment_gateway_for_checkout_inactive(- authorize_net_plugin, checkout_with_single_item, checkout_info, checkout_lines_info-):- authorize_net_plugin.active = False- currency = checkout_with_single_item.currency- response = authorize_net_plugin.get_payment_gateways(- currency=currency,- checkout_info=checkout_info,- checkout_lines=checkout_lines_info,- previous_value=None,- )- assert not response--[email protected]("saleor.payment.gateways.authorize_net.plugin.authenticate_test")-def test_payment_gateway_validate(mocked_authenticate_test, authorize_net_plugin):- mocked_authenticate_test.return_value = (True, "")- response = AuthorizeNetGatewayPlugin.validate_plugin_configuration(- authorize_net_plugin- )- assert not response---def test_payment_gateway_validate_production(authorize_net_plugin):- for config in authorize_net_plugin.configuration:- if config["name"] == "use_sandbox":- config["value"] = False- with pytest.raises(ValidationError):- AuthorizeNetGatewayPlugin.validate_plugin_configuration(authorize_net_plugin)---def test_payment_gateway_process_payment_production_failure(- authorize_net_plugin, dummy_payment_data-):- authorize_net_plugin.config.connection_params["use_sandbox"] = False- dummy_payment_data.token = "a"- response = authorize_net_plugin.process_payment(dummy_payment_data, None)- assert not response.is_success--[email protected]("saleor.payment.gateways.authorize_net.plugin.authenticate_test")-def test_payment_gateway_validate_failure(- mocked_authenticate_test, authorize_net_plugin-):- mocked_authenticate_test.return_value = (False, "")- with pytest.raises(ValidationError):- AuthorizeNetGatewayPlugin.validate_plugin_configuration(authorize_net_plugin)--[email protected]("saleor.payment.gateways.authorize_net.plugin.refund")-def test_payment_gateway_refund_payment(- mocked_refund, authorize_net_plugin, dummy_payment_data-):- mocked_refund.return_value(None)- authorize_net_plugin.refund_payment(dummy_payment_data, None)- mocked_refund.assert_called_with(- dummy_payment_data, "1111", authorize_net_plugin._get_gateway_config()- )--[email protected]("payment_id", [-1, None])-def test_payment_gateway_refund_payment_no_payment(- payment_id, authorize_net_plugin, dummy_payment_data-):- dummy_payment_data.payment_id = payment_id- with pytest.raises(PaymentError):- authorize_net_plugin.refund_payment(dummy_payment_data, None)--[email protected]("saleor.payment.gateways.authorize_net.plugin.authorize")-def test_payment_gateway_authorize_payment(- mocked_authorize, authorize_net_plugin, dummy_payment_data-):- mocked_authorize.return_value(None)- authorize_net_plugin.authorize_payment(dummy_payment_data, None)- mocked_authorize.assert_called_with(- dummy_payment_data, authorize_net_plugin._get_gateway_config()- )--[email protected]("saleor.payment.gateways.authorize_net.plugin.capture")-def test_payment_gateway_capture_payment(- mocked_capture, authorize_net_plugin, dummy_payment_data-):- mocked_capture.return_value(None)- authorize_net_plugin.capture_payment(dummy_payment_data, None)- mocked_capture.assert_called_with(- dummy_payment_data, authorize_net_plugin._get_gateway_config()- )--[email protected]("saleor.payment.gateways.authorize_net.plugin.process_payment")-def test_payment_gateway_process_payment(- mocked_process_payment, authorize_net_plugin, dummy_payment_data-):- mocked_process_payment.return_value = None- authorize_net_plugin.process_payment(dummy_payment_data, None)- mocked_process_payment.assert_called_with(- dummy_payment_data, authorize_net_plugin.config, None- )--[email protected]("saleor.payment.gateways.authorize_net.plugin.list_client_sources")-def test_payment_gateway_list_payment_sources(- mocked_list_client_sources, authorize_net_plugin-):- mocked_list_client_sources.return_value = []- sources = authorize_net_plugin.list_payment_sources("1", [])- assert sources == []diff --git a/saleor/settings.py b/saleor/settings.pyindex b0ca368dd6..0eb0ef71e0 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -903,7 +903,6 @@ BUILTIN_PLUGINS = ["saleor.payment.gateways.stripe.plugin.StripeGatewayPlugin","saleor.payment.gateways.braintree.plugin.DeprecatedBraintreeGatewayPlugin","saleor.payment.gateways.razorpay.plugin.DeprecatedRazorpayGatewayPlugin",- "saleor.payment.gateways.authorize_net.plugin.AuthorizeNetGatewayPlugin","saleor.plugins.user_email.plugin.UserEmailPlugin","saleor.plugins.admin_email.plugin.AdminEmailPlugin","saleor.plugins.sendgrid.plugin.DeprecatedSendgridEmailPlugin",diff --git a/uv.lock b/uv.lockindex 1568e95518..9648451a9b 100644--- a/uv.lock+++ b/uv.lock@@ -9,12 +9,12 @@ supported-markers = [][options]-exclude-newer = "2026-03-17T14:10:57.981314838Z"+exclude-newer = "2026-03-31T05:47:06.949972Z"exclude-newer-span = "P3W"[options.exclude-newer-package]django = "2026-04-07T14:30:00Z"-pyjwt = { timestamp = "2026-03-28T14:10:57.981360004Z", span = "P10D" }+pyjwt = { timestamp = "2026-04-11T05:47:06.951029Z", span = "P10D" }[[package]]name = "amqp"@@ -90,17 +90,6 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/53/23/b65f568ed0c22f1efacb744d2db1a33c8068f384b8c9b482b52ebdbc3ef6/authlib-1.6.9-py2.py3-none-any.whl", hash = "sha256:f08b4c14e08f0861dc18a32357b33fbcfd2ea86cfe3fe149484b4d764c4a0ac3", size = 244197, upload-time = "2026-03-02T07:44:00.307Z" },]-[[package]]-name = "authorizenet"-version = "1.1.6"-source = { registry = "https://pypi.org/simple" }-dependencies = [- { name = "lxml", marker = "platform_python_implementation != 'PyPy'" },- { name = "pyxb-x", marker = "platform_python_implementation != 'PyPy'" },- { name = "requests", marker = "platform_python_implementation != 'PyPy'" },-]-sdist = { url = "https://files.pythonhosted.org/packages/32/7f/0e26284cd5c86c5b481dead1b1fb3d7e75a728d23bed11fc7b351f08d444/authorizenet-1.1.6.tar.gz", hash = "sha256:1e38ec9279817c24bc986a5cc72e1299e006cb617fef933c8e6f49e752d792f4", size = 161939, upload-time = "2025-04-28T06:35:38.08Z" }-[[package]]name = "azure-common"version = "1.1.28"@@ -2363,15 +2352,6 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/ba/3a/2ae996277b4b50f17d61f0603efd8253cb2d79cc7ae159468007b586396d/pywin32-311-cp312-cp312-win_arm64.whl", hash = "sha256:e286f46a9a39c4a18b319c28f59b61de793654af2f395c102b4f819e584b5852", size = 8710102, upload-time = "2025-07-14T20:13:24.682Z" },]-[[package]]-name = "pyxb-x"-version = "1.2.6.3"-source = { registry = "https://pypi.org/simple" }-sdist = { url = "https://files.pythonhosted.org/packages/de/de/2556352e8e4092d835852af63c34500681ba5ab6a5a3047e5daabb6d9ca9/pyxb_x-1.2.6.3.tar.gz", hash = "sha256:bf401fa8d3e6bd6ea6648f49f02c7dc7ef460b4c61dc34bc2f1c4c3a952037b5", size = 1275136, upload-time = "2025-01-07T15:50:05.735Z" }-wheels = [- { url = "https://files.pythonhosted.org/packages/8c/03/8154462b23ce8ed229d9be4eee17b8132b746e6a1f1dbfe57b72139ce5a0/PyXB_X-1.2.6.3-py3-none-any.whl", hash = "sha256:4c4a55d6b8c61c2d84ab4c2cb49ee74185599242bbfd1cf0bdd6be4a8a874006", size = 310097, upload-time = "2025-01-07T15:50:02.87Z" },-]-[[package]]name = "pyyaml"version = "6.0.2"@@ -2525,7 +2505,6 @@ source = { virtual = "." }dependencies = [{ name = "asgiref", marker = "platform_python_implementation != 'PyPy'" },{ name = "authlib", marker = "platform_python_implementation != 'PyPy'" },- { name = "authorizenet", marker = "platform_python_implementation != 'PyPy'" },{ name = "azure-common", marker = "platform_python_implementation != 'PyPy'" },{ name = "azure-storage-blob", marker = "platform_python_implementation != 'PyPy'" },{ name = "azure-storage-common", marker = "platform_python_implementation != 'PyPy'" },@@ -2637,7 +2616,6 @@ dev = [requires-dist = [{ name = "asgiref", specifier = ">=3.7.2,<4" },{ name = "authlib", specifier = ">=1.6.9,<2" },- { name = "authorizenet", specifier = ">=1.1.5,<2" },{ name = "azure-common", specifier = ">=1.1.28,<2" },{ name = "azure-storage-blob", specifier = ">=12.23.1,<13" },{ name = "azure-storage-common", specifier = ">=2.1.0,<3" },