diff --git a/benefits/core/migrations/0003_remove_paymentprocessor_api_access_token_endpoint_and_more.py b/benefits/core/migrations/0003_remove_paymentprocessor_api_access_token_endpoint_and_more.py new file mode 100644 index 000000000..45ef8893c --- /dev/null +++ b/benefits/core/migrations/0003_remove_paymentprocessor_api_access_token_endpoint_and_more.py @@ -0,0 +1,49 @@ +# Generated by Django 5.0.2 on 2024-02-28 23:18 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("core", "0002_paymentprocessor_audience_paymentprocessor_client_id_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="paymentprocessor", + name="api_access_token_endpoint", + ), + migrations.RemoveField( + model_name="paymentprocessor", + name="api_access_token_request_key", + ), + migrations.RemoveField( + model_name="paymentprocessor", + name="api_access_token_request_val", + ), + migrations.RemoveField( + model_name="paymentprocessor", + name="client_cert", + ), + migrations.RemoveField( + model_name="paymentprocessor", + name="client_cert_private_key", + ), + migrations.RemoveField( + model_name="paymentprocessor", + name="client_cert_root_ca", + ), + migrations.RemoveField( + model_name="paymentprocessor", + name="customer_endpoint", + ), + migrations.RemoveField( + model_name="paymentprocessor", + name="customers_endpoint", + ), + migrations.RemoveField( + model_name="paymentprocessor", + name="group_endpoint", + ), + ] diff --git a/benefits/core/migrations/local_fixtures.json b/benefits/core/migrations/local_fixtures.json index 0aaf9a808..54ea2faa9 100644 --- a/benefits/core/migrations/local_fixtures.json +++ b/benefits/core/migrations/local_fixtures.json @@ -35,87 +35,6 @@ "remote_url": null } }, - { - "model": "core.pemdata", - "pk": 5, - "fields": { - "label": "(MST) payment processor client certificate", - "text_secret_name": "mst-payment-processor-client-cert", - "remote_url": null - } - }, - { - "model": "core.pemdata", - "pk": 6, - "fields": { - "label": "(MST) payment processor client certificate private key", - "text_secret_name": "mst-payment-processor-client-cert-private-key", - "remote_url": null - } - }, - { - "model": "core.pemdata", - "pk": 7, - "fields": { - "label": "(MST) payment processor client certificate root CA", - "text_secret_name": "mst-payment-processor-client-cert-root-ca", - "remote_url": null - } - }, - { - "model": "core.pemdata", - "pk": 8, - "fields": { - "label": "(SacRT) payment processor client certificate", - "text_secret_name": "sacrt-payment-processor-client-cert", - "remote_url": null - } - }, - { - "model": "core.pemdata", - "pk": 9, - "fields": { - "label": "(SacRT) payment processor client certificate private key", - "text_secret_name": "sacrt-payment-processor-client-cert-private-key", - "remote_url": null - } - }, - { - "model": "core.pemdata", - "pk": 10, - "fields": { - "label": "(SacRT) payment processor client certificate root CA", - "text_secret_name": "sacrt-payment-processor-client-cert-root-ca", - "remote_url": null - } - }, - { - "model": "core.pemdata", - "pk": 11, - "fields": { - "label": "(SBMTD) payment processor client certificate", - "text_secret_name": "sbmtd-payment-processor-client-cert", - "remote_url": null - } - }, - { - "model": "core.pemdata", - "pk": 12, - "fields": { - "label": "(SBMTD) payment processor client certificate private key", - "text_secret_name": "sbmtd-payment-processor-client-cert-private-key", - "remote_url": null - } - }, - { - "model": "core.pemdata", - "pk": 13, - "fields": { - "label": "(SBMTD) payment processor client certificate root CA", - "text_secret_name": "sbmtd-payment-processor-client-cert-root-ca", - "remote_url": null - } - }, { "model": "core.authprovider", "pk": 1, @@ -324,18 +243,12 @@ "fields": { "name": "(MST) test payment processor", "api_base_url": "http://server:8000", - "api_access_token_endpoint": "access-token", - "api_access_token_request_key": "request_access", - "api_access_token_request_val": "REQUEST_ACCESS", + "client_id": "", + "client_secret_name": "", + "audience": "", "card_tokenize_url": "http://server:8000/static/tokenize.js", "card_tokenize_func": "tokenize", - "card_tokenize_env": "test", - "client_cert": 5, - "client_cert_private_key": 6, - "client_cert_root_ca": 7, - "customer_endpoint": "customer", - "customers_endpoint": "customers", - "group_endpoint": "group" + "card_tokenize_env": "test" } }, { @@ -344,18 +257,12 @@ "fields": { "name": "(SacRT) test payment processor", "api_base_url": "http://server:8000", - "api_access_token_endpoint": "access-token", - "api_access_token_request_key": "request_access", - "api_access_token_request_val": "REQUEST_ACCESS", + "client_id": "", + "client_secret_name": "", + "audience": "", "card_tokenize_url": "http://server:8000/static/tokenize.js", "card_tokenize_func": "tokenize", - "card_tokenize_env": "test", - "client_cert": 8, - "client_cert_private_key": 9, - "client_cert_root_ca": 10, - "customer_endpoint": "customer", - "customers_endpoint": "customers", - "group_endpoint": "group" + "card_tokenize_env": "test" } }, { @@ -364,18 +271,12 @@ "fields": { "name": "(SBMTD) test payment processor", "api_base_url": "http://server:8000", - "api_access_token_endpoint": "access-token", - "api_access_token_request_key": "request_access", - "api_access_token_request_val": "REQUEST_ACCESS", + "client_id": "", + "client_secret_name": "", + "audience": "", "card_tokenize_url": "http://server:8000/static/tokenize.js", "card_tokenize_func": "tokenize", - "card_tokenize_env": "test", - "client_cert": 11, - "client_cert_private_key": 12, - "client_cert_root_ca": 13, - "customer_endpoint": "customer", - "customers_endpoint": "customers", - "group_endpoint": "group" + "card_tokenize_env": "test" } }, { diff --git a/benefits/core/models.py b/benefits/core/models.py index 44b88701d..72561c93a 100644 --- a/benefits/core/models.py +++ b/benefits/core/models.py @@ -206,24 +206,12 @@ class PaymentProcessor(models.Model): id = models.AutoField(primary_key=True) name = models.TextField() api_base_url = models.TextField() - api_access_token_endpoint = models.TextField() - api_access_token_request_key = models.TextField() - api_access_token_request_val = models.TextField() client_id = models.TextField() client_secret_name = SecretNameField() audience = models.TextField() card_tokenize_url = models.TextField() card_tokenize_func = models.TextField() card_tokenize_env = models.TextField() - # The certificate used for client certificate authentication to the API - client_cert = models.ForeignKey(PemData, related_name="+", on_delete=models.PROTECT) - # The private key, used to sign the certificate - client_cert_private_key = models.ForeignKey(PemData, related_name="+", on_delete=models.PROTECT) - # The root CA bundle, used to verify the server. - client_cert_root_ca = models.ForeignKey(PemData, related_name="+", on_delete=models.PROTECT) - customer_endpoint = models.TextField() - customers_endpoint = models.TextField() - group_endpoint = models.TextField() @property def client_secret(self): diff --git a/tests/pytest/conftest.py b/tests/pytest/conftest.py index 5909b8f62..0dcf3aa8b 100644 --- a/tests/pytest/conftest.py +++ b/tests/pytest/conftest.py @@ -130,25 +130,16 @@ def model_EligibilityVerifier_AuthProvider_with_verification(model_AuthProvider_ @pytest.fixture -def model_PaymentProcessor(model_PemData): +def model_PaymentProcessor(): payment_processor = PaymentProcessor.objects.create( name="Test Payment Processor", api_base_url="https://example.com/payments", - api_access_token_endpoint="token", - api_access_token_request_key="X-API-TOKEN", - api_access_token_request_val="secret-value", client_id="client_id", client_secret_name="client_secret_name", audience="audience", card_tokenize_url="https://example.com/payments/tokenize.js", card_tokenize_func="tokenize", card_tokenize_env="test", - client_cert=model_PemData, - client_cert_private_key=model_PemData, - client_cert_root_ca=model_PemData, - customer_endpoint="customer", - customers_endpoint="customers", - group_endpoint="group", ) return payment_processor