Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shopify_iossdk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
shopify_iossdk
Commits
49ddbd7e
Commit
49ddbd7e
authored
May 25, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addresses code review comments
- reduce poll iteration count - change request URL for testing - fix typo
parent
92a77a84
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
10 deletions
+8
-10
BUYRequestOperationTests.m
...e Buy SDK/Mobile Buy SDK Tests/BUYRequestOperationTests.m
+3
-3
project.pbxproj
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
+2
-4
BUYRequestOperation.h
...e Buy SDK/Mobile Buy SDK/Operations/BUYRequestOperation.h
+0
-1
BUYRequestOperation.m
...e Buy SDK/Mobile Buy SDK/Operations/BUYRequestOperation.m
+3
-2
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYRequestOperationTests.m
View file @
49ddbd7e
...
...
@@ -45,7 +45,7 @@
{
[
super
setUp
];
self
.
request
=
[
NSMutableURLRequest
requestWithURL
:[
NSURL
URLWithString
:
@"https://www.
google
.com"
]];
self
.
request
=
[
NSMutableURLRequest
requestWithURL
:[
NSURL
URLWithString
:
@"https://www.
shopify
.com"
]];
self
.
queue
=
[
NSOperationQueue
new
];
self
.
session
=
[
NSURLSession
sessionWithConfiguration
:[
NSURLSessionConfiguration
defaultSessionConfiguration
]
delegate
:
nil
delegateQueue
:
self
.
queue
];
}
...
...
@@ -220,7 +220,7 @@
__block
int
pollCount
=
0
;
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
@"Should stop polling at
10
iterations"
];
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
@"Should stop polling at
2
iterations"
];
operation
.
pollingHandler
=
^
BOOL
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
[
self
stubRequestsWithDelay
:
0
.
1
status
:
BUYStatusProcessing
];
...
...
@@ -235,7 +235,7 @@
if
(
response
.
statusCode
==
BUYStatusProcessing
)
{
pollCount
+=
1
;
if
(
pollCount
==
10
)
{
if
(
pollCount
==
2
)
{
[
self
stubRequestsWithDelay
:
0
.
1
status
:
BUYStatusComplete
];
}
return
YES
;
...
...
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
View file @
49ddbd7e
...
...
@@ -383,13 +383,13 @@
9A585C0C1CE6440B001F20F0
/* BUYOperation.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A585C051CE6440B001F20F0
/* BUYOperation.m */
;
};
9A585C0D1CE6440B001F20F0
/* BUYOperation.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A585C051CE6440B001F20F0
/* BUYOperation.m */
;
};
9A6B03791CDA5D4F0054C26E
/* BUYAccountCredentialsTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A6B03781CDA5D4F0054C26E
/* BUYAccountCredentialsTests.m */
;
};
9A7652C31CF487BD00220E4B
/* BUYOperationTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A7652C21CF487BD00220E4B
/* BUYOperationTests.m */
;
};
9ABBCCA11CF5C9D10075B0C5
/* BUYFakeSafariController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9ABBCCA01CF5C9D10075B0C5
/* BUYFakeSafariController.m */
;
};
B2653EC31CEF55CC0012D57D
/* BUYModelManager+ApplePay.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2653EC11CEF55CC0012D57D
/* BUYModelManager+ApplePay.h */
;
};
B2653EC41CEF55CC0012D57D
/* BUYModelManager+ApplePay.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2653EC11CEF55CC0012D57D
/* BUYModelManager+ApplePay.h */
;
};
B2653EC51CEF55CC0012D57D
/* BUYModelManager+ApplePay.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2653EC21CEF55CC0012D57D
/* BUYModelManager+ApplePay.m */
;
};
B2653EC61CEF55CC0012D57D
/* BUYModelManager+ApplePay.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2653EC21CEF55CC0012D57D
/* BUYModelManager+ApplePay.m */
;
};
B2653EC71CEF55CC0012D57D
/* BUYModelManager+ApplePay.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2653EC21CEF55CC0012D57D
/* BUYModelManager+ApplePay.m */
;
};
9A7652C31CF487BD00220E4B
/* BUYOperationTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A7652C21CF487BD00220E4B
/* BUYOperationTests.m */
;
};
BE47340F1B66C4EF00AA721A
/* BUYError.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE47340D1B66C4EF00AA721A
/* BUYError.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
BE4734101B66C4EF00AA721A
/* BUYError.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE47340E1B66C4EF00AA721A
/* BUYError.m */
;
};
BE5DC3631B71022D00B2BC1E
/* BUYMaskedCreditCard.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE5DC3611B71022D00B2BC1E
/* BUYMaskedCreditCard.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -671,15 +671,13 @@
9A585C111CE65811001F20F0
/* BUYRequestOperation.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYRequestOperation.h
;
sourceTree
=
"<group>"
;
};
9A585C121CE65811001F20F0
/* BUYRequestOperation.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYRequestOperation.m
;
sourceTree
=
"<group>"
;
};
9A6B03781CDA5D4F0054C26E
/* BUYAccountCredentialsTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYAccountCredentialsTests.m
;
sourceTree
=
"<group>"
;
};
9A7652C21CF487BD00220E4B
/* BUYOperationTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYOperationTests.m
;
sourceTree
=
"<group>"
;
};
9ABBCC9F1CF5C9D10075B0C5
/* BUYFakeSafariController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYFakeSafariController.h
;
sourceTree
=
"<group>"
;
};
9ABBCCA01CF5C9D10075B0C5
/* BUYFakeSafariController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYFakeSafariController.m
;
sourceTree
=
"<group>"
;
};
B2653EC11CEF55CC0012D57D
/* BUYModelManager+ApplePay.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"BUYModelManager+ApplePay.h"
;
sourceTree
=
"<group>"
;
};
B2653EC21CEF55CC0012D57D
/* BUYModelManager+ApplePay.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"BUYModelManager+ApplePay.m"
;
sourceTree
=
"<group>"
;
};
BE33B4ED1B15FF4D0067982B
/* BUYApplePayAuthorizationDelegate.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYApplePayAuthorizationDelegate.h
;
sourceTree
=
"<group>"
;
};
BE33B4EE1B15FF4D0067982B
/* BUYApplePayAuthorizationDelegate.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYApplePayAuthorizationDelegate.m
;
sourceTree
=
"<group>"
;
};
9A7652C21CF487BD00220E4B
/* BUYOperationTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYOperationTests.m
;
sourceTree
=
"<group>"
;
};
BE33B4ED1B15FF4D0067982B
/* BUYApplePayHelpers.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYApplePayHelpers.h
;
sourceTree
=
"<group>"
;
};
BE33B4EE1B15FF4D0067982B
/* BUYApplePayHelpers.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYApplePayHelpers.m
;
sourceTree
=
"<group>"
;
};
BE47340D1B66C4EF00AA721A
/* BUYError.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYError.h
;
sourceTree
=
"<group>"
;
};
BE47340E1B66C4EF00AA721A
/* BUYError.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYError.m
;
sourceTree
=
"<group>"
;
};
BE5DC3611B71022D00B2BC1E
/* BUYMaskedCreditCard.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYMaskedCreditCard.h
;
sourceTree
=
"<group>"
;
};
...
...
Mobile Buy SDK/Mobile Buy SDK/Operations/BUYRequestOperation.h
View file @
49ddbd7e
...
...
@@ -36,7 +36,6 @@ typedef BOOL (^BUYRequestOperationPollingHandler)(NSDictionary * _Nullable json,
@property
(
strong
,
nonatomic
,
readonly
,
nonnull
)
NSURLSession
*
session
;
@property
(
strong
,
nonatomic
,
readonly
,
nonnull
)
NSURLRequest
*
originalRequest
;
@property
(
strong
,
nonatomic
,
readonly
,
nonnull
)
BUYRequestOperationCompletion
completion
;
@property
(
strong
,
nonatomic
,
nullable
)
BUYRequestOperationPollingHandler
pollingHandler
;
...
...
Mobile Buy SDK/Mobile Buy SDK/Operations/BUYRequestOperation.m
View file @
49ddbd7e
...
...
@@ -32,13 +32,13 @@ NSString * const kShopifyError = @"shopify";
typedef
void
(
^
BUYRequestJSONCompletion
)(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
);
#pragma mark - NSURLResponse -
@interface
NSHTTPURLResponse
(
Conveniece
)
@interface
NSHTTPURLResponse
(
Convenie
n
ce
)
@property
(
assign
,
nonatomic
,
readonly
)
BOOL
successful
;
@end
@implementation
NSHTTPURLResponse
(
Conveniece
)
@implementation
NSHTTPURLResponse
(
Convenie
n
ce
)
-
(
BOOL
)
successful
{
return
((
NSUInteger
)(
self
.
statusCode
/
100
))
==
2
;
...
...
@@ -58,6 +58,7 @@ typedef void (^BUYRequestJSONCompletion)(NSDictionary *json, NSHTTPURLResponse *
@interface
BUYRequestOperation
()
@property
(
strong
,
atomic
)
NSURLSessionDataTask
*
runningTask
;
@property
(
strong
,
nonatomic
,
readonly
)
BUYRequestOperationCompletion
completion
;
@end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment