Skip to content

Commit

Permalink
ASDK-434
Browse files Browse the repository at this point in the history
Ошибка c описанием “(null)” если нет интернета
  • Loading branch information
Budnikov Vyacheslav committed Nov 27, 2017
1 parent d622fce commit 2b0b598
Show file tree
Hide file tree
Showing 21 changed files with 95 additions and 39 deletions.
2 changes: 1 addition & 1 deletion ASDKCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|

s.name = "ASDKCore"
s.version = "1.3.3"
s.version = "1.3.4"
s.summary = "Core library that allows you to use internet acquiring from Tinkoff Bank in your app"
s.description = "Core library that allows you to use internet acquiring from Tinkoff Bank in your app!"

Expand Down
14 changes: 13 additions & 1 deletion ASDKCore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = ASDK;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = "TCS Bank";
TargetAttributes = {
83166ED21C63984E00533D85 = {
Expand Down Expand Up @@ -792,14 +792,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -842,14 +848,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down
7 changes: 6 additions & 1 deletion ASDKCore/API Objects/Errors/ASDKAcquringSdkError.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ - (NSString *)errorDetails
return self.userInfo[kASDKErrorDetails];
}

return [NSString stringWithFormat:@"%@", self.userInfo[kASDKErrorCode]];
if (self.userInfo[kASDKErrorCode])
{
return [NSString stringWithFormat:@"%@", self.userInfo[kASDKErrorCode]];
}

return nil;
}


Expand Down
2 changes: 1 addition & 1 deletion ASDKCore/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.3.2</string>
<string>1.3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion ASDKUI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ASDKUI"
s.version = "1.3.3"
s.version = "1.3.4"
s.summary = "UI components library for internet acquiring from Tinkoff Bank"
s.description = "UI components library for internet acquiring from Tinkoff Bank!"
s.homepage = "https://www.tinkoff.ru"
Expand Down
14 changes: 13 additions & 1 deletion ASDKUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = ASDK;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = "TCS Bank";
TargetAttributes = {
8316724E1C64798800533D85 = {
Expand Down Expand Up @@ -815,14 +815,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -868,14 +874,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down
2 changes: 1 addition & 1 deletion ASDKUI/3DSController/ASDK3DSViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
- (void)showFromViewController:(UIViewController *)viewController
success:(void (^)(NSString *result))success
failure:(void (^)(ASDKAcquringSdkError *statusError))failure
cancel:(void (^)())cancel;
cancel:(void (^)(void))cancel;

@end
4 changes: 2 additions & 2 deletions ASDKUI/3DSController/ASDK3DSViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ @interface ASDK3DSViewController () <UIWebViewDelegate>
@property (nonatomic, strong) ASDKThreeDsData *threeDsData;

@property (nonatomic, strong) void (^onSuccess)(NSString *result);
@property (nonatomic, strong) void (^onCancelled)();
@property (nonatomic, strong) void (^onCancelled)(void);
@property (nonatomic, strong) void (^onError)(ASDKAcquringSdkError *error);

@property (nonatomic, assign) CheckStateType checkStateType;
Expand Down Expand Up @@ -100,7 +100,7 @@ - (instancetype)initWithAddCardRequestKey:(NSString *)requestKey
- (void)showFromViewController:(UIViewController *)viewController
success:(void (^)(NSString *result))success
failure:(void (^)(ASDKAcquringSdkError *statusError))failure
cancel:(void (^)())cancel
cancel:(void (^)(void))cancel
{
self.onSuccess = success;
self.onError = failure;
Expand Down
2 changes: 1 addition & 1 deletion ASDKUI/ASDKLoopViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
- (void)showFromViewController:(UIViewController *)viewController
success:(void (^)(NSString *result))success
failure:(void (^)(ASDKAcquringSdkError *statusError))failure
cancel:(void (^)())cancel;
cancel:(void (^)(void))cancel;

@end
4 changes: 2 additions & 2 deletions ASDKUI/ASDKLoopViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ @interface ASDKLoopViewController () <UITextFieldDelegate>
@property(nonatomic, strong) ASDKAcquiringSdk *acquiringSdk;

@property (nonatomic, strong) void (^onSuccess)(NSString *result);
@property (nonatomic, strong) void (^onCancelled)();
@property (nonatomic, strong) void (^onCancelled)(void);
@property (nonatomic, strong) void (^onError)(ASDKAcquringSdkError *error);

@property (nonatomic, strong) ASDKPaymentFormHeaderCell *headerCell;
Expand All @@ -69,7 +69,7 @@ - (instancetype)initWithAddCardRequestKey:(NSString *)requestKey acquiringSdk:(A
- (void)showFromViewController:(UIViewController *)viewController
success:(void (^)(NSString *result))success
failure:(void (^)(ASDKAcquringSdkError *statusError))failure
cancel:(void (^)())cancel
cancel:(void (^)(void))cancel
{
self.onSuccess = success;
self.onError = failure;
Expand Down
2 changes: 1 addition & 1 deletion ASDKUI/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.3.2</string>
<string>1.3.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion ASDKUI/Payment/ASDKAttachCardViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
customerKey:(NSString *)customerKey
additionalData:(NSDictionary *)data
success:(void (^)(ASDKResponseAttachCard *paymentInfo))success
cancelled:(void (^)())cancelled
cancelled:(void (^)(void))cancelled
error:(void (^)(ASDKAcquringSdkError *error))error;

@end
11 changes: 7 additions & 4 deletions ASDKUI/Payment/ASDKAttachCardViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
@interface ASDKAttachCardViewController () <UITextFieldDelegate>

@property (nonatomic, strong) void (^onSuccess)(ASDKResponseAttachCard *paymentInfo);
@property (nonatomic, strong) void (^onCancelled)();
@property (nonatomic, strong) void (^onCancelled)(void);
@property (nonatomic, strong) void (^onError)(ASDKAcquringSdkError *error);

@property (nonatomic, strong) ASDKFooterCell *footerCell;
Expand Down Expand Up @@ -74,7 +74,7 @@ - (instancetype)initWithCardCheckType:(NSString *)cardCheckType
customerKey:(NSString *)customerKey
additionalData:(NSDictionary *)data
success:(void (^)(ASDKResponseAttachCard *paymentInfo))success
cancelled:(void (^)())cancelled
cancelled:(void (^)(void))cancelled
error:(void (^)(ASDKAcquringSdkError *error))error
{
if (self = [super initWithStyle:UITableViewStylePlain])
Expand Down Expand Up @@ -845,7 +845,10 @@ - (void)manageError:(ASDKAcquringSdkError *)error
}
else
{
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:error.errorMessage message:error.errorDetails preferredStyle:UIAlertControllerStyleAlert];
NSString *alertTitle = error.errorMessage ? error.errorMessage : @"Ошибка";
NSString *alertDetails = error.errorDetails ? error.errorDetails : error.userInfo[kASDKStatus];

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:alertTitle message:alertDetails preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *cancelAction = [UIAlertAction
actionWithTitle:LOC(@"Common.Close")
Expand All @@ -865,7 +868,7 @@ - (void)manageSuccessWithInfo:(ASDKResponseAttachCard *)cardInfo
{
__weak typeof(self) weakSelf = self;

void (^paymentSuccessBlock)() = ^
void (^paymentSuccessBlock)(void) = ^
{
__strong typeof(weakSelf) strongSelf = weakSelf;

Expand Down
4 changes: 2 additions & 2 deletions ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ @interface ASDKPaymentFormStarter () <PKPaymentAuthorizationViewControllerDelega
@property (nonatomic, strong) NSString *paymentIdForApplePay;
//
@property (nonatomic, strong) void (^onSuccess)(ASDKPaymentInfo *paymentInfo);
@property (nonatomic, strong) void (^onCancelled)();
@property (nonatomic, strong) void (^onCancelled)(void);
@property (nonatomic, strong) void (^onError)(ASDKAcquringSdkError *error);

@property (nonatomic, strong) ASDKPaymentInfo *onCompleteSuccessPaymentInfo;
Expand Down Expand Up @@ -133,7 +133,7 @@ - (void)presentPaymentFormFromViewController:(UIViewController *)presentingViewC
receiptData:(NSDictionary *)receiptData
success:(void (^)(ASDKPaymentInfo *paymentInfo))onSuccess
cancelled:(void (^)(void))onCancelled
error:(void(^)(ASDKAcquringSdkError *error))onError
error:(void (^)(ASDKAcquringSdkError *error))onError
{
[self prepareDesign];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
additionalPaymentData:(NSDictionary *)data
receiptData:(NSDictionary *)receiptData
success:(void (^)(ASDKPaymentInfo *paymentInfo))success
cancelled:(void (^)())cancelled
cancelled:(void (^)(void))cancelled
error:(void (^)(ASDKAcquringSdkError *error))error;

@property (nonatomic, strong) NSString *paymentId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ @interface ASDKPaymentFormViewController () <UITextFieldDelegate, ASDKCardsListD
@property (nonatomic, strong) ASDKFooterCell *footerCell;

@property (nonatomic, strong) void (^onSuccess)(ASDKPaymentInfo *paymentInfo);
@property (nonatomic, strong) void (^onCancelled)();
@property (nonatomic, strong) void (^onCancelled)(void);
@property (nonatomic, strong) void (^onError)(ASDKAcquringSdkError *error);

@property (nonatomic, strong) ASDKCard *selectedCard;
Expand Down Expand Up @@ -128,8 +128,8 @@ - (instancetype)initWithAmount:(NSNumber *)amount
additionalPaymentData:(NSDictionary *)data
receiptData:(NSDictionary *)receiptData
success:(void (^)(ASDKPaymentInfo *paymentInfo))success
cancelled:(void (^)())cancelled
error:(void(^)(ASDKAcquringSdkError *error))error
cancelled:(void (^)(void))cancelled
error:(void (^)(ASDKAcquringSdkError *error))error
{
self = [super initWithStyle:UITableViewStylePlain];

Expand Down Expand Up @@ -1149,7 +1149,7 @@ - (void)manageSuccessWithPaymentInfo:(ASDKPaymentInfo *)paymentInfo
{
__weak typeof(self) weakSelf = self;

void (^paymentSuccessBlock)() = ^
void (^paymentSuccessBlock)(void) = ^
{
__strong typeof(weakSelf) strongSelf = weakSelf;

Expand Down Expand Up @@ -1190,7 +1190,10 @@ - (void)manageError:(ASDKAcquringSdkError *)error
}
else
{
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:error.errorMessage message:error.errorDetails preferredStyle:UIAlertControllerStyleAlert];
NSString *alertTitle = error.errorMessage ? error.errorMessage : @"Ошибка";
NSString *alertDetails = error.errorDetails ? error.errorDetails : error.userInfo[kASDKStatus];

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:alertTitle message:alertDetails preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *cancelAction = [UIAlertAction
actionWithTitle:LOC(@"Common.Close")
Expand Down
22 changes: 19 additions & 3 deletions SampleProject/ASDKSampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = "";
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = "TCS Bank";
TargetAttributes = {
831672861C6486A500533D85 = {
Expand Down Expand Up @@ -576,18 +576,26 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
Expand Down Expand Up @@ -622,18 +630,26 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
Loading

0 comments on commit 2b0b598

Please sign in to comment.