Skip to content

Commit

Permalink
feat(sbmtd/senior): define PaymentProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Aug 14, 2023
1 parent 05b808d commit 1f99743
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion benefits/core/migrations/0002_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@ def load_data(app, *args, **kwargs):
label="SacRT payment processor client certificate root CA",
)

sbmtd_payment_processor_client_cert = PemData.objects.create(
text=os.environ.get("SBMTD_PAYMENT_PROCESSOR_CLIENT_CERT", dummy_cert_text),
label="SBMTD payment processor client certificate",
)

sbmtd_payment_processor_client_cert_private_key = PemData.objects.create(
text=os.environ.get("SBMTD_PAYMENT_PROCESSOR_CLIENT_CERT_PRIVATE_KEY", client_private_key.text),
label="SBMTD payment processor client certificate private key",
)

sbmtd_payment_processor_client_cert_root_ca = PemData.objects.create(
text=os.environ.get("SBMTD_PAYMENT_PROCESSOR_CLIENT_CERT_ROOT_CA", dummy_cert_text),
label="SBMTD payment processor client certificate root CA",
)

AuthProvider = app.get_model("core", "AuthProvider")

senior_auth_provider = AuthProvider.objects.create(
Expand Down Expand Up @@ -247,6 +262,23 @@ def load_data(app, *args, **kwargs):
group_endpoint="group",
)

sbmtd_payment_processor = PaymentProcessor.objects.create(
name=os.environ.get("SBMTD_PAYMENT_PROCESSOR_NAME", "Test Payment Processor"),
api_base_url=os.environ.get("SBMTD_PAYMENT_PROCESSOR_API_BASE_URL", "http://server:8000"),
api_access_token_endpoint=os.environ.get("SBMTD_PAYMENT_PROCESSOR_API_ACCESS_TOKEN_ENDPOINT", "access-token"),
api_access_token_request_key=os.environ.get("SBMTD_PAYMENT_PROCESSOR_API_ACCESS_TOKEN_REQUEST_KEY", "request_access"),
api_access_token_request_val=os.environ.get("SBMTD_PAYMENT_PROCESSOR_API_ACCESS_TOKEN_REQUEST_VAL", "REQUEST_ACCESS"),
card_tokenize_url=os.environ.get("SBMTD_PAYMENT_PROCESSOR_CARD_TOKENIZE_URL", "http://server:8000/static/tokenize.js"),
card_tokenize_func=os.environ.get("SBMTD_PAYMENT_PROCESSOR_CARD_TOKENIZE_FUNC", "tokenize"),
card_tokenize_env=os.environ.get("SBMTD_PAYMENT_PROCESSOR_CARD_TOKENIZE_ENV", "test"),
client_cert=sbmtd_payment_processor_client_cert,
client_cert_private_key=sbmtd_payment_processor_client_cert_private_key,
client_cert_root_ca=sbmtd_payment_processor_client_cert_root_ca,
customer_endpoint="customer",
customers_endpoint="customers",
group_endpoint="group",
)

TransitAgency = app.get_model("core", "TransitAgency")

# load the sample data from a JSON file so that it can be accessed by Cypress as well
Expand Down Expand Up @@ -307,7 +339,7 @@ def load_data(app, *args, **kwargs):
private_key=client_private_key,
public_key=client_public_key,
jws_signing_alg=os.environ.get("SBMTD_AGENCY_JWS_SIGNING_ALG", "RS256"),
payment_processor=mst_payment_processor,
payment_processor=sbmtd_payment_processor,
index_template="core/index--sbmtd.html",
eligibility_index_template="eligibility/index--sbmtd.html",
enrollment_success_template="enrollment/success--sbmtd.html",
Expand Down

0 comments on commit 1f99743

Please sign in to comment.