Skip to content

Commit

Permalink
Merge pull request #262 from blockchyp/feature/cleanup-test-failures
Browse files Browse the repository at this point in the history
Feature/cleanup test failures
  • Loading branch information
devops-blockchyp committed Apr 24, 2024
1 parent ec4a28c commit 67baa84
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 56 deletions.
21 changes: 10 additions & 11 deletions blockchyp/blockchyp.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,17 +834,6 @@ def partner_commission_breakdown(self, request):
test=request.get("test", False),
)

def merchant_credential_generation(self, request):
# type: (dict) -> dict
"""Generates and returns api credentials for a given merchant."""

return self._gateway_request(
method="POST",
path="/api/creds/generateMerchant",
body=request,
test=request.get("test", False),
)

def merchant_profile(self, request):
# type: (dict) -> dict
"""Returns profile information for a merchant."""
Expand Down Expand Up @@ -912,6 +901,16 @@ def delete_token(self, request):
)


def merchant_credential_generation(self, request):
# type: (dict) -> dict
"""Generates and returns api credentials for a given merchant."""

return self._dashboard_request(
method="POST",
path="/api/generate-merchant-creds",
body=request,
)

def get_merchants(self, request):
# type: (dict) -> dict
"""Adds a test merchant account."""
Expand Down
34 changes: 0 additions & 34 deletions tests/integration/_test.py

This file was deleted.

1 change: 1 addition & 0 deletions tests/integration/cancel_payment_link_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_cancel_payment_link():
assert setup_response.get("success")

request = {
"test": True,
"linkCode": setup_response["linkCode"],
}

Expand Down
14 changes: 12 additions & 2 deletions tests/integration/merchant_credential_generation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,21 @@ def test_merchant_credential_generation():
terminal = _get_test_config().get("defaultTerminalName")


client = _get_test_client("")
client = _get_test_client("partner")

setup_request = {
"dbaName": "Test Merchant",
"companyName": "Test Merchant",
}

setup_response = client.add_test_merchant(setup_request)
print("Setup response: %r" % setup_response)

assert setup_response.get("success")

request = {
"test": True,
"merchantId": "<MERCHANT ID>",
"merchantId": setup_response["merchantId"],
}

response = client.merchant_credential_generation(request)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/pan_preauth_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ def test_pan_preauth():
"pan": "4111111111111111",
"expMonth": "12",
"expYear": "2025",
"amount": "25.55",
"amount": "42.45",
"test": True,
"bypassDupeFilter": True,
}

response = client.preauth(request)
Expand All @@ -57,5 +58,4 @@ def test_pan_preauth():
assert response.get("paymentType")
assert response.get("maskedPan")
assert response.get("entryMethod")
assert response.get("authorizedAmount") == "25.55"
assert response.get("entryMethod") == "KEYED"
2 changes: 1 addition & 1 deletion tests/integration/partner_commission_breakdown_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_partner_commission_breakdown():
terminal = _get_test_config().get("defaultTerminalName")


client = _get_test_client("")
client = _get_test_client("partner")

request = {
"test": True,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/partner_statement_detail_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

@pytest.mark.itest
def test_partner_statement_detail():
"""Can list partner statements."""
"""Can retrieve a single partner statement."""


terminal = _get_test_config().get("defaultTerminalName")


client = _get_test_client("")
client = _get_test_client("partner")

request = {
"test": True,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/partner_statements_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_partner_statements():
terminal = _get_test_config().get("defaultTerminalName")


client = _get_test_client("")
client = _get_test_client("partner")

request = {
"test": True,
Expand Down
14 changes: 12 additions & 2 deletions tests/integration/pricing_policy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,21 @@ def test_pricing_policy():
terminal = _get_test_config().get("defaultTerminalName")


client = _get_test_client("")
client = _get_test_client("partner")

setup_request = {
"dbaName": "Test Merchant",
"companyName": "Test Merchant",
}

setup_response = client.add_test_merchant(setup_request)
print("Setup response: %r" % setup_response)

assert setup_response.get("success")

request = {
"test": True,
"merchantId": "<MERCHANT ID>",
"merchantId": setup_response["merchantId"],
}

response = client.pricing_policy(request)
Expand Down
1 change: 1 addition & 0 deletions tests/integration/resend_payment_link_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_resend_payment_link():
assert setup_response.get("success")

request = {
"test": True,
"linkCode": setup_response["linkCode"],
}

Expand Down
3 changes: 2 additions & 1 deletion tests/integration/simple_capture_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ def test_simple_capture():
"pan": "4111111111111111",
"expMonth": "12",
"expYear": "2025",
"amount": "25.55",
"amount": "42.45",
"test": True,
"bypassDupeFilter": True,
}

setup_response = client.preauth(setup_request)
Expand Down
15 changes: 15 additions & 0 deletions tests/integration/tc_log_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ def test_tc_log():

client = _get_test_client("")

setup_request = {
"test": True,
"terminalName": terminal,
"tcName": "HIPPA Disclosure",
"tcContent": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ullamcorper id urna quis pulvinar. Pellentesque vestibulum justo ac nulla consectetur tristique. Suspendisse arcu arcu, viverra vel luctus non, dapibus vitae augue. Aenean ac volutpat purus. Curabitur in lacus nisi. Nam vel sagittis eros. Curabitur faucibus ut nisl in pulvinar. Nunc egestas, orci ut porttitor tempus, ante mauris pellentesque ex, nec feugiat purus arcu ac metus. Cras sodales ornare lobortis. Aenean lacinia ultricies purus quis pharetra. Cras vestibulum nulla et magna eleifend eleifend. Nunc nibh dolor, malesuada ut suscipit vitae, bibendum quis dolor. Phasellus ultricies ex vitae dolor malesuada, vel dignissim neque accumsan.",
"sigFormat": blockchyp.SignatureFormat.PNG,
"sigWidth": 200,
"sigRequired": True,
}

setup_response = client.terms_and_conditions(setup_request)
print("Setup response: %r" % setup_response)

assert setup_response.get("success")

request = {
}

Expand Down

0 comments on commit 67baa84

Please sign in to comment.