Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2025-01-21 11:54:20 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e051863233c611181db7436826f273e3425fcd2a
e0518632
1 parent
06f8076f
add redeemed_merchant_details at CouponItemModel
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
e051863
...
...
@@ -2730,7 +2730,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
NSMutableDictionary
*
couponDictionary
=
[[
NSMutableDictionary
alloc
]
init
];
[
couponDictionary
setValue
:
@"user_coupons"
forKey
:
@"action"
];
[
couponDictionary
setValue
:@[
@"merchant"
]
forKey
:
@"details"
];
[
couponDictionary
setValue
:@[
@"merchant"
,
@"redemption"
]
forKey
:
@"details"
];
[
couponDictionary
setValue
:
language
forKey
:
@"language"
];
if
([
couponsetType
isEqual
:
@"supermarket"
])
{
[
couponDictionary
setValue
:@[
@"supermarket"
]
forKey
:
@"couponset_types"
];
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
e051863
...
...
@@ -850,6 +850,7 @@ public class swiftApi {
// Universal Coupons
public
var
merchant_details
:
MerchantModel
?
public
var
redeemed_merchant_details
:
RedeemedMerchantDetailsModel
?
public
init
(
dictionary
:
[
String
:
Any
])
{
...
...
@@ -911,6 +912,15 @@ public class swiftApi {
}
else
{
self
.
merchant_details
=
nil
}
if
let
redeemedMerchantDetails
=
dictionary
[
"redeemed_merchant_details"
]
as?
[
String
:
Any
]
{
let
tempRedeemedMerchantDetails
=
RedeemedMerchantDetailsModel
(
dictionary
:
redeemedMerchantDetails
)
self
.
redeemed_merchant_details
=
tempRedeemedMerchantDetails
}
else
{
self
.
redeemed_merchant_details
=
nil
}
// <==
...
...
@@ -9608,4 +9618,102 @@ public class swiftApi {
}
}
/*
{
"img_preview" = "<null>";
name = "<null>";
"redeemed_date" = "<null>";
uuid = "<null>";
}
*/
public
class
RedeemedMerchantDetailsModel
:
Codable
{
private
var
img_preview
:
String
?
private
var
name
:
String
?
private
var
uuid
:
String
?
private
var
redeemed_date
:
Date
?
private
var
redeemed_date_string
:
String
?
public
init
()
{
self
.
img_preview
=
""
self
.
name
=
""
self
.
uuid
=
""
self
.
redeemed_date
=
Date
()
self
.
redeemed_date_string
=
""
}
public
init
(
dictionary
:
[
String
:
Any
])
{
self
.
img_preview
=
dictionary
[
"img_preview"
]
as?
String
?
??
""
self
.
name
=
dictionary
[
"name"
]
as?
String
?
??
""
self
.
uuid
=
dictionary
[
"uuid"
]
as?
String
?
??
""
if
let
redeemedString
=
dictionary
[
"redeemed_date"
]
as?
String
{
// Example "redeemed_date" = "2024-07-02T10:50:03.04416";
let
dateFormatter4
=
DateFormatter
()
// dateFormatter4.dateFormat = "yyyy-MM-dd HH:mm:ss.SSSSS"
dateFormatter4
.
dateFormat
=
"yyyy-MM-dd'T'HH:mm:ss.SSSSS"
if
let
date
=
dateFormatter4
.
date
(
from
:
redeemedString
??
""
)
{
self
.
redeemed_date
=
date
dateFormatter4
.
dateFormat
=
"dd/MM/yyyy"
let
resultString
=
dateFormatter4
.
string
(
from
:
date
)
self
.
redeemed_date_string
=
resultString
}
else
{
self
.
redeemed_date
=
Date
()
self
.
redeemed_date_string
=
""
}
}
else
{
self
.
redeemed_date
=
Date
()
self
.
redeemed_date_string
=
""
}
}
public
var
_img_preview
:
String
{
get
{
// getter
return
self
.
img_preview
??
""
}
set
(
newValue
)
{
//setter
self
.
img_preview
=
newValue
}
}
public
var
_name
:
String
{
get
{
// getter
return
self
.
name
??
""
}
set
(
newValue
)
{
//setter
self
.
name
=
newValue
}
}
public
var
_uuid
:
String
{
get
{
// getter
return
self
.
uuid
??
""
}
set
(
newValue
)
{
//setter
self
.
uuid
=
newValue
}
}
public
var
_redeemed_date
:
Date
{
get
{
// getter
return
self
.
redeemed_date
??
Date
()
}
set
(
newValue
)
{
//setter
self
.
redeemed_date
=
newValue
}
}
public
var
_redeemed_date_string
:
String
{
get
{
// getter
return
self
.
redeemed_date_string
??
""
}
set
(
newValue
)
{
//setter
self
.
redeemed_date_string
=
newValue
}
}
}
}
...
...
Please
register
or
login
to post a comment