-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from square/msilvis/api-improvements
Move the api to more closely match the rest of Square APIs
- Loading branch information
Showing
7 changed files
with
154 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: a679ea1c4a7a65af08221a21783dd323549bd283 | ||
|
||
COCOAPODS: 1.8.4 | ||
COCOAPODS: 1.9.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// XCTestCase+SCAPIRequestTests.m | ||
// SquarePointOfSaleSDK-Unit-Tests | ||
// | ||
// Created by Mike Silvis on 10/14/20. | ||
// | ||
|
||
@import SquarePointOfSaleSDK; | ||
|
||
#import <XCTest/XCTest.h> | ||
|
||
@interface SCAPIRequestTests : XCTestCase | ||
@end | ||
|
||
@implementation SCAPIRequestTests | ||
|
||
- (void)test_initializerSetsAllProperties; | ||
{ | ||
|
||
NSURL *const callbackURL = [NSURL URLWithString:@"my-app://perform-callback"]; | ||
SCCMoney *const amount = [SCCMoney moneyWithAmountCents:100 currencyCode:@"USD" error:NULL]; | ||
|
||
XCTAssertNotNil(callbackURL); | ||
XCTAssertNotNil(amount); | ||
|
||
[SCCAPIRequest setApplicationID:@"my-app-client-id"]; | ||
|
||
SCCAPIRequest *const request = [SCCAPIRequest requestWithCallbackURL:callbackURL | ||
amount:amount | ||
userInfoString:@"user-info-string" | ||
locationID:@"location-id" | ||
notes:@"notes" | ||
customerID:@"customer-id" | ||
supportedTenderTypes:SCCAPIRequestTenderTypeCard | ||
clearsDefaultFees:YES | ||
returnsAutomaticallyAfterPayment:YES | ||
disablesKeyedInCardEntry:YES | ||
skipsReceipt:YES | ||
error:NULL]; | ||
|
||
XCTAssertEqual(request.amount, amount); | ||
XCTAssertTrue([request.userInfoString isEqualToString:@"user-info-string"]); | ||
XCTAssertTrue([request.locationID isEqualToString:@"location-id"]); | ||
XCTAssertTrue([request.notes isEqualToString:@"notes"]); | ||
XCTAssertTrue([request.customerID isEqualToString:@"customer-id"]); | ||
XCTAssertTrue([request.apiVersion isEqualToString:@"1.3"]); | ||
XCTAssertTrue([request.sdkVersion isEqualToString:@"3.4.1"]); | ||
XCTAssertEqual(request.supportedTenderTypes, SCCAPIRequestTenderTypeCard); | ||
XCTAssertEqual(request.clearsDefaultFees, YES); | ||
XCTAssertEqual(request.returnsAutomaticallyAfterPayment, YES); | ||
XCTAssertEqual(request.disablesKeyedInCardEntry, YES); | ||
XCTAssertEqual(request.skipsReceipt, YES); | ||
} | ||
|
||
@end |
Oops, something went wrong.