Skip to content

Commit

Permalink
added partner statement detail api
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-blockchyp committed Oct 19, 2023
1 parent 74a2fdb commit bc316d3
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 3 deletions.
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4073,7 +4073,7 @@ with special roles and permissions that may require a special arrangement with B


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

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.
Expand Down Expand Up @@ -4103,14 +4103,52 @@ response = client.partner_statements(request)
print("Response: %r" % response)


```

#### Partner Statement Detail



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

The API returns detailed information about a specific partner statement. The optional `includeMerchantStatement` and
`includeInterchange` parameters can be used to return low level detail about how the
residuals or commissions were computed.




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

print("Response: %r" % response)


```

#### Retrieve Pricing Policy



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

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,
Expand Down
13 changes: 12 additions & 1 deletion blockchyp/blockchyp.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def transaction_history(self, request):

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

return self._gateway_request(
method="POST",
Expand All @@ -777,6 +777,17 @@ def partner_statements(self, request):
test=request.get("test", False),
)

def partner_statement_detail(self, request):
# type: (dict) -> dict
"""Returns detail for a single partner statement."""

return self._gateway_request(
method="POST",
path="/api/partner-statement-detail",
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_statement_detail.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_statement_detail(request)

print("Response: %r" % response)
36 changes: 36 additions & 0 deletions tests/integration/partner_statement_detail_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_statement_detail():
"""Can list partner statements."""


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


client = _get_test_client("")

request = {
"test": True,
}

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

assert response.get("success") is True

0 comments on commit bc316d3

Please sign in to comment.