Skip to content

Commit

Permalink
Bump version to 2.18.5
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-blockchyp committed Apr 29, 2024
1 parent 6b4c394 commit 60e44d9
Show file tree
Hide file tree
Showing 95 changed files with 249 additions and 101 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4332,6 +4332,50 @@ print("Response: %r" % response)

```

#### Merchant Credential Generation



* **API Credential Types:** Partner
* **Required Role:** Partner API Access

This API allows partners to generate API credentials for a merchant.

The `merchantId` is required and must be the id of a valid merchant.

Credentials are not delete protected by default. Pass in `deleteProtected` to enable delete protection.

The optional `notes` field will populate the notes in the credentials.

By default no roles will be assigned unless valid, comma-delimited, role codes are passed in the `roles` field.




```python
import os

import blockchyp

# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)

# populate request parameters.
request = {
}

# run the transaction.
response = client.merchant_credential_generation(request)

print("Response: %r" % response)


```




Expand Down
12 changes: 11 additions & 1 deletion blockchyp/blockchyp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down Expand Up @@ -901,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
19 changes: 19 additions & 0 deletions examples/merchant_credential_generation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os

import blockchyp

# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)

# populate request parameters.
request = {
}

# run the transaction.
response = client.merchant_credential_generation(request)

print("Response: %r" % response)
2 changes: 1 addition & 1 deletion tests/integration/activate_terminal_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/add_test_merchant_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/batch_history_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/boolean_prompt_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/cancel_payment_link_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down 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
2 changes: 1 addition & 1 deletion tests/integration/capture_signature_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/deactivate_terminal_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/delete_branding_asset_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/delete_customer_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/delete_media_asset_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/delete_queued_transaction_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/delete_slide_show_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/delete_survey_question_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/delete_test_merchant_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/delete_token_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/empty_branding_asset_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/empty_slide_show_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/gateway_timeout_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/get_customer_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/get_merchants_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/invite_merchant_user_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/link_token_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/list_queued_transactions_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/list_terminals_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/media_asset_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/media_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/media_upload_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
47 changes: 47 additions & 0 deletions tests/integration/merchant_credential_generation_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
# to this file will be lost every time the code is regenerated.
import os
import os.path
import time
import uuid
import pkg_resources

import pytest

import blockchyp

from .util import _get_test_client, _get_test_config


@pytest.mark.itest
def test_merchant_credential_generation():
"""Can generate merchant api credentials."""


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


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": setup_response["merchantId"],
}

response = client.merchant_credential_generation(request)
print("Response: %r" % response)

assert response.get("success") is True
2 changes: 1 addition & 1 deletion tests/integration/merchant_invoice_detail_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/merchant_invoices_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/merchant_platforms_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/merchant_profile_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/merchant_users_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/new_transaction_display_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/pan_charge_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/pan_enroll_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/pan_preauth_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down 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/partial_refund_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 BlockChyp, Inc. All rights reserved. Use of this code is
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
Expand Down

0 comments on commit 60e44d9

Please sign in to comment.