Skip to content

Commit

Permalink
added documentation for the partner api section
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-blockchyp committed Oct 27, 2023
1 parent 6a45ad4 commit 0c85832
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 42 deletions.
81 changes: 49 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6670,20 +6670,38 @@ class ExampleClass {

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.
Most of the APIs below are for portfolio reporting and range from basic partner commission statements
to individual statements with all underlying card brand data.

We also provide a pricing policy API that enables partners to pull down the current pricing rules
in force for any merchant in their portfolio.

<aside class="info">
<b>Currency Data</b>
<p>
All partner APIs return currency and percentage values in two formats: floating point and formatted strings.
</p>
<p>
It's recommended that all developers use the formatted string as this will ensure the most precise values.
Floating point numbers are usually not appropriate for currency or fixed point decimal numbers as
the underlying binary encoding can lead to errors in precision. We provide floating point values
only as a convenience for developers want to save development time and can live with approximated
values in their use case.
</p>
</aside>

#### Partner Statements


#### Retrieve Pricing Policy



* **API Credential Types:** Partner
* **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.
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.



Expand All @@ -6703,7 +6721,7 @@ int main (int argc, const char * argv[])
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client partnerStatementsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
[client pricingPolicyWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
Expand All @@ -6730,7 +6748,7 @@ class ExampleClass {
)

var request: [String:Any] = [:]
client.partnerStatements(withRequest: request, handler: { (request, response, error) in
client.pricingPolicy(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
Expand All @@ -6743,20 +6761,18 @@ class ExampleClass {



#### Merchant Invoices
#### Partner Statements



* **API Credential Types:** Partner or Merchant
* **Required Role:** Partner API Access or Merchant API
* **API Credential Types:** Partner
* **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.





##### From Objective-C:

```objective-c
Expand All @@ -6773,7 +6789,7 @@ int main (int argc, const char * argv[])
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client merchantInvoicesWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
[client partnerStatementsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
Expand All @@ -6800,7 +6816,7 @@ class ExampleClass {
)

var request: [String:Any] = [:]
client.merchantInvoices(withRequest: request, handler: { (request, response, error) in
client.partnerStatements(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
Expand All @@ -6813,14 +6829,17 @@ class ExampleClass {



#### Merchant Invoice Detail
#### Merchant Invoices



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

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.


The API returns detailed information about a specific merchant statement.



Expand All @@ -6840,7 +6859,7 @@ int main (int argc, const char * argv[])
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client merchantInvoiceDetailWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
[client merchantInvoicesWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
Expand All @@ -6867,7 +6886,7 @@ class ExampleClass {
)

var request: [String:Any] = [:]
client.merchantInvoiceDetail(withRequest: request, handler: { (request, response, error) in
client.merchantInvoices(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
Expand All @@ -6880,16 +6899,14 @@ class ExampleClass {



#### Partner Statement Detail
#### Merchant Invoice 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.
The API returns detailed information about a specific merchant statement.



Expand All @@ -6909,7 +6926,7 @@ int main (int argc, const char * argv[])
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client partnerStatementDetailWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
[client merchantInvoiceDetailWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
Expand All @@ -6936,7 +6953,7 @@ class ExampleClass {
)

var request: [String:Any] = [:]
client.partnerStatementDetail(withRequest: request, handler: { (request, response, error) in
client.merchantInvoiceDetail(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
Expand All @@ -6949,16 +6966,16 @@ class ExampleClass {



#### Retrieve Pricing Policy
#### Partner Statement Detail



* **API Credential Types:** Partner
* **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,
but other inactive policies can be returned by providing the `id` parameter.
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.



Expand All @@ -6978,7 +6995,7 @@ int main (int argc, const char * argv[])
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];

NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client pricingPolicyWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
[client partnerStatementDetailWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
Expand All @@ -7005,7 +7022,7 @@ class ExampleClass {
)

var request: [String:Any] = [:]
client.pricingPolicy(withRequest: request, handler: { (request, response, error) in
client.partnerStatementDetail(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
Expand Down
6 changes: 3 additions & 3 deletions blockchyp-ios/BlockChyp/BlockChyp.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ NS_ASSUME_NONNULL_BEGIN
// Returns the transaction history for a merchant.
-(void)transactionHistoryWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

// Returns pricing policy for a merchant.
-(void)pricingPolicyWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

// Returns a list of partner statements.
-(void)partnerStatementsWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

Expand All @@ -147,9 +150,6 @@ NS_ASSUME_NONNULL_BEGIN
// Returns detail for a single partner statement.
-(void)partnerStatementDetailWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

// Returns pricing policy for a merchant.
-(void)pricingPolicyWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;

// Returns low level details for how partner commissions were calculated for a
// specific merchant statement.
-(void)partnerCommissionBreakdownWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler;
Expand Down
14 changes: 7 additions & 7 deletions blockchyp-ios/BlockChyp/BlockChyp.m
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ -(void)transactionHistoryWithRequest:(NSDictionary *)request handler:(BlockChypC

}

// Returns pricing policy for a merchant.
-(void)pricingPolicyWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler {

[self routeGatewayRequestWith:request path:@"/api/read-pricing-policy" method:@"POST" handler:handler];

}

// Returns a list of partner statements.
-(void)partnerStatementsWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler {

Expand Down Expand Up @@ -308,13 +315,6 @@ -(void)partnerStatementDetailWithRequest:(NSDictionary *)request handler:(BlockC

}

// Returns pricing policy for a merchant.
-(void)pricingPolicyWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler {

[self routeGatewayRequestWith:request path:@"/api/read-pricing-policy" method:@"POST" handler:handler];

}

// Returns low level details for how partner commissions were calculated for a
// specific merchant statement.
-(void)partnerCommissionBreakdownWithRequest:(NSDictionary *)request handler:(BlockChypCompletionHandler)handler {
Expand Down

0 comments on commit 0c85832

Please sign in to comment.