diff --git a/README.md b/README.md index be00feb..fd54e23 100644 --- a/README.md +++ b/README.md @@ -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. + -#### 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. @@ -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"); @@ -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") @@ -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 @@ -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"); @@ -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") @@ -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. @@ -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"); @@ -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") @@ -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. @@ -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"); @@ -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") @@ -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. @@ -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"); @@ -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") diff --git a/blockchyp-ios/BlockChyp/BlockChyp.h b/blockchyp-ios/BlockChyp/BlockChyp.h index 524154f..c81c8bf 100644 --- a/blockchyp-ios/BlockChyp/BlockChyp.h +++ b/blockchyp-ios/BlockChyp/BlockChyp.h @@ -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; @@ -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; diff --git a/blockchyp-ios/BlockChyp/BlockChyp.m b/blockchyp-ios/BlockChyp/BlockChyp.m index 26a9c5b..e5f88a0 100644 --- a/blockchyp-ios/BlockChyp/BlockChyp.m +++ b/blockchyp-ios/BlockChyp/BlockChyp.m @@ -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 { @@ -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 {