diff --git a/CHANGELOG.md b/CHANGELOG.md
index 701f5423..e7a02441 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
HiPay iOS SDK change log and release notes
================================================
+1.11.3
+-----
+* fix brand with space
+
1.11.2
-----
* Replace UIWebView (deprecated) by WKWebView
diff --git a/Example/HiPayFullservice/HPFDemoTableViewController.m b/Example/HiPayFullservice/HPFDemoTableViewController.m
index 613c376a..2ca730f4 100644
--- a/Example/HiPayFullservice/HPFDemoTableViewController.m
+++ b/Example/HiPayFullservice/HPFDemoTableViewController.m
@@ -353,6 +353,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
else if (transactionError.userInfo[NSLocalizedFailureReasonErrorKey] != nil) {
cell.detailTextLabel.text = transactionError.userInfo[NSLocalizedFailureReasonErrorKey];
}
+ else if (transactionError.userInfo[HPFErrorCodeHTTPParsedResponseKey] != nil
+ && transactionError.userInfo[HPFErrorCodeHTTPParsedResponseKey][@"message"] != nil) {
+ cell.detailTextLabel.text = transactionError.userInfo[HPFErrorCodeHTTPParsedResponseKey][@"message"];
+ }
return cell;
}
diff --git a/Example/Podfile.lock b/Example/Podfile.lock
index 0d1d480e..893adbc5 100644
--- a/Example/Podfile.lock
+++ b/Example/Podfile.lock
@@ -1,12 +1,12 @@
PODS:
- - HiPayFullservice (1.11.2):
- - HiPayFullservice/Core (= 1.11.2)
- - HiPayFullservice/Payment-Screen (= 1.11.2)
- - HiPayFullservice/Core (1.11.2)
- - HiPayFullservice/Payment-Screen (1.11.2):
+ - HiPayFullservice (1.11.3):
+ - HiPayFullservice/Core (= 1.11.3)
+ - HiPayFullservice/Payment-Screen (= 1.11.3)
+ - HiPayFullservice/Core (1.11.3)
+ - HiPayFullservice/Payment-Screen (1.11.3):
- HiPayFullservice/Core
- HiPayFullservice/Utilities
- - HiPayFullservice/Utilities (1.11.2):
+ - HiPayFullservice/Utilities (1.11.3):
- HiPayFullservice/Core
- OCMock (3.5)
- OHHTTPStubs (8.0.0):
@@ -38,7 +38,7 @@ EXTERNAL SOURCES:
:path: "../"
SPEC CHECKSUMS:
- HiPayFullservice: abc2143d2c1176297aee81d01a24dde228cd6175
+ HiPayFullservice: 70bfb55b9315412314cbfe2a50ea403f8db76b30
OCMock: 4ab4577fc941af31f4a0398f6e7e230cf21fc72a
OHHTTPStubs: 9cbce6364bec557cc3439aa6bb7514670d780881
diff --git a/Example/Tests/HiPayFullservice/Core/Client/HPFClientConfigTests.m b/Example/Tests/HiPayFullservice/Core/Client/HPFClientConfigTests.m
index f37d4899..20144040 100644
--- a/Example/Tests/HiPayFullservice/Core/Client/HPFClientConfigTests.m
+++ b/Example/Tests/HiPayFullservice/Core/Client/HPFClientConfigTests.m
@@ -39,9 +39,17 @@ - (void)testSettingValues
XCTAssertEqualObjects([HPFClientConfig sharedClientConfig].password, @"passwd");
XCTAssertTrue([HPFClientConfig sharedClientConfig].environment == HPFEnvironmentProduction);
XCTAssertEqualObjects([HPFClientConfig sharedClientConfig].appRedirectionURL, [NSURL URLWithString:@"hipayexample://hipay-fullservice"]);
- XCTAssertNotNil([HPFClientConfig sharedClientConfig].userAgent);
XCTAssertTrue([HPFClientConfig sharedClientConfig].isPaymentCardStorageEnabled);
XCTAssertFalse([[HPFClientConfig sharedClientConfig] isEqual:@""]);
+
+ XCTestExpectation *userAgent = [[XCTestExpectation alloc] initWithDescription:@"User Agent"];
+ XCTWaiterResult waiter = [XCTWaiter waitForExpectations:@[userAgent] timeout:1.0];
+ if (waiter == XCTWaiterResultTimedOut) {
+ XCTAssertNotNil([HPFClientConfig sharedClientConfig].userAgent);
+ }
+ else {
+ XCTFail(@"Expectations error: UserAgent == nil");
+ }
}
- (void)testInitSchemeError
diff --git a/Example/Tests/HiPayFullservice/Core/Secure Vault/Mapper/HPFPaymentCardTokenMapperTests.m b/Example/Tests/HiPayFullservice/Core/Secure Vault/Mapper/HPFPaymentCardTokenMapperTests.m
index 0bb6b718..40f0ec30 100644
--- a/Example/Tests/HiPayFullservice/Core/Secure Vault/Mapper/HPFPaymentCardTokenMapperTests.m
+++ b/Example/Tests/HiPayFullservice/Core/Secure Vault/Mapper/HPFPaymentCardTokenMapperTests.m
@@ -49,7 +49,7 @@ - (void)testMapping
@"card_expiry_year": @"2018",
@"issuer": @"ACME Bank",
@"country": @"FR",
- @"domesticNetwork": @"cb"
+ @"domestic_network": @"cb"
};
OCMockObject *mockedMapper = [OCMockObject partialMockForObject:[[HPFPaymentCardTokenMapper alloc] initWithRawData:rawData]];
@@ -74,7 +74,7 @@ - (void)testMapping
XCTAssertEqualObjects(@2018, paymentCardToken.cardExpiryYear);
XCTAssertEqualObjects([rawData objectForKey:@"issuer"], paymentCardToken.issuer);
XCTAssertEqualObjects([rawData objectForKey:@"country"], paymentCardToken.country);
- XCTAssertEqualObjects([rawData objectForKey:@"domesticNetwork"], paymentCardToken.domesticNetwork);
+ XCTAssertEqualObjects([rawData objectForKey:@"domestic_network"], paymentCardToken.domesticNetwork);
[mockedMapper verify];
}
diff --git a/Example/Tests/HiPayFullservice/Core/Utilities/Formatter/HPFCardNumberFormatterTests.m b/Example/Tests/HiPayFullservice/Core/Utilities/Formatter/HPFCardNumberFormatterTests.m
index 41641669..c5e8767d 100644
--- a/Example/Tests/HiPayFullservice/Core/Utilities/Formatter/HPFCardNumberFormatterTests.m
+++ b/Example/Tests/HiPayFullservice/Core/Utilities/Formatter/HPFCardNumberFormatterTests.m
@@ -75,7 +75,9 @@ - (void)testPaymentProductCodeForPlainTextNumber
[[[mockedFormatter expect] andReturn:@"51051051051051"] digitsOnlyFromPlainText:@"mastercard3"];
[[[mockedFormatter expect] andReturn:@"675941110000"] digitsOnlyFromPlainText:@"maestro1"];
- [[[mockedFormatter expect] andReturn:@"670300000000"] digitsOnlyFromPlainText:@"maestro2"];
+ [[[mockedFormatter expect] andReturn:@"6766000000000"] digitsOnlyFromPlainText:@"maestro2"];
+
+ [[[mockedFormatter expect] andReturn:@"67030000000000003"] digitsOnlyFromPlainText:@"bcmc1"];
[[[mockedFormatter expect] andReturn:@"378282246310"] digitsOnlyFromPlainText:@"amex1"];
[[[mockedFormatter expect] andReturn:@"371449635398"] digitsOnlyFromPlainText:@"amex2"];
@@ -96,6 +98,8 @@ - (void)testPaymentProductCodeForPlainTextNumber
XCTAssertEqualObjects([formatter paymentProductCodesForPlainTextNumber:@"maestro1"], [NSSet setWithObject:HPFPaymentProductCodeMaestro]);
XCTAssertEqualObjects([formatter paymentProductCodesForPlainTextNumber:@"maestro2"], [NSSet setWithObject:HPFPaymentProductCodeMaestro]);
+ XCTAssertEqualObjects([formatter paymentProductCodesForPlainTextNumber:@"bcmc1"], [NSSet setWithObject:HPFPaymentProductCodeBCMC]);
+
XCTAssertEqualObjects([formatter paymentProductCodesForPlainTextNumber:@"amex1"], [NSSet setWithObject:HPFPaymentProductCodeAmericanExpress]);
XCTAssertEqualObjects([formatter paymentProductCodesForPlainTextNumber:@"amex2"], [NSSet setWithObject:HPFPaymentProductCodeAmericanExpress]);
@@ -258,13 +262,21 @@ - (void)testIsInRangeForPaymentProductCode
[mockedFormatter verify];
[[[mockedFormatter expect] andReturn:@"5"] digitsOnlyFromPlainText:@"maestro1"];
- [[[mockedFormatter expect] andReturn:@"59"] digitsOnlyFromPlainText:@"maestro2"];
- [[[mockedFormatter expect] andReturn:@"596865"] digitsOnlyFromPlainText:@"maestro3"];
+ [[[mockedFormatter expect] andReturn:@"639"] digitsOnlyFromPlainText:@"maestro2"];
+ [[[mockedFormatter expect] andReturn:@"679"] digitsOnlyFromPlainText:@"maestro3"];
XCTAssertFalse([formatter plainTextNumber:@"maestro1" isInRangeForPaymentProductCode:HPFPaymentProductCodeMaestro]);
XCTAssertTrue([formatter plainTextNumber:@"maestro2" isInRangeForPaymentProductCode:HPFPaymentProductCodeMaestro]);
XCTAssertTrue([formatter plainTextNumber:@"maestro3" isInRangeForPaymentProductCode:HPFPaymentProductCodeMaestro]);
[mockedFormatter verify];
+ [[[mockedFormatter expect] andReturn:@"4"] digitsOnlyFromPlainText:@"bcmc1"];
+ [[[mockedFormatter expect] andReturn:@"561400"] digitsOnlyFromPlainText:@"bcmc2"];
+ [[[mockedFormatter expect] andReturn:@"479658"] digitsOnlyFromPlainText:@"bcmc3"];
+ XCTAssertFalse([formatter plainTextNumber:@"bcmc1" isInRangeForPaymentProductCode:HPFPaymentProductCodeBCMC]);
+ XCTAssertTrue([formatter plainTextNumber:@"bcmc2" isInRangeForPaymentProductCode:HPFPaymentProductCodeBCMC]);
+ XCTAssertTrue([formatter plainTextNumber:@"bcmc3" isInRangeForPaymentProductCode:HPFPaymentProductCodeBCMC]);
+ [mockedFormatter verify];
+
[[[mockedFormatter expect] andReturn:@"3"] digitsOnlyFromPlainText:@"diners1"];
[[[mockedFormatter expect] andReturn:@"38"] digitsOnlyFromPlainText:@"diners2"];
[[[mockedFormatter expect] andReturn:@"398776"] digitsOnlyFromPlainText:@"diners3"];
diff --git a/Gemfile.lock b/Gemfile.lock
index d33b96e3..0ea69a45 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -54,7 +54,7 @@ GEM
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
- concurrent-ruby (1.1.5)
+ concurrent-ruby (1.1.6)
declarative (0.0.10)
declarative-option (0.1.0)
digest-crc (0.4.1)
@@ -178,7 +178,7 @@ GEM
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
- simctl (1.6.7)
+ simctl (1.6.8)
CFPropertyList
naturally
slack-notifier (2.3.2)
diff --git a/HiPayFullservice.podspec b/HiPayFullservice.podspec
index 32bb9582..6c74ed07 100644
--- a/HiPayFullservice.podspec
+++ b/HiPayFullservice.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "HiPayFullservice"
- s.version = "1.11.2"
+ s.version = "1.11.3"
s.summary = "HiPay SDK for iOS lets you accept payments in your iOS application."
s.description = <<-DESC
HiPay is a new generation of payment platform optimized for todays’ e-tailers.
diff --git a/HiPayFullservice/Payment Screen/Controller/Payment Product/HPFTokenizableCardPaymentProductViewController.m b/HiPayFullservice/Payment Screen/Controller/Payment Product/HPFTokenizableCardPaymentProductViewController.m
index 85b9d361..078427b6 100644
--- a/HiPayFullservice/Payment Screen/Controller/Payment Product/HPFTokenizableCardPaymentProductViewController.m
+++ b/HiPayFullservice/Payment Screen/Controller/Payment Product/HPFTokenizableCardPaymentProductViewController.m
@@ -253,8 +253,6 @@ - (void)inferPaymentProductCode
HPFPaymentProduct *newInferredPaymentProduct = [self getPaymentProductFromInferedCode:inferedPaymentProductCode];
- BOOL isDomestic = [HPFPaymentProduct isPaymentProductCode:self.paymentProduct.code domesticNetworkOfPaymentProductCode:inferedPaymentProductCode];
-
if (newInferredPaymentProduct != inferedPaymentProduct) {
inferedPaymentProduct = newInferredPaymentProduct;
@@ -266,13 +264,11 @@ - (void)inferPaymentProductCode
}
}
- if (!isDomestic) {
- [self updateTitleHeader];
- [self.delegate paymentProductViewController:self changeSelectedPaymentProduct:inferedPaymentProduct];
- }
+ [self updateTitleHeader];
+ [self.delegate paymentProductViewController:self changeSelectedPaymentProduct:inferedPaymentProduct];
}
- if ((inferedPaymentProduct == nil) && !isDomestic) {
+ if (inferedPaymentProduct == nil) {
paymentProductDisallowed = YES;
} else {
paymentProductDisallowed = NO;
@@ -517,7 +513,9 @@ - (void)submit
HPFOrderRequest *orderRequest = [self createOrderRequest];
- orderRequest.paymentProductCode = (cardToken.domesticNetwork) ? cardToken.domesticNetwork : cardToken.brand;
+ NSString *paymentProductCode = (cardToken.domesticNetwork) ? cardToken.domesticNetwork : cardToken.brand;
+ paymentProductCode = [paymentProductCode stringByReplacingOccurrencesOfString:@" " withString:@"-"];
+ orderRequest.paymentProductCode = paymentProductCode;
orderRequest.paymentMethod = [HPFCardTokenPaymentMethodRequest cardTokenPaymentMethodRequestWithToken:cardToken.token eci:self.paymentPageRequest.eci authenticationIndicator:self.paymentPageRequest.authenticationIndicator];
[self performOrderRequest:orderRequest signature:self.signature];
diff --git a/HiPayFullservice/Utilities/Resources/card-numbers-info.plist b/HiPayFullservice/Utilities/Resources/card-numbers-info.plist
index 65cc28bb..97ee0337 100644
--- a/HiPayFullservice/Utilities/Resources/card-numbers-info.plist
+++ b/HiPayFullservice/Utilities/Resources/card-numbers-info.plist
@@ -75,12 +75,67 @@
6
+ bcmc
+
+ ranges
+
+ {6703,1}
+ {606005,1}
+ {479658,1}
+ {561358,1}
+ {561359,1}
+ {56136,1}
+ {56137,1}
+ {56138,1}
+ {56139,1}
+ {561400,1}
+ {561401,1}
+ {561402,1}
+ {561403,1}
+ {561404,1}
+ {561405,1}
+ {561406,1}
+ {561407,1}
+
+ lengths
+
+ {16,3}
+
+ format
+
+ 4
+ 4
+ 4
+ 4
+ 3
+
+
maestro
ranges
{50,1}
- {56,14}
+ {56,1}
+ {57,1}
+ {58,1}
+ {639,1}
+ {6701,1}
+ {6702,1}
+ {6704,1}
+ {6705,1}
+ {6706,1}
+ {6707,1}
+ {6708,1}
+ {6709,1}
+ {671,1}
+ {672,1}
+ {673,1}
+ {674,1}
+ {675,1}
+ {676,1}
+ {677,1}
+ {678,1}
+ {679,1}
lengths
@@ -92,6 +147,7 @@
4
4
4
+ 3
diff --git a/fastlane/Fastfile b/fastlane/Fastfile
index 4a1d0bf1..65e40a03 100644
--- a/fastlane/Fastfile
+++ b/fastlane/Fastfile
@@ -59,7 +59,7 @@ platform :ios do
desc "Deploy HiPayFullservice on Cocoapods"
lane :DeployHiPayFullservice do
# Set version number (e.g 1.0.0)
- version = "1.11.2"
+ version = "1.11.3"
# Set version in PodSpec file
version_bump_podspec(path: "HiPayFullservice.podspec", version_number: version)