Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
Fengshui-Seller-iOS
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Monika Agarwal
Fengshui-Seller-iOS
Commits
2eadac7e
Commit
2eadac7e
authored
Aug 18, 2018
by
Anand.suthar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add magento refresh token
parent
cee4135a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
41 deletions
+38
-41
Bhagyashree.xcworkspace/xcuserdata/sunarcmac.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Bhagyashree.xcworkspace/xcuserdata/sunarcmac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+4
-36
Bhagyashree/Sunarc/Model/UserExt.swift
+14
-0
Bhagyashree/Sunarc/Other/HTTP/API.swift
+1
-0
Bhagyashree/Sunarc/Other/HTTP/HTTP.swift
+18
-4
Bhagyashree/Sunarc/View/Fengshui.storyboard
+1
-1
No files found.
Bhagyashree.xcworkspace/xcuserdata/sunarcmac.xcuserdatad/UserInterfaceState.xcuserstate
View file @
2eadac7e
No preview for this file type
Bhagyashree.xcworkspace/xcuserdata/sunarcmac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
2eadac7e
...
...
@@ -6,38 +6,6 @@
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
shouldBeEnabled =
"No"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"Bhagyashree/Sunarc/Other/HTTP/HTTP.swift"
timestampString =
"553782528.910941"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"64"
endingLineNumber =
"64"
landmarkName =
"connectWithRequestObject(api:parameters:method:contentType:indicator:success:failure:)"
landmarkType =
"7"
>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
shouldBeEnabled =
"No"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"Bhagyashree/Sunarc/Other/HTTP/HTTP.swift"
timestampString =
"553782528.911128"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"76"
endingLineNumber =
"76"
landmarkName =
"connectWithRequestObject(api:parameters:method:contentType:indicator:success:failure:)"
landmarkType =
"7"
>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
...
...
@@ -58,7 +26,7 @@
moduleName =
"Bhagyashree"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString =
"5562
68845.984683
"
timestampString =
"5562
73458.770355
"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"22"
...
...
@@ -73,7 +41,7 @@
moduleName =
"Bhagyashree"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString =
"5562
68845.988762
"
timestampString =
"5562
73458.774583
"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"22"
...
...
@@ -88,7 +56,7 @@
moduleName =
"Bhagyashree"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString =
"5562
68845.991715
"
timestampString =
"5562
73458.780182
"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"22"
...
...
@@ -103,7 +71,7 @@
moduleName =
"Bhagyashree"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString =
"5562
68845.995146
"
timestampString =
"5562
73458.785668
"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"22"
...
...
Bhagyashree/Sunarc/Model/UserExt.swift
View file @
2eadac7e
...
...
@@ -28,10 +28,24 @@ extension User {
}
}
}
class
func
regenerateToken
(
_
completion
:
@escaping
()
->
Void
)
{
let
parameters
:
[
String
:
Any
]
=
[
"emailId"
:
User
.
customerEmail
!
]
HTTP
()
.
connectionWithRequestObject
(
api
:
API
.
REGENERATE_TOKEN
,
parameters
:
parameters
,
method
:
.
post
,
indicator
:
true
,
success
:
{
(
response
)
in
if
let
magentoToken
=
response
as?
String
{
User
.
bearerToken
=
magentoToken
}
completion
()
})
{
(
error
)
in
completion
()
}
}
class
func
login
(
email
:
String
,
password
:
String
,
success
:
@escaping
()
->
Void
,
failure
:
@escaping
(
_
message
:
String
)
->
Void
)
{
let
parameters
:
[
String
:
Any
]
=
[
"username"
:
email
,
...
...
Bhagyashree/Sunarc/Other/HTTP/API.swift
View file @
2eadac7e
...
...
@@ -32,6 +32,7 @@ class API {
static
let
ENQUIRY_FEEDBACK
=
"/rest/V1/merchant/comment"
static
let
COMPLETED_SERVICE
=
"/rest/V1/service/completed"
static
let
CORPORATE_CULTURE
=
"/rest/V1/bannerInfo"
static
let
REGENERATE_TOKEN
=
"/rest/V1/customer/regenerate"
// Appointment
...
...
Bhagyashree/Sunarc/Other/HTTP/HTTP.swift
View file @
2eadac7e
...
...
@@ -102,7 +102,15 @@ class HTTP: NSObject {
HTTP
()
.
connectionWithRequestObject
(
api
:
api
,
parameters
:
parameters
,
method
:
method
,
indicator
:
indicator
,
success
:
success
,
failure
:
failure
)
}
}
else
{
failure
(
"Authorization failed"
)
User
.
regenerateToken
{
// generate magento token
if
contentType
==
"application/x-www-form-urlencoded"
{
HTTP
()
.
connectionWithRequestObjectFormUrl
(
api
:
api
,
parameters
:
parameters
,
method
:
method
,
indicator
:
indicator
,
success
:
success
,
failure
:
failure
)
}
else
{
HTTP
()
.
connectionWithRequestObject
(
api
:
api
,
parameters
:
parameters
,
method
:
method
,
indicator
:
indicator
,
success
:
success
,
failure
:
failure
)
}
}
}
}
else
{
if
let
result
=
response
.
result
.
value
{
...
...
@@ -173,8 +181,6 @@ class HTTP: NSObject {
if
let
tokenValue
=
response
.
response
?
.
allHeaderFields
[
"token"
]
as?
String
{
let
usernamePasswordMd5
:
String
=
(
API_USER_NAME
+
":"
+
API_KEY
)
.
md5
;
print
(
usernamePasswordMd5
)
let
authkey
=
(
usernamePasswordMd5
+
":"
+
tokenValue
)
.
md5
;
defaults
.
set
(
authkey
,
forKey
:
"authKey"
)
defaults
.
synchronize
()
...
...
@@ -185,7 +191,15 @@ class HTTP: NSObject {
HTTP
()
.
connectionWithoutRequestObject
(
api
:
api
,
parameters
:
parameters
,
method
:
method
,
indicator
:
indicator
,
success
:
success
,
failure
:
failure
)
}
}
else
{
failure
(
"Authorization failed"
)
User
.
regenerateToken
{
// generate magento token
if
contentType
==
"application/x-www-form-urlencoded"
{
HTTP
()
.
connectionWithoutRequestObjectFormUrl
(
api
:
api
,
parameters
:
parameters
,
method
:
method
,
indicator
:
indicator
,
success
:
success
,
failure
:
failure
)
}
else
{
HTTP
()
.
connectionWithoutRequestObject
(
api
:
api
,
parameters
:
parameters
,
method
:
method
,
indicator
:
indicator
,
success
:
success
,
failure
:
failure
)
}
}
}
}
else
{
if
let
result
=
response
.
result
.
value
{
...
...
Bhagyashree/Sunarc/View/Fengshui.storyboard
View file @
2eadac7e
...
...
@@ -526,7 +526,7 @@
</constraints>
<nil
key=
"textColor"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<textInputTraits
key=
"textInputTraits"
returnKeyType=
"next"
/>
<textInputTraits
key=
"textInputTraits"
keyboardType=
"emailAddress"
returnKeyType=
"next"
/>
<connections>
<outlet
property=
"delegate"
destination=
"Bhz-MZ-b15"
id=
"afw-7F-lJM"
/>
</connections>
...
...
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