Skip to content

Commit

Permalink
ASDK-474 увеличение времени тайм аута при прохождении клиентов провер…
Browse files Browse the repository at this point in the history
…ки на 3DS
  • Loading branch information
Budnikov Vyacheslav committed Mar 25, 2019
1 parent 281d1b5 commit 89c90e1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ASDKCore/ASDKAcquiringApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
@property (nonatomic, strong) NSString *domainPath;
@property (nonatomic, strong) NSString *domainPath_v2;

@property (nonatomic, assign) NSInteger requestTimeoutInterval;

+ (ASDKAcquiringApi *)acquiringApiWithDomainPath:(NSString *)domainPath domainPath_v2:(NSString *)domainPath_v2;

- (void)initWithRequest:(ASDKInitRequest *)request
Expand Down
4 changes: 3 additions & 1 deletion ASDKCore/ASDKAcquiringApi.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ + (ASDKAcquiringApi *)acquiringApiWithDomainPath:(NSString *)domainPath domainPa

acquiringApi.domainPath = domainPath;
acquiringApi.domainPath_v2 = domainPath_v2;

acquiringApi.requestTimeoutInterval = 120;

return acquiringApi;
}

Expand All @@ -63,6 +64,7 @@ - (void)apiVersion:(APIVersion)apiVersion path:(NSString *)path parameters:(NSDi
NSURL *url = [NSURL URLWithString:urlString];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
request.timeoutInterval = self.requestTimeoutInterval;

if (apiVersion == APIVersion_v2)
{
Expand Down
1 change: 1 addition & 0 deletions ASDKCore/ASDKAcquiringSdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
- (NSString *)domainPath;
- (NSString *)domainPath_v2;
- (SecKeyRef)publicKeyRef;
- (NSInteger)apiRequestsTimeoutInterval;

+ (ASDKAcquiringSdk *)acquiringSdkWithTerminalKey:(NSString *)terminalKey
payType:(NSString *)payType
Expand Down
4 changes: 4 additions & 0 deletions ASDKCore/ASDKAcquiringSdk.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ - (void)setTestDomain:(BOOL)value
self.acquiringApi.domainPath_v2 = [self domainPath_v2];
}

- (NSInteger)defaultRequestTimeout
{
return self.acquiringApi.requestTimeoutInterval;
}

- (void)initWithAmount:(NSNumber *)amount
orderId:(NSString *)orderId
Expand Down
3 changes: 2 additions & 1 deletion ASDKUI/3DSController/ASDK3DSViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ - (void)viewDidLoad
self.navigationItem.leftBarButtonItem = [[ASDKBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel3DS)];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:self.threeDsData.ACSUrl];
request.timeoutInterval = _acquiringSdk.apiRequestsTimeoutInterval;
[request setHTTPMethod:@"POST"];
NSString *dataString = [self stringFromParameters:[self parameters]];

Expand All @@ -128,7 +129,7 @@ - (void)viewDidLoad
[request setHTTPBody:postData];

[[NSNotificationCenter defaultCenter] postNotificationName:ASDKNotificationShowLoader object:nil];

[self.webView loadRequest:request];
}

Expand Down

0 comments on commit 89c90e1

Please sign in to comment.