Skip to content

Commit

Permalink
Merge pull request #261 from blockchyp/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
devops-blockchyp committed Apr 3, 2024
1 parent 232375a commit ec4a28c
Show file tree
Hide file tree
Showing 96 changed files with 237 additions and 92 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
13 changes: 12 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 @@ -834,6 +834,17 @@ 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
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)
34 changes: 34 additions & 0 deletions tests/integration/_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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_():
"""."""


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


client = _get_test_client("")

request = {
}

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
2 changes: 1 addition & 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
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
37 changes: 37 additions & 0 deletions tests/integration/merchant_credential_generation_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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("")

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

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
2 changes: 1 addition & 1 deletion 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
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
2 changes: 1 addition & 1 deletion tests/integration/partner_commission_breakdown_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
Loading

0 comments on commit ec4a28c

Please sign in to comment.