Skip to content

Commit

Permalink
added partner statement list api
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-blockchyp committed Oct 19, 2023
1 parent 2e5556b commit 74a2fdb
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 38 deletions.
123 changes: 85 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3647,44 +3647,6 @@ the standard underwriting process via offer codes and invitations.



#### Retrieve Pricing Policy



* **API Credential Types:** Partner
* **Required Role:** Read Pricing API

The API returns the current pricing policy for a merchant. This API is valid for partner scoped API credentials
and `merchantId` is a required parameter. By default this API returns the currently in-force pricing policy for a merchant,
but other inactive policies can be returned by providing the `id` parameter.




```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.pricing_policy(request)

print("Response: %r" % response)


```

#### Merchant Profile


Expand Down Expand Up @@ -4096,6 +4058,91 @@ print("Response: %r" % response)

```

### Partner Utilities


These partner only APIs give ISV partners advanced reporting and tools for managing their portfolio.

Use of these APIs requires partner scoped API credentials
with special roles and permissions that may require a special arrangement with BlockChyp.



#### Partner Statements



* **API Credential Types:** Partner
* **Required Role:** Merchant Management

The API returns a list of partner residual statements. By default, all statements are returned with the most recent
statements listed first. Optional date parameters can filter statements to a specific date range.




```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.partner_statements(request)

print("Response: %r" % response)


```

#### Retrieve Pricing Policy



* **API Credential Types:** Partner
* **Required Role:** Read Pricing API

The API returns the current pricing policy for a merchant. This API is valid for partner scoped API credentials
and `merchantId` is a required parameter. By default this API returns the currently in-force pricing policy for a merchant,
but other inactive policies can be returned by providing the `id` parameter.




```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.pricing_policy(request)

print("Response: %r" % response)


```




Expand Down
11 changes: 11 additions & 0 deletions blockchyp/blockchyp.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,17 @@ def transaction_history(self, request):
test=request.get("test", False),
)

def partner_statements(self, request):
# type: (dict) -> dict
"""Returns pricing policy for a merchant."""

return self._gateway_request(
method="POST",
path="/api/partner-statement-list",
body=request,
test=request.get("test", False),
)

def pricing_policy(self, request):
# type: (dict) -> dict
"""Returns pricing policy for a merchant."""
Expand Down
19 changes: 19 additions & 0 deletions examples/partner_statements.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.partner_statements(request)

print("Response: %r" % response)
36 changes: 36 additions & 0 deletions tests/integration/partner_statements_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2019-2023 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_partner_statements():
"""Can list partner statements."""


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


client = _get_test_client("")

request = {
"test": True,
}

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

assert response.get("success") is True

0 comments on commit 74a2fdb

Please sign in to comment.