From 960e0a7b54863d71b3b2bfc18998fa9ff39b5b58 Mon Sep 17 00:00:00 2001 From: BlockChyp SDK Builder Date: Fri, 27 Oct 2023 20:50:21 +0000 Subject: [PATCH] updating merchant invoices api docs --- README.md | 8 ++- blockchyp-ios/Tests/MerchantInvoicesTest.m | 66 +++++++++++++++++++++ blockchyp-ios/Tests/PartnerStatementsTest.m | 2 +- 3 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 blockchyp-ios/Tests/MerchantInvoicesTest.m diff --git a/README.md b/README.md index 149858d..dae29c6 100644 --- a/README.md +++ b/README.md @@ -6847,10 +6847,12 @@ class ExampleClass { * **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 a list of merchant statements and invoices. By default, all invoices are returned with the most recent +statements listed first. Optional date parameters (`startDate` and `endDate`) can be used to filter statements by date +range. +The `invoiceType` parameter can also be used to filter invoices by type. Invoices could be conventional invoices, such +as those generated when ordering terminals or gift cards, or invoices could be merchant statements. diff --git a/blockchyp-ios/Tests/MerchantInvoicesTest.m b/blockchyp-ios/Tests/MerchantInvoicesTest.m new file mode 100644 index 0000000..079ce2a --- /dev/null +++ b/blockchyp-ios/Tests/MerchantInvoicesTest.m @@ -0,0 +1,66 @@ +// Copyright 2019-2022 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 "BlockChypTest.h" + +@interface MerchantInvoicesTest : BlockChypTest + + + +@end + +@implementation MerchantInvoicesTest + +- (void)setUp { + + TestConfiguration *config = [self loadConfiguration]; + BlockChyp *client = [[BlockChyp alloc] initWithApiKey:config.apiKey bearerToken:config.bearerToken signingKey:config.signingKey]; + client.gatewayHost = config.gatewayHost; + client.testGatewayHost = config.testGatewayHost; + client.dashboardHost = config.dashboardHost; + + + +} + +- (void)tearDown { + +} + +- (void)testMerchantInvoices{ + + TestConfiguration *config = [self loadConfiguration]; + BlockChyp *client = [[BlockChyp alloc] initWithApiKey:config.apiKey bearerToken:config.bearerToken signingKey:config.signingKey]; + client.gatewayHost = config.gatewayHost; + client.testGatewayHost = config.testGatewayHost; + client.dashboardHost = config.dashboardHost; + + + XCTestExpectation *expectation = [self expectationWithDescription:@"MerchantInvoices Test"]; + + NSMutableDictionary *request = [[NSMutableDictionary alloc] init]; + request[@"test"] = @YES; + + [client merchantInvoicesWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) { + + [self logJSON:response]; + XCTAssertNotNil(response); + // response assertions + XCTAssertTrue([[response objectForKey:@"success"]boolValue]); + + [expectation fulfill]; + }]; + + @try { + [self waitForExpectationsWithTimeout:60 handler:nil]; + } + @catch (NSException *exception) { + NSLog(@"Exception:%@",exception); + } + +} + +@end diff --git a/blockchyp-ios/Tests/PartnerStatementsTest.m b/blockchyp-ios/Tests/PartnerStatementsTest.m index aef6b59..4f24427 100644 --- a/blockchyp-ios/Tests/PartnerStatementsTest.m +++ b/blockchyp-ios/Tests/PartnerStatementsTest.m @@ -44,7 +44,7 @@ - (void)testPartnerStatements{ NSMutableDictionary *request = [[NSMutableDictionary alloc] init]; request[@"test"] = @YES; - [client merchantInvoicesWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) { + [client partnerStatementsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) { [self logJSON:response]; XCTAssertNotNil(response);