Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2025-04-14 16:57:38 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
df64b04612e9996c92136318430c38cd5b71c88f
df64b046
1 parent
2a4a1050
new version, minor fix
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
26 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Coupon.java
warply_android_sdk/build.gradle
View file @
df64b04
...
...
@@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.5.4p
8
'
PUBLISH_VERSION
=
'4.5.5.4p
9
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
View file @
df64b04
...
...
@@ -566,34 +566,36 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
String
tempCoupon
=
""
;
int
result
=
0
;
if
(
mCoupon
.
getCoupon
().
length
()
==
13
)
{
tempCoupon
=
mCoupon
.
getCoupon
();
if
(
mCoupon
!=
null
)
{
if
(!
TextUtils
.
isEmpty
(
mCoupon
.
getCoupon
())
&&
mCoupon
.
getCoupon
().
length
()
==
13
)
{
tempCoupon
=
mCoupon
.
getCoupon
();
try
{
for
(
int
i
=
mCoupon
.
getCoupon
().
length
()
-
1
;
i
>=
0
;
i
--)
{
result
=
result
+
Integer
.
parseInt
(
String
.
valueOf
((
mCoupon
.
getCoupon
()).
charAt
(
i
)))
*
(
1
+
(
2
*
(
i
%
2
)));
try
{
for
(
int
i
=
mCoupon
.
getCoupon
().
length
()
-
1
;
i
>=
0
;
i
--)
{
result
=
result
+
Integer
.
parseInt
(
String
.
valueOf
((
mCoupon
.
getCoupon
()).
charAt
(
i
)))
*
(
1
+
(
2
*
(
i
%
2
)));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
try
{
tempCoupon
=
mCoupon
.
getCoupon
();
for
(
int
i
=
0
;
i
<
(
12
-
mCoupon
.
getCoupon
().
length
());
i
++
)
{
tempCoupon
+=
"0"
;
}
else
if
(!
TextUtils
.
isEmpty
(
mCoupon
.
getCoupon
())
&&
mCoupon
.
getCoupon
().
length
()
!=
13
)
{
try
{
tempCoupon
=
mCoupon
.
getCoupon
();
for
(
int
i
=
0
;
i
<
(
12
-
mCoupon
.
getCoupon
().
length
());
i
++)
{
tempCoupon
+=
"0"
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
()
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
for
(
int
i
=
mCoupon
.
getCoupon
().
length
()
-
1
;
i
>=
0
;
i
--)
{
result
=
result
+
Integer
.
parseInt
(
String
.
valueOf
((
mCoupon
.
getCoupon
()).
charAt
(
i
)))
*
(
1
+
(
2
*
(
i
%
2
)));
}
try
{
for
(
int
i
=
mCoupon
.
getCoupon
().
length
()
-
1
;
i
>=
0
;
i
--)
{
result
=
result
+
Integer
.
parseInt
(
String
.
valueOf
((
mCoupon
.
getCoupon
()).
charAt
(
i
)))
*
(
1
+
(
2
*
(
i
%
2
)));
}
tempCoupon
=
tempCoupon
+
(
10
-
(
result
%
10
))
%
10
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
tempCoupon
=
tempCoupon
+
(
10
-
(
result
%
10
))
%
10
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Coupon.java
View file @
df64b04
...
...
@@ -160,7 +160,7 @@ public class Coupon implements Parcelable, Serializable {
if
(
json
!=
null
)
{
this
.
barcode
=
json
.
optString
(
BARCODE
);
this
.
category
=
json
.
optString
(
CATEGORY
);
this
.
coupon
=
json
.
optString
(
COUPON
);
this
.
coupon
=
json
.
optString
(
COUPON
,
""
);
this
.
created
=
json
.
optString
(
CREATED
);
this
.
description
=
json
.
optString
(
DESCRIPTION
);
this
.
discount
=
json
.
optString
(
DISCOUNT
);
...
...
@@ -214,7 +214,7 @@ public class Coupon implements Parcelable, Serializable {
e
.
printStackTrace
();
}
}
this
.
coupon
=
json
.
optString
(
COUPON
);
this
.
coupon
=
json
.
optString
(
COUPON
,
""
);
this
.
couponsetUuid
=
json
.
optString
(
COUPONSET_UUID
);
this
.
discount
=
json
.
optString
(
DISCOUNT
);
if
(
this
.
discount
.
contains
(
","
))
{
...
...
Please
register
or
login
to post a comment