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
2022-06-27 18:04:56 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5875dd7c31023c4fe770b7d667bf78d22b196490
5875dd7c
1 parent
b8bb545d
update setCouponList
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
5875dd7
...
...
@@ -1748,14 +1748,15 @@ public class swiftApi {
public
func
setCouponList
(
_
coupons
:
Array
<
CouponItemModel
>
)
{
GlobalVariables
.
couponList
=
coupons
let
filteredCoupons
=
coupons
.
filter
{
CharacterSet
.
decimalDigits
.
isSuperset
(
of
:
CharacterSet
(
charactersIn
:
$0
.
discount
??
""
))
}
GlobalVariables
.
couponList
=
filteredCoupons
let
loyaltyBadge
=
LoyaltyBadgeModel
()
let
totalCouponDiscount
=
c
oupons
.
reduce
(
0
)
{
$0
+
(
Float
(
$1
.
discount
??
""
)
??
0
)
}
let
totalCouponDiscount
=
filteredC
oupons
.
reduce
(
0
)
{
$0
+
(
Float
(
$1
.
discount
??
""
)
??
0
)
}
loyaltyBadge
.
_value
=
totalCouponDiscount
loyaltyBadge
.
_couponCount
=
c
oupons
.
count
loyaltyBadge
.
_couponCount
=
filteredC
oupons
.
count
GlobalVariables
.
loyaltyBadge
=
loyaltyBadge
}
...
...
Please
register
or
login
to post a comment