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
2023-07-25 18:28:04 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
109ecee4a7b921e995c0150edad70cf089256bb3
109ecee4
1 parent
57215601
feedback fixes
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
200 additions
and
46 deletions
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyMarketAnalysisActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/ApiService.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
View file @
109ecee
...
...
@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public
void
onWarplyReady
()
{
if
(!
WarplyDBHelper
.
getInstance
(
SplashActivity
.
this
).
isTableNotEmpty
(
"auth"
))
{
WarplyManager
.
getCosmoteUser
(
new
WarplyCosmoteUserRequest
()
.
setGuid
(
"
6005892749
"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
.
setGuid
(
"
7000070282
"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
mLoginReceiver
);
}
else
{
startNextActivity
();
...
...
warply_android_sdk/build.gradle
View file @
109ecee
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4.6rc7
0
'
PUBLISH_VERSION
=
'4.5.4.6rc7
1
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyMarketAnalysisActivity.java
View file @
109ecee
...
...
@@ -280,9 +280,9 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl
@Override
public
void
onSuccess
(
SharingList
result
)
{
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
if
(
WarplyManagerHelper
.
getCouponsets
()
!=
null
&&
WarplyManagerHelper
.
getCouponset
s
().
size
()
>
0
)
{
if
(
WarplyManagerHelper
.
getCouponsets
Deals
()
!=
null
&&
WarplyManagerHelper
.
getCouponsetsDeal
s
().
size
()
>
0
)
{
for
(
SharingCoupon
shCoupon
:
result
)
{
for
(
Couponset
cpnset
:
WarplyManagerHelper
.
getCouponsets
())
{
for
(
Couponset
cpnset
:
WarplyManagerHelper
.
getCouponsets
Deals
())
{
if
(
shCoupon
.
getCouponsetUuid
().
equals
(
cpnset
.
getUuid
()))
{
SharingCoupon
newShCoupon
=
new
SharingCoupon
();
newShCoupon
=
shCoupon
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
View file @
109ecee
...
...
@@ -55,6 +55,7 @@ import ly.warp.sdk.io.models.ActiveDFYCouponEventModel;
import
ly.warp.sdk.io.models.ActiveDFYCouponModel
;
import
ly.warp.sdk.io.models.Coupon
;
import
ly.warp.sdk.io.models.CouponList
;
import
ly.warp.sdk.io.models.Couponset
;
import
ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel
;
import
ly.warp.sdk.io.models.UnifiedCoupon
;
import
ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel
;
...
...
@@ -530,15 +531,29 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
// Third Expandable Banner
if
(
WarplyManagerHelper
.
getMarketCoupons
().
size
()
>
0
)
{
countValue
=
0.0f
;
for
(
UnifiedCoupon
unicou
:
WarplyManagerHelper
.
getMarketCoupons
())
{
if
(
unicou
.
getCoupons
()
!=
null
&&
unicou
.
getCoupons
().
size
()
>
0
)
{
for
(
Coupon
inncou
:
unicou
.
getCoupons
())
{
if
(
inncou
.
getStatus
()
==
0
)
{
countValue
+=
Float
.
valueOf
(
inncou
.
getDiscount
());
// for (UnifiedCoupon unicou : WarplyManagerHelper.getMarketCoupons()) {
// if (unicou.getCoupons() != null && unicou.getCoupons().size() > 0) {
// for (Coupon inncou : unicou.getCoupons()) {
// if (inncou.getStatus() == 0) {
// countValue += Float.valueOf(inncou.getDiscount());
// }
// }
// }
// }
if
(
WarplyManagerHelper
.
getCouponRedeemedList
().
size
()
>
0
)
{
if
(
WarplyManagerHelper
.
getCouponsetsDeals
().
size
()
>
0
)
{
for
(
Couponset
couset
:
WarplyManagerHelper
.
getCouponsetsDeals
())
{
for
(
Coupon
cou
:
WarplyManagerHelper
.
getCouponRedeemedList
())
{
if
(
cou
.
getCouponsetUuid
().
equals
(
couset
.
getUuid
()))
{
countValue
+=
Float
.
valueOf
(
cou
.
getDiscount
());
break
;
}
}
}
}
}
mFavValue
+=
countValue
;
String
badgeValue
=
String
.
format
(
"%.02f"
,
countValue
);
mTvMarketValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
));
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/ApiService.java
View file @
109ecee
...
...
@@ -43,6 +43,18 @@ public interface ApiService {
@Headers
(
"Content-Type: application/json"
)
@POST
(
"/oauth/{appUuid}/context"
)
Call
<
ResponseBody
>
getCouponsets
(
@Path
(
"appUuid"
)
String
appUuid
,
@Body
RequestBody
request
,
@Header
(
WarpConstants
.
HEADER_DATE
)
String
timeStamp
,
@Header
(
WarpConstants
.
HEADER_LOYALTY_BUNDLE_ID
)
String
bundleId
,
@Header
(
WarpConstants
.
HEADER_UNIQUE_DEVICE_ID
)
String
deviceId
,
@Header
(
WarpConstants
.
HEADER_CHANNEL
)
String
channel
,
@Header
(
WarpConstants
.
HEADER_WEB_ID
)
String
webId
,
@Header
(
WarpConstants
.
HEADER_SIGNATURE
)
String
signature
,
@Header
(
WarpConstants
.
HEADER_AUTHORIZATION
)
String
bearer
);
@Headers
(
"Content-Type: application/json"
)
@POST
(
"/oauth/{appUuid}/context"
)
Call
<
ResponseBody
>
getUserCoupons
(
@Path
(
"appUuid"
)
String
appUuid
,
@Body
RequestBody
request
,
@Header
(
WarpConstants
.
HEADER_DATE
)
String
timeStamp
,
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
109ecee
...
...
@@ -111,8 +111,10 @@ public class WarplyManagerHelper {
private
static
Consumer
mConsumerInternal
=
new
Consumer
();
private
static
HashMap
<
String
,
CampaignList
>
mUniqueCampaignList
=
new
HashMap
<
String
,
CampaignList
>();
private
static
CouponList
mCouponList
=
new
CouponList
();
private
static
CouponList
mCouponRedeemedList
=
new
CouponList
();
private
static
CouponList
mCouponListExpired
=
new
CouponList
();
private
static
CouponsetsList
mCouponsetsList
=
new
CouponsetsList
();
private
static
CouponsetsList
mCouponsetsDealsList
=
new
CouponsetsList
();
private
static
CustomerStateModel
mCustomerStateModel
=
new
CustomerStateModel
();
private
static
ArrayList
<
Campaign
>
mCampaignList
=
new
ArrayList
<
Campaign
>();
private
static
ArrayList
<
Campaign
>
mCampaignListAll
=
new
ArrayList
<
Campaign
>();
...
...
@@ -1231,6 +1233,15 @@ public class WarplyManagerHelper {
});
}
public
static
void
setCouponRedeemedList
(
CouponList
couponRedeemedList
)
{
mCouponRedeemedList
.
clear
();
mCouponRedeemedList
.
addAll
(
couponRedeemedList
);
}
public
static
CouponList
getCouponRedeemedList
()
{
return
mCouponRedeemedList
;
}
public
static
LoyaltyBadgeModel
getLoyaltyBadge
()
{
return
mLoyaltyBadge
;
}
...
...
@@ -1243,6 +1254,14 @@ public class WarplyManagerHelper {
mCouponsetsList
=
couponsets
;
}
public
static
void
setCouponsetsDeals
(
CouponsetsList
couponsetsDeals
)
{
mCouponsetsDealsList
=
couponsetsDeals
;
}
public
static
CouponsetsList
getCouponsetsDeals
()
{
return
mCouponsetsDealsList
;
}
public
static
void
setMerchantList
(
MerchantList
merchantList
)
{
mMerchantList
.
clear
();
mMerchantList
=
merchantList
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
109ecee
...
...
@@ -1898,66 +1898,124 @@ public class WarplyManager {
WarpUtils
.
log
(
"[WARP Trace] WARPLY User Coupons Request is active"
);
WarpUtils
.
log
(
"**************************************************"
);
ApiService
service
=
ApiClient
.
getRetrofitInstance
().
create
(
ApiService
.
class
);
get
UnifiedCouponsRetro
(
servic
e
,
new
Callback
<
ResponseBody
>()
{
get
CouponsetsRetro
(
service
,
tru
e
,
new
Callback
<
ResponseBody
>()
{
@Override
public
void
onResponse
(
@NonNull
Call
<
ResponseBody
>
call
,
@NonNull
Response
<
ResponseBody
>
responseCoupon
s
)
{
if
(
responseCoupons
.
code
()
==
200
&&
responseCoupon
s
.
body
()
!=
null
)
{
JSONObject
jobjCouponsResponse
=
null
;
public
void
onResponse
(
Call
<
ResponseBody
>
call
,
Response
<
ResponseBody
>
responseCouponset
s
)
{
if
(
responseCoupons
ets
.
code
()
==
200
&&
responseCouponset
s
.
body
()
!=
null
)
{
JSONObject
jobjCoupons
ets
Response
=
null
;
try
{
jobjCoupons
Response
=
new
JSONObject
(
responseCoupon
s
.
body
().
string
());
jobjCoupons
etsResponse
=
new
JSONObject
(
responseCouponset
s
.
body
().
string
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(
jobjCouponsResponse
!=
null
&&
jobjCouponsResponse
.
has
(
"status"
)
&&
jobjCouponsResponse
.
optInt
(
"status"
,
2
)
==
1
)
{
ArrayList
<
UnifiedCoupon
>
couponList
=
new
ArrayList
<
UnifiedCoupon
>();
ArrayList
<
UnifiedCoupon
>
allCouponList
=
new
ArrayList
<
UnifiedCoupon
>();
if
(
jobjCouponsetsResponse
!=
null
&&
jobjCouponsetsResponse
.
has
(
"status"
)
&&
jobjCouponsetsResponse
.
optString
(
"status"
,
"2"
).
equals
(
"1"
))
{
LoyaltySDKDynatraceEventModel
dynatraceEvent
=
new
LoyaltySDKDynatraceEventModel
();
dynatraceEvent
.
setEventName
(
"custom_success_
unified_coupons
_loyalty"
);
dynatraceEvent
.
setEventName
(
"custom_success_
couponsets_sm
_loyalty"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
dynatraceEvent
));
JSONObject
finalJobjCouponsResponse
=
jobjCouponsResponse
;
final
ExecutorService
executor
=
Executors
.
newFixedThreadPool
(
1
);
executor
.
submit
(()
->
{
JSONObject
jCouponsBody
=
null
;
try
{
jCouponsBody
=
finalJobjCouponsResponse
.
optJSONObject
(
"result"
);
if
(
jCouponsBody
!=
null
&&
jCouponsBody
.
length
()
>
0
)
{
JSONArray
jCouponsInnerBody
=
null
;
jCouponsInnerBody
=
jCouponsBody
.
optJSONArray
(
"coupons"
);
if
(
jCouponsInnerBody
!=
null
&&
jCouponsInnerBody
.
length
()
>
0
)
{
for
(
int
i
=
0
;
i
<
jCouponsInnerBody
.
length
();
i
++)
{
UnifiedCoupon
tempUni
=
new
UnifiedCoupon
(
jCouponsInnerBody
.
optJSONObject
(
i
));
allCouponList
.
add
(
tempUni
);
if
(
tempUni
.
getStatus
().
trim
().
equals
(
"active"
))
couponList
.
add
(
tempUni
);
}
WarplyManagerHelper
.
setMarketCoupons
(
allCouponList
);
JSONObject
finalJobjCouponsetsResponse
=
jobjCouponsetsResponse
;
// COUPONSETS START //
JSONArray
jCouponsetsBody
=
null
;
try
{
jCouponsetsBody
=
finalJobjCouponsetsResponse
.
optJSONArray
(
"result"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
// COUPONSETS END //
if
(
jCouponsetsBody
!=
null
)
{
CouponsetsList
mCouponsetList
=
new
CouponsetsList
();
for
(
int
i
=
0
;
i
<
jCouponsetsBody
.
length
();
++
i
)
{
Couponset
tempCouponset
=
new
Couponset
(
jCouponsetsBody
.
optJSONObject
(
i
));
mCouponsetList
.
add
(
tempCouponset
);
}
WarplyManagerHelper
.
setCouponsetsDeals
(
mCouponsetList
);
getUnifiedCouponsRetro
(
service
,
new
Callback
<
ResponseBody
>()
{
@Override
public
void
onResponse
(
@NonNull
Call
<
ResponseBody
>
call
,
@NonNull
Response
<
ResponseBody
>
responseCoupons
)
{
if
(
responseCoupons
.
code
()
==
200
&&
responseCoupons
.
body
()
!=
null
)
{
JSONObject
jobjCouponsResponse
=
null
;
try
{
jobjCouponsResponse
=
new
JSONObject
(
responseCoupons
.
body
().
string
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(
jobjCouponsResponse
!=
null
&&
jobjCouponsResponse
.
has
(
"status"
)
&&
jobjCouponsResponse
.
optInt
(
"status"
,
2
)
==
1
)
{
ArrayList
<
UnifiedCoupon
>
couponList
=
new
ArrayList
<
UnifiedCoupon
>();
ArrayList
<
UnifiedCoupon
>
allCouponList
=
new
ArrayList
<
UnifiedCoupon
>();
LoyaltySDKDynatraceEventModel
dynatraceEvent
=
new
LoyaltySDKDynatraceEventModel
();
dynatraceEvent
.
setEventName
(
"custom_success_unified_coupons_loyalty"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
dynatraceEvent
));
JSONObject
finalJobjCouponsResponse
=
jobjCouponsResponse
;
final
ExecutorService
executor
=
Executors
.
newFixedThreadPool
(
1
);
executor
.
submit
(()
->
{
JSONObject
jCouponsBody
=
null
;
try
{
jCouponsBody
=
finalJobjCouponsResponse
.
optJSONObject
(
"result"
);
if
(
jCouponsBody
!=
null
&&
jCouponsBody
.
length
()
>
0
)
{
JSONArray
jCouponsInnerBody
=
null
;
jCouponsInnerBody
=
jCouponsBody
.
optJSONArray
(
"coupons"
);
if
(
jCouponsInnerBody
!=
null
&&
jCouponsInnerBody
.
length
()
>
0
)
{
for
(
int
i
=
0
;
i
<
jCouponsInnerBody
.
length
();
i
++)
{
UnifiedCoupon
tempUni
=
new
UnifiedCoupon
(
jCouponsInnerBody
.
optJSONObject
(
i
));
allCouponList
.
add
(
tempUni
);
if
(
tempUni
.
getStatus
().
trim
().
equals
(
"active"
))
couponList
.
add
(
tempUni
);
}
WarplyManagerHelper
.
setMarketCoupons
(
allCouponList
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
new
Handler
(
Looper
.
getMainLooper
()).
post
(()
->
receiver
.
onSuccess
(
couponList
));
executor
.
shutdownNow
();
});
}
else
{
LoyaltySDKDynatraceEventModel
dynatraceEvent
=
new
LoyaltySDKDynatraceEventModel
();
dynatraceEvent
.
setEventName
(
"custom_error_unified_coupons_loyalty"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
dynatraceEvent
));
receiver
.
onFailure
(
2
);
}
}
else
{
LoyaltySDKDynatraceEventModel
dynatraceEvent
=
new
LoyaltySDKDynatraceEventModel
();
dynatraceEvent
.
setEventName
(
"custom_error_unified_coupons_loyalty"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
dynatraceEvent
));
receiver
.
onFailure
(
responseCoupons
.
code
());
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
new
Handler
(
Looper
.
getMainLooper
()).
post
(()
->
receiver
.
onSuccess
(
couponList
));
executor
.
shutdownNow
();
});
@Override
public
void
onFailure
(
@NonNull
Call
<
ResponseBody
>
call
,
@NonNull
Throwable
t
)
{
LoyaltySDKDynatraceEventModel
dynatraceEvent
=
new
LoyaltySDKDynatraceEventModel
();
dynatraceEvent
.
setEventName
(
"custom_error_user_coupons_loyalty"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
dynatraceEvent
));
receiver
.
onFailure
(
2
);
}
});
}
}
else
{
LoyaltySDKDynatraceEventModel
dynatraceEvent
=
new
LoyaltySDKDynatraceEventModel
();
dynatraceEvent
.
setEventName
(
"custom_error_
unified_coupons
_loyalty"
);
dynatraceEvent
.
setEventName
(
"custom_error_
couponsets_sm
_loyalty"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
dynatraceEvent
));
receiver
.
onFailure
(
2
);
}
}
else
{
LoyaltySDKDynatraceEventModel
dynatraceEvent
=
new
LoyaltySDKDynatraceEventModel
();
dynatraceEvent
.
setEventName
(
"custom_error_
unified_coupons
_loyalty"
);
dynatraceEvent
.
setEventName
(
"custom_error_
couponsets_sm
_loyalty"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
dynatraceEvent
));
receiver
.
onFailure
(
responseCoupons
.
code
());
receiver
.
onFailure
(
responseCoupons
ets
.
code
());
}
}
@Override
public
void
onFailure
(
@NonNull
Call
<
ResponseBody
>
call
,
@NonNull
Throwable
t
)
{
public
void
onFailure
(
Call
<
ResponseBody
>
call
,
Throwable
t
)
{
LoyaltySDKDynatraceEventModel
dynatraceEvent
=
new
LoyaltySDKDynatraceEventModel
();
dynatraceEvent
.
setEventName
(
"custom_error_
user_coupons
_loyalty"
);
dynatraceEvent
.
setEventName
(
"custom_error_
couponsets_sm
_loyalty"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
dynatraceEvent
));
receiver
.
onFailure
(
2
);
}
...
...
@@ -2305,6 +2363,7 @@ public class WarplyManager {
if
(
jCouponsetsBody
!=
null
&&
jCouponsBody
!=
null
)
{
CouponList
mCouponList
=
new
CouponList
();
CouponList
mCouponRedeemedList
=
new
CouponList
();
CouponsetsList
mCouponsetList
=
new
CouponsetsList
();
for
(
int
i
=
0
;
i
<
jCouponsetsBody
.
length
();
++
i
)
{
Couponset
tempCouponset
=
new
Couponset
(
jCouponsetsBody
.
optJSONObject
(
i
));
...
...
@@ -2323,8 +2382,16 @@ public class WarplyManager {
}
}
}
for
(
int
j
=
0
;
j
<
jCouponsBody
.
length
();
++
j
)
{
Coupon
tempCoupon
=
new
Coupon
(
jCouponsBody
.
optJSONObject
(
j
));
if
(
tempCoupon
.
getStatus
()
==
0
)
{
mCouponRedeemedList
.
add
(
tempCoupon
);
}
}
WarplyManagerHelper
.
setCouponsets
(
mCouponsetList
);
WarplyManagerHelper
.
setCouponList
(
mCouponList
);
WarplyManagerHelper
.
setCouponRedeemedList
(
mCouponRedeemedList
);
CouponList
mActiveCouponList
=
new
CouponList
();
for
(
Coupon
coupon
:
mCouponList
)
{
...
...
@@ -2469,6 +2536,47 @@ public class WarplyManager {
});
}
private
static
void
getCouponsetsRetro
(
ApiService
service
,
boolean
isFiltered
,
Callback
<
ResponseBody
>
callback
)
{
String
timeStamp
=
DateFormat
.
format
(
"yyyy-MM-dd hh:mm:ss"
,
System
.
currentTimeMillis
()).
toString
();
String
apiKey
=
WarpUtils
.
getApiKey
(
Warply
.
getWarplyContext
());
String
webId
=
WarpUtils
.
getWebId
(
Warply
.
getWarplyContext
());
Map
<
String
,
Object
>
jsonParamsCouponsets
=
new
ArrayMap
<>();
Map
<
String
,
Object
>
jsonParams
=
new
ArrayMap
<>();
jsonParams
.
put
(
"action"
,
"retrieve_multilingual"
);
jsonParams
.
put
(
"active"
,
true
);
jsonParams
.
put
(
"visible"
,
true
);
jsonParams
.
put
(
"language"
,
WarplyProperty
.
getLanguage
(
Warply
.
getWarplyContext
()));
jsonParams
.
put
(
"couponset_types"
,
new
JSONArray
().
put
(
"supermarket"
));
jsonParamsCouponsets
.
put
(
"coupon"
,
jsonParams
);
RequestBody
couponsetsRequest
=
RequestBody
.
create
(
MediaType
.
get
(
"application/json; charset=utf-8"
),
(
new
JSONObject
(
jsonParamsCouponsets
)).
toString
());
Call
<
ResponseBody
>
couponsetsCall
=
service
.
getCouponsets
(
WarplyProperty
.
getAppUuid
(
Warply
.
getWarplyContext
()),
couponsetsRequest
,
timeStamp
,
"android:"
+
Warply
.
getWarplyContext
().
getPackageName
(),
new
WarplyDeviceInfoCollector
(
Warply
.
getWarplyContext
()).
getUniqueDeviceId
(),
"mobile"
,
webId
,
WarpUtils
.
produceSignature
(
apiKey
+
timeStamp
),
"Bearer "
+
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
getAuthValue
(
"access_token"
)
);
couponsetsCall
.
enqueue
(
new
Callback
<
ResponseBody
>()
{
@Override
public
void
onResponse
(
@NonNull
Call
<
ResponseBody
>
call
,
@NonNull
Response
<
ResponseBody
>
response
)
{
callback
.
onResponse
(
call
,
response
);
}
@Override
public
void
onFailure
(
@NonNull
Call
<
ResponseBody
>
call
,
@NonNull
Throwable
t
)
{
callback
.
onFailure
(
call
,
t
);
}
});
}
private
static
void
getUnifiedCouponsRetro
(
ApiService
service
,
Callback
<
ResponseBody
>
callback
)
{
String
timeStamp
=
DateFormat
.
format
(
"yyyy-MM-dd hh:mm:ss"
,
System
.
currentTimeMillis
()).
toString
();
String
apiKey
=
WarpUtils
.
getApiKey
(
Warply
.
getWarplyContext
());
...
...
Please
register
or
login
to post a comment