Panagiotis Triantafyllou

session changes, small fixes

...@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { ...@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
36 public void onWarplyReady() { 36 public void onWarplyReady() {
37 if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { 37 if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
38 WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() 38 WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
39 - .setGuid("6005892749"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910 39 + .setGuid("6010490808"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
40 mLoginReceiver); 40 mLoginReceiver);
41 } else { 41 } else {
42 startNextActivity(); 42 startNextActivity();
......
...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
2 2
3 ext { 3 ext {
4 PUBLISH_GROUP_ID = 'ly.warp' 4 PUBLISH_GROUP_ID = 'ly.warp'
5 - PUBLISH_VERSION = '4.5.4.6rc36' 5 + PUBLISH_VERSION = '4.5.4.6rc37'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -298,6 +298,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis ...@@ -298,6 +298,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
298 SharingCoupon newShCoupon = new SharingCoupon(); 298 SharingCoupon newShCoupon = new SharingCoupon();
299 newShCoupon = shCoupon; 299 newShCoupon = shCoupon;
300 newShCoupon.setName(cpnset.getName()); 300 newShCoupon.setName(cpnset.getName());
301 + newShCoupon.setFinal_price(cpnset.getFinal_price());
301 mSharedCoupons.add(newShCoupon); 302 mSharedCoupons.add(newShCoupon);
302 break; 303 break;
303 } 304 }
......
1 +/*
2 + * Copyright 2010-2013 Warply Ltd. All rights reserved.
3 + *
4 + * Redistribution and use in source and binary forms, without modification, are
5 + * permitted provided that the following conditions are met:
6 + *
7 + * 1. Redistributions of source code must retain the above copyright notice,
8 + * this list of conditions and the following disclaimer.
9 + *
10 + * 2. Redistributions in binary form must reproduce the above copyright notice,
11 + * this list of conditions and the following disclaimer in the documentation
12 + * and/or other materials provided with the distribution.
13 + *
14 + * THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + * EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20 + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23 + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +package ly.warp.sdk.io.models;
27 +
28 +/**
29 + * Created by Panagiotis Triantafyllou on 13-Jan-23.
30 + */
31 +
32 +public class LoyaltySDKSessionExpiredEventModel {
33 + private boolean sessionExpired;
34 +
35 + public LoyaltySDKSessionExpiredEventModel() {
36 + this.sessionExpired = true;
37 + }
38 +
39 + public boolean isLoyaltySessionExpired() {
40 + return sessionExpired;
41 + }
42 +
43 + public void setLoyaltySessionExpired(boolean sessionExpired) {
44 + this.sessionExpired = sessionExpired;
45 + }
46 +}
...@@ -53,6 +53,7 @@ public class SharingCoupon implements Parcelable, Serializable { ...@@ -53,6 +53,7 @@ public class SharingCoupon implements Parcelable, Serializable {
53 private static final String COUPONSET_UUID = "couponset_uuid"; 53 private static final String COUPONSET_UUID = "couponset_uuid";
54 private static final String NAME = "name"; 54 private static final String NAME = "name";
55 private static final String MERCHANT_UUID = "merchant_uuid"; 55 private static final String MERCHANT_UUID = "merchant_uuid";
56 + private static final String FINAL_PRICE = "final_price";
56 57
57 /* Member variables of the Campaign object */ 58 /* Member variables of the Campaign object */
58 59
...@@ -63,6 +64,7 @@ public class SharingCoupon implements Parcelable, Serializable { ...@@ -63,6 +64,7 @@ public class SharingCoupon implements Parcelable, Serializable {
63 private String couponsetUuid = ""; 64 private String couponsetUuid = "";
64 private String name = ""; 65 private String name = "";
65 private String merchantUuid = ""; 66 private String merchantUuid = "";
67 + private double final_price = 0.0d;
66 68
67 /** 69 /**
68 * Basic constructor used to create an object from a String, representing a 70 * Basic constructor used to create an object from a String, representing a
...@@ -82,6 +84,7 @@ public class SharingCoupon implements Parcelable, Serializable { ...@@ -82,6 +84,7 @@ public class SharingCoupon implements Parcelable, Serializable {
82 this.date = ""; 84 this.date = "";
83 this.couponsetUuid = ""; 85 this.couponsetUuid = "";
84 this.name = ""; 86 this.name = "";
87 + this.final_price = 0.0d;
85 } 88 }
86 89
87 /** 90 /**
...@@ -98,6 +101,7 @@ public class SharingCoupon implements Parcelable, Serializable { ...@@ -98,6 +101,7 @@ public class SharingCoupon implements Parcelable, Serializable {
98 this.transactionMetadata = json.optString(TRANSACTION_METADATA); 101 this.transactionMetadata = json.optString(TRANSACTION_METADATA);
99 this.name = json.optString(NAME); 102 this.name = json.optString(NAME);
100 this.merchantUuid = json.optString(MERCHANT_UUID); 103 this.merchantUuid = json.optString(MERCHANT_UUID);
104 + this.final_price = json.optDouble(FINAL_PRICE);
101 } 105 }
102 } 106 }
103 107
...@@ -109,6 +113,7 @@ public class SharingCoupon implements Parcelable, Serializable { ...@@ -109,6 +113,7 @@ public class SharingCoupon implements Parcelable, Serializable {
109 this.transactionMetadata = source.readString(); 113 this.transactionMetadata = source.readString();
110 this.name = source.readString(); 114 this.name = source.readString();
111 this.merchantUuid = source.readString(); 115 this.merchantUuid = source.readString();
116 + this.final_price = source.readDouble();
112 } 117 }
113 118
114 @Override 119 @Override
...@@ -120,6 +125,7 @@ public class SharingCoupon implements Parcelable, Serializable { ...@@ -120,6 +125,7 @@ public class SharingCoupon implements Parcelable, Serializable {
120 dest.writeString(this.transactionMetadata); 125 dest.writeString(this.transactionMetadata);
121 dest.writeString(this.name); 126 dest.writeString(this.name);
122 dest.writeString(this.merchantUuid); 127 dest.writeString(this.merchantUuid);
128 + dest.writeDouble(this.final_price);
123 } 129 }
124 130
125 /** 131 /**
...@@ -137,6 +143,7 @@ public class SharingCoupon implements Parcelable, Serializable { ...@@ -137,6 +143,7 @@ public class SharingCoupon implements Parcelable, Serializable {
137 jObj.putOpt(TRANSACTION_METADATA, this.transactionMetadata); 143 jObj.putOpt(TRANSACTION_METADATA, this.transactionMetadata);
138 jObj.putOpt(NAME, this.name); 144 jObj.putOpt(NAME, this.name);
139 jObj.putOpt(MERCHANT_UUID, this.merchantUuid); 145 jObj.putOpt(MERCHANT_UUID, this.merchantUuid);
146 + jObj.putOpt(FINAL_PRICE, this.final_price);
140 } catch (JSONException e) { 147 } catch (JSONException e) {
141 if (WarpConstants.DEBUG) { 148 if (WarpConstants.DEBUG) {
142 e.printStackTrace(); 149 e.printStackTrace();
...@@ -232,6 +239,14 @@ public class SharingCoupon implements Parcelable, Serializable { ...@@ -232,6 +239,14 @@ public class SharingCoupon implements Parcelable, Serializable {
232 this.merchantUuid = merchantUuid; 239 this.merchantUuid = merchantUuid;
233 } 240 }
234 241
242 + public double getFinal_price() {
243 + return final_price;
244 + }
245 +
246 + public void setFinal_price(double final_price) {
247 + this.final_price = final_price;
248 + }
249 +
235 @Override 250 @Override
236 public int describeContents() { 251 public int describeContents() {
237 return 0; 252 return 0;
......
...@@ -12,6 +12,7 @@ import ly.warp.sdk.io.models.LoyaltyEventModel; ...@@ -12,6 +12,7 @@ import ly.warp.sdk.io.models.LoyaltyEventModel;
12 import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent; 12 import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent;
13 import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel; 13 import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel;
14 import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; 14 import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
15 +import ly.warp.sdk.io.models.LoyaltySDKSessionExpiredEventModel;
15 import ly.warp.sdk.io.models.QuestionnaireEventModel; 16 import ly.warp.sdk.io.models.QuestionnaireEventModel;
16 import ly.warp.sdk.io.models.WarplyCCMSEnabledModel; 17 import ly.warp.sdk.io.models.WarplyCCMSEnabledModel;
17 import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel; 18 import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
...@@ -43,6 +44,7 @@ public class WarplyEventBusManager { ...@@ -43,6 +44,7 @@ public class WarplyEventBusManager {
43 private HealthEventModel healthAdded; 44 private HealthEventModel healthAdded;
44 private WarplyCouponsChangedEventModel couponsChanged; 45 private WarplyCouponsChangedEventModel couponsChanged;
45 private WarplyPacingCardEventModel widgetChanged; 46 private WarplyPacingCardEventModel widgetChanged;
47 + private LoyaltySDKSessionExpiredEventModel sessionExpired;
46 48
47 public WarplyEventBusManager() { 49 public WarplyEventBusManager() {
48 50
...@@ -60,6 +62,10 @@ public class WarplyEventBusManager { ...@@ -60,6 +62,10 @@ public class WarplyEventBusManager {
60 this.ccmsAdded = ccmsAdded; 62 this.ccmsAdded = ccmsAdded;
61 } 63 }
62 64
65 + public WarplyEventBusManager (LoyaltySDKSessionExpiredEventModel sessionExpired) {
66 + this.sessionExpired = sessionExpired;
67 + }
68 +
63 public WarplyEventBusManager(CouponsEventModel couponsAdded) { 69 public WarplyEventBusManager(CouponsEventModel couponsAdded) {
64 this.couponsAdded = couponsAdded; 70 this.couponsAdded = couponsAdded;
65 } 71 }
...@@ -217,4 +223,8 @@ public class WarplyEventBusManager { ...@@ -217,4 +223,8 @@ public class WarplyEventBusManager {
217 public WarplyPacingCardEventModel getWidgetChanged() { 223 public WarplyPacingCardEventModel getWidgetChanged() {
218 return widgetChanged; 224 return widgetChanged;
219 } 225 }
226 +
227 + public LoyaltySDKSessionExpiredEventModel isLoyaltySessionExpired() {
228 + return sessionExpired;
229 + }
220 } 230 }
......
...@@ -87,6 +87,7 @@ import ly.warp.sdk.io.models.CouponList; ...@@ -87,6 +87,7 @@ import ly.warp.sdk.io.models.CouponList;
87 import ly.warp.sdk.io.models.Couponset; 87 import ly.warp.sdk.io.models.Couponset;
88 import ly.warp.sdk.io.models.CouponsetsList; 88 import ly.warp.sdk.io.models.CouponsetsList;
89 import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel; 89 import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel;
90 +import ly.warp.sdk.io.models.LoyaltySDKSessionExpiredEventModel;
90 import ly.warp.sdk.io.models.Merchant; 91 import ly.warp.sdk.io.models.Merchant;
91 import ly.warp.sdk.io.models.MerchantCategoriesList; 92 import ly.warp.sdk.io.models.MerchantCategoriesList;
92 import ly.warp.sdk.io.models.MerchantList; 93 import ly.warp.sdk.io.models.MerchantList;
...@@ -543,21 +544,31 @@ public class WarplyManager { ...@@ -543,21 +544,31 @@ public class WarplyManager {
543 @Override 544 @Override
544 public void onFailure(int errorCode) { 545 public void onFailure(int errorCode) {
545 if (errorCode == 401) { 546 if (errorCode == 401) {
546 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 547 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
547 - @Override 548 +// @Override
548 - public void onSuccess(JSONObject result) { 549 +// public void onSuccess(JSONObject result) {
549 - int status = result.optInt("status", 2); 550 +// int status = result.optInt("status", 2);
550 - if (status == 1) 551 +// if (status == 1)
551 - getConsumer(request, receiver); 552 +// getConsumer(request, receiver);
552 - else 553 +// else
553 - receiver.onFailure(status); 554 +// receiver.onFailure(status);
554 - } 555 +// }
556 +//
557 +// @Override
558 +// public void onFailure(int errorCode) {
559 +// receiver.onFailure(errorCode);
560 +// }
561 +// });
562 +
563 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
564 + sessionExpired.setLoyaltySessionExpired(true);
565 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
566 +
567 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
568 + dynatraceEvent.setEventName("custom_error_profile_loyalty");
569 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
555 570
556 - @Override
557 - public void onFailure(int errorCode) {
558 receiver.onFailure(errorCode); 571 receiver.onFailure(errorCode);
559 - }
560 - });
561 } else { 572 } else {
562 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 573 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
563 dynatraceEvent.setEventName("custom_error_profile_loyalty"); 574 dynatraceEvent.setEventName("custom_error_profile_loyalty");
...@@ -975,21 +986,30 @@ public class WarplyManager { ...@@ -975,21 +986,30 @@ public class WarplyManager {
975 @Override 986 @Override
976 public void onFailure(int errorCode) { 987 public void onFailure(int errorCode) {
977 if (errorCode == 401) { 988 if (errorCode == 401) {
978 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 989 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
979 - @Override 990 +// @Override
980 - public void onSuccess(JSONObject result) { 991 +// public void onSuccess(JSONObject result) {
981 - int status = result.optInt("status", 2); 992 +// int status = result.optInt("status", 2);
982 - if (status == 1) 993 +// if (status == 1)
983 - getUserCoupons(request, receiver); 994 +// getUserCoupons(request, receiver);
984 - else 995 +// else
985 - receiver.onFailure(status); 996 +// receiver.onFailure(status);
986 - } 997 +// }
998 +//
999 +// @Override
1000 +// public void onFailure(int errorCode) {
1001 +// receiver.onFailure(errorCode);
1002 +// }
1003 +// });
987 1004
988 - @Override 1005 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
989 - public void onFailure(int errorCode) { 1006 + sessionExpired.setLoyaltySessionExpired(true);
1007 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
1008 +
1009 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1010 + dynatraceEvent.setEventName("custom_error_user_coupons_loyalty");
1011 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
990 receiver.onFailure(errorCode); 1012 receiver.onFailure(errorCode);
991 - }
992 - });
993 } else { 1013 } else {
994 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 1014 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
995 dynatraceEvent.setEventName("custom_error_user_coupons_loyalty"); 1015 dynatraceEvent.setEventName("custom_error_user_coupons_loyalty");
...@@ -1421,21 +1441,30 @@ public class WarplyManager { ...@@ -1421,21 +1441,30 @@ public class WarplyManager {
1421 @Override 1441 @Override
1422 public void onFailure(int errorCode) { 1442 public void onFailure(int errorCode) {
1423 if (errorCode == 401) { 1443 if (errorCode == 401) {
1424 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 1444 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
1425 - @Override 1445 +// @Override
1426 - public void onSuccess(JSONObject result) { 1446 +// public void onSuccess(JSONObject result) {
1427 - int status = result.optInt("status", 2); 1447 +// int status = result.optInt("status", 2);
1428 - if (status == 1) 1448 +// if (status == 1)
1429 - redeemCoupon(request, receiver); 1449 +// redeemCoupon(request, receiver);
1430 - else 1450 +// else
1431 - receiver.onFailure(status); 1451 +// receiver.onFailure(status);
1432 - } 1452 +// }
1453 +//
1454 +// @Override
1455 +// public void onFailure(int errorCode) {
1456 +// receiver.onFailure(errorCode);
1457 +// }
1458 +// });
1433 1459
1434 - @Override 1460 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
1435 - public void onFailure(int errorCode) { 1461 + sessionExpired.setLoyaltySessionExpired(true);
1462 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
1463 +
1464 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1465 + dynatraceEvent.setEventName("custom_error_retrieve_coupon_loyalty");
1466 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
1436 receiver.onFailure(errorCode); 1467 receiver.onFailure(errorCode);
1437 - }
1438 - });
1439 } else { 1468 } else {
1440 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 1469 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1441 dynatraceEvent.setEventName("custom_error_retrieve_coupon_loyalty"); 1470 dynatraceEvent.setEventName("custom_error_retrieve_coupon_loyalty");
...@@ -1610,21 +1639,30 @@ public class WarplyManager { ...@@ -1610,21 +1639,30 @@ public class WarplyManager {
1610 @Override 1639 @Override
1611 public void onFailure(int errorCode) { 1640 public void onFailure(int errorCode) {
1612 if (errorCode == 401) { 1641 if (errorCode == 401) {
1613 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 1642 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
1614 - @Override 1643 +// @Override
1615 - public void onSuccess(JSONObject result) { 1644 +// public void onSuccess(JSONObject result) {
1616 - int status = result.optInt("status", 2); 1645 +// int status = result.optInt("status", 2);
1617 - if (status == 1) 1646 +// if (status == 1)
1618 - getCampaignsPersonalized(request, receiver); 1647 +// getCampaignsPersonalized(request, receiver);
1619 - else 1648 +// else
1620 - receiver.onFailure(status); 1649 +// receiver.onFailure(status);
1621 - } 1650 +// }
1651 +//
1652 +// @Override
1653 +// public void onFailure(int errorCode) {
1654 +// receiver.onFailure(errorCode);
1655 +// }
1656 +// });
1622 1657
1623 - @Override 1658 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
1624 - public void onFailure(int errorCode) { 1659 + sessionExpired.setLoyaltySessionExpired(true);
1660 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
1661 +
1662 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1663 + dynatraceEvent.setEventName("custom_error_campaigns_personalized_loyalty");
1664 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
1625 receiver.onFailure(errorCode); 1665 receiver.onFailure(errorCode);
1626 - }
1627 - });
1628 } else { 1666 } else {
1629 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 1667 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1630 dynatraceEvent.setEventName("custom_error_campaigns_personalized_loyalty"); 1668 dynatraceEvent.setEventName("custom_error_campaigns_personalized_loyalty");
...@@ -1661,21 +1699,30 @@ public class WarplyManager { ...@@ -1661,21 +1699,30 @@ public class WarplyManager {
1661 @Override 1699 @Override
1662 public void onFailure(int errorCode) { 1700 public void onFailure(int errorCode) {
1663 if (errorCode == 401) { 1701 if (errorCode == 401) {
1664 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 1702 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
1665 - @Override 1703 +// @Override
1666 - public void onSuccess(JSONObject result) { 1704 +// public void onSuccess(JSONObject result) {
1667 - int status = result.optInt("status", 2); 1705 +// int status = result.optInt("status", 2);
1668 - if (status == 1) 1706 +// if (status == 1)
1669 - consumerIntegration(request, receiver); 1707 +// consumerIntegration(request, receiver);
1670 - else 1708 +// else
1671 - receiver.onFailure(status); 1709 +// receiver.onFailure(status);
1672 - } 1710 +// }
1711 +//
1712 +// @Override
1713 +// public void onFailure(int errorCode) {
1714 +// receiver.onFailure(errorCode);
1715 +// }
1716 +// });
1673 1717
1674 - @Override 1718 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
1675 - public void onFailure(int errorCode) { 1719 + sessionExpired.setLoyaltySessionExpired(true);
1720 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
1721 +
1722 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1723 + dynatraceEvent.setEventName("custom_error_customer_state_loyalty");
1724 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
1676 receiver.onFailure(errorCode); 1725 receiver.onFailure(errorCode);
1677 - }
1678 - });
1679 } else { 1726 } else {
1680 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 1727 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1681 dynatraceEvent.setEventName("custom_error_customer_state_loyalty"); 1728 dynatraceEvent.setEventName("custom_error_customer_state_loyalty");
...@@ -1711,21 +1758,30 @@ public class WarplyManager { ...@@ -1711,21 +1758,30 @@ public class WarplyManager {
1711 @Override 1758 @Override
1712 public void onFailure(int errorCode) { 1759 public void onFailure(int errorCode) {
1713 if (errorCode == 401) { 1760 if (errorCode == 401) {
1714 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 1761 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
1715 - @Override 1762 +// @Override
1716 - public void onSuccess(JSONObject result) { 1763 +// public void onSuccess(JSONObject result) {
1717 - int status = result.optInt("status", 2); 1764 +// int status = result.optInt("status", 2);
1718 - if (status == 1) 1765 +// if (status == 1)
1719 - cosmoteSharing(request, receiver); 1766 +// cosmoteSharing(request, receiver);
1720 - else 1767 +// else
1721 - receiver.onFailure(status); 1768 +// receiver.onFailure(status);
1722 - } 1769 +// }
1770 +//
1771 +// @Override
1772 +// public void onFailure(int errorCode) {
1773 +// receiver.onFailure(errorCode);
1774 +// }
1775 +// });
1723 1776
1724 - @Override 1777 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
1725 - public void onFailure(int errorCode) { 1778 + sessionExpired.setLoyaltySessionExpired(true);
1779 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
1780 +
1781 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1782 + dynatraceEvent.setEventName("custom_error_sharing_loyalty");
1783 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
1726 receiver.onFailure(errorCode); 1784 receiver.onFailure(errorCode);
1727 - }
1728 - });
1729 } else { 1785 } else {
1730 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 1786 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1731 dynatraceEvent.setEventName("custom_error_sharing_loyalty"); 1787 dynatraceEvent.setEventName("custom_error_sharing_loyalty");
...@@ -1761,21 +1817,30 @@ public class WarplyManager { ...@@ -1761,21 +1817,30 @@ public class WarplyManager {
1761 @Override 1817 @Override
1762 public void onFailure(int errorCode) { 1818 public void onFailure(int errorCode) {
1763 if (errorCode == 401) { 1819 if (errorCode == 401) {
1764 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 1820 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
1765 - @Override 1821 +// @Override
1766 - public void onSuccess(JSONObject result) { 1822 +// public void onSuccess(JSONObject result) {
1767 - int status = result.optInt("status", 2); 1823 +// int status = result.optInt("status", 2);
1768 - if (status == 1) 1824 +// if (status == 1)
1769 - cosmoteRetrieveSharing(request, receiver); 1825 +// cosmoteRetrieveSharing(request, receiver);
1770 - else 1826 +// else
1771 - receiver.onFailure(status); 1827 +// receiver.onFailure(status);
1772 - } 1828 +// }
1829 +//
1830 +// @Override
1831 +// public void onFailure(int errorCode) {
1832 +// receiver.onFailure(errorCode);
1833 +// }
1834 +// });
1773 1835
1774 - @Override 1836 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
1775 - public void onFailure(int errorCode) { 1837 + sessionExpired.setLoyaltySessionExpired(true);
1838 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
1839 +
1840 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1841 + dynatraceEvent.setEventName("custom_error_retrieve_sharing_loyalty");
1842 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
1776 receiver.onFailure(errorCode); 1843 receiver.onFailure(errorCode);
1777 - }
1778 - });
1779 } else { 1844 } else {
1780 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 1845 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1781 dynatraceEvent.setEventName("custom_error_retrieve_sharing_loyalty"); 1846 dynatraceEvent.setEventName("custom_error_retrieve_sharing_loyalty");
...@@ -1816,21 +1881,30 @@ public class WarplyManager { ...@@ -1816,21 +1881,30 @@ public class WarplyManager {
1816 @Override 1881 @Override
1817 public void onFailure(int errorCode) { 1882 public void onFailure(int errorCode) {
1818 if (errorCode == 401) { 1883 if (errorCode == 401) {
1819 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 1884 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
1820 - @Override 1885 +// @Override
1821 - public void onSuccess(JSONObject result) { 1886 +// public void onSuccess(JSONObject result) {
1822 - int status = result.optInt("status", 2); 1887 +// int status = result.optInt("status", 2);
1823 - if (status == 1) 1888 +// if (status == 1)
1824 - getPacingDetails(request, receiver); 1889 +// getPacingDetails(request, receiver);
1825 - else 1890 +// else
1826 - receiver.onFailure(status); 1891 +// receiver.onFailure(status);
1827 - } 1892 +// }
1893 +//
1894 +// @Override
1895 +// public void onFailure(int errorCode) {
1896 +// receiver.onFailure(errorCode);
1897 +// }
1898 +// });
1828 1899
1829 - @Override 1900 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
1830 - public void onFailure(int errorCode) { 1901 + sessionExpired.setLoyaltySessionExpired(true);
1902 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
1903 +
1904 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1905 + dynatraceEvent.setEventName("custom_error_pacing_loyalty");
1906 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
1831 receiver.onFailure(errorCode); 1907 receiver.onFailure(errorCode);
1832 - }
1833 - });
1834 } else { 1908 } else {
1835 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 1909 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1836 dynatraceEvent.setEventName("custom_error_pacing_loyalty"); 1910 dynatraceEvent.setEventName("custom_error_pacing_loyalty");
...@@ -1867,21 +1941,30 @@ public class WarplyManager { ...@@ -1867,21 +1941,30 @@ public class WarplyManager {
1867 @Override 1941 @Override
1868 public void onFailure(int errorCode) { 1942 public void onFailure(int errorCode) {
1869 if (errorCode == 401) { 1943 if (errorCode == 401) {
1870 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 1944 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
1871 - @Override 1945 +// @Override
1872 - public void onSuccess(JSONObject result) { 1946 +// public void onSuccess(JSONObject result) {
1873 - int status = result.optInt("status", 2); 1947 +// int status = result.optInt("status", 2);
1874 - if (status == 1) 1948 +// if (status == 1)
1875 - cosmoteCouponSharing(request, receiver); 1949 +// cosmoteCouponSharing(request, receiver);
1876 - else 1950 +// else
1877 - receiver.onFailure(status); 1951 +// receiver.onFailure(status);
1878 - } 1952 +// }
1953 +//
1954 +// @Override
1955 +// public void onFailure(int errorCode) {
1956 +// receiver.onFailure(errorCode);
1957 +// }
1958 +// });
1879 1959
1880 - @Override 1960 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
1881 - public void onFailure(int errorCode) { 1961 + sessionExpired.setLoyaltySessionExpired(true);
1962 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
1963 +
1964 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1965 + dynatraceEvent.setEventName("custom_error_coupon_sharing_loyalty");
1966 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
1882 receiver.onFailure(errorCode); 1967 receiver.onFailure(errorCode);
1883 - }
1884 - });
1885 } else { 1968 } else {
1886 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 1969 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
1887 dynatraceEvent.setEventName("custom_error_coupon_sharing_loyalty"); 1970 dynatraceEvent.setEventName("custom_error_coupon_sharing_loyalty");
...@@ -1954,21 +2037,30 @@ public class WarplyManager { ...@@ -1954,21 +2037,30 @@ public class WarplyManager {
1954 @Override 2037 @Override
1955 public void onFailure(int errorCode) { 2038 public void onFailure(int errorCode) {
1956 if (errorCode == 401) { 2039 if (errorCode == 401) {
1957 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 2040 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
1958 - @Override 2041 +// @Override
1959 - public void onSuccess(JSONObject result) { 2042 +// public void onSuccess(JSONObject result) {
1960 - int status = result.optInt("status", 2); 2043 +// int status = result.optInt("status", 2);
1961 - if (status == 1) 2044 +// if (status == 1)
1962 - getUserCoupons(request, receiver); 2045 +// getUserCoupons(request, receiver);
1963 - else 2046 +// else
1964 - receiver.onFailure(status); 2047 +// receiver.onFailure(status);
1965 - } 2048 +// }
2049 +//
2050 +// @Override
2051 +// public void onFailure(int errorCode) {
2052 +// receiver.onFailure(errorCode);
2053 +// }
2054 +// });
1966 2055
1967 - @Override 2056 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
1968 - public void onFailure(int errorCode) { 2057 + sessionExpired.setLoyaltySessionExpired(true);
2058 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
2059 +
2060 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2061 + dynatraceEvent.setEventName("custom_error_user_coupons_loyalty");
2062 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
1969 receiver.onFailure(errorCode); 2063 receiver.onFailure(errorCode);
1970 - }
1971 - });
1972 } else 2064 } else
1973 receiver.onFailure(errorCode); 2065 receiver.onFailure(errorCode);
1974 } 2066 }
...@@ -2141,6 +2233,15 @@ public class WarplyManager { ...@@ -2141,6 +2233,15 @@ public class WarplyManager {
2141 EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent)); 2233 EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
2142 receiver.onFailure(2); 2234 receiver.onFailure(2);
2143 } 2235 }
2236 + } else if (responseCoupons.code() == 401) {
2237 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
2238 + sessionExpired.setLoyaltySessionExpired(true);
2239 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
2240 +
2241 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2242 + dynatraceEvent.setEventName("custom_error_user_coupons_loyalty");
2243 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
2244 + receiver.onFailure(responseCoupons.code());
2144 } else { 2245 } else {
2145 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 2246 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2146 dynatraceEvent.setEventName("custom_error_user_coupons_loyalty"); 2247 dynatraceEvent.setEventName("custom_error_user_coupons_loyalty");
...@@ -2323,21 +2424,23 @@ public class WarplyManager { ...@@ -2323,21 +2424,23 @@ public class WarplyManager {
2323 @Override 2424 @Override
2324 public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> response) { 2425 public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> response) {
2325 if (response.code() == 401) { 2426 if (response.code() == 401) {
2326 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 2427 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
2327 - @Override 2428 +// @Override
2328 - public void onSuccess(JSONObject result) { 2429 +// public void onSuccess(JSONObject result) {
2329 - int status = result.optInt("status", 2); 2430 +// int status = result.optInt("status", 2);
2330 - if (status == 1) 2431 +// if (status == 1)
2331 - getUserCouponsRetro(service, callback); 2432 +// getUserCouponsRetro(service, callback);
2332 - else 2433 +// else
2333 - callback.onFailure(call, new Throwable()); 2434 +// callback.onFailure(call, new Throwable());
2334 - } 2435 +// }
2436 +//
2437 +// @Override
2438 +// public void onFailure(int errorCode) {
2439 +// callback.onFailure(call, new Throwable());
2440 +// }
2441 +// });
2335 2442
2336 - @Override 2443 + callback.onResponse(call, response);
2337 - public void onFailure(int errorCode) {
2338 - callback.onFailure(call, new Throwable());
2339 - }
2340 - });
2341 } else { 2444 } else {
2342 callback.onResponse(call, response); 2445 callback.onResponse(call, response);
2343 } 2446 }
...@@ -2468,21 +2571,30 @@ public class WarplyManager { ...@@ -2468,21 +2571,30 @@ public class WarplyManager {
2468 @Override 2571 @Override
2469 public void onFailure(int errorCode) { 2572 public void onFailure(int errorCode) {
2470 if (errorCode == 401) { 2573 if (errorCode == 401) {
2471 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 2574 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
2472 - @Override 2575 +// @Override
2473 - public void onSuccess(JSONObject result) { 2576 +// public void onSuccess(JSONObject result) {
2474 - int status = result.optInt("status", 2); 2577 +// int status = result.optInt("status", 2);
2475 - if (status == 1) 2578 +// if (status == 1)
2476 - submitOrder(request, receiver); 2579 +// submitOrder(request, receiver);
2477 - else 2580 +// else
2478 - receiver.onFailure(status); 2581 +// receiver.onFailure(status);
2479 - } 2582 +// }
2583 +//
2584 +// @Override
2585 +// public void onFailure(int errorCode) {
2586 +// receiver.onFailure(errorCode);
2587 +// }
2588 +// });
2480 2589
2481 - @Override 2590 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
2482 - public void onFailure(int errorCode) { 2591 + sessionExpired.setLoyaltySessionExpired(true);
2592 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
2593 +
2594 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2595 + dynatraceEvent.setEventName("custom_error_submit_order_loyalty");
2596 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
2483 receiver.onFailure(errorCode); 2597 receiver.onFailure(errorCode);
2484 - }
2485 - });
2486 } else { 2598 } else {
2487 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 2599 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2488 dynatraceEvent.setEventName("custom_error_submit_order_loyalty"); 2600 dynatraceEvent.setEventName("custom_error_submit_order_loyalty");
...@@ -2510,21 +2622,30 @@ public class WarplyManager { ...@@ -2510,21 +2622,30 @@ public class WarplyManager {
2510 @Override 2622 @Override
2511 public void onFailure(int errorCode) { 2623 public void onFailure(int errorCode) {
2512 if (errorCode == 401) { 2624 if (errorCode == 401) {
2513 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 2625 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
2514 - @Override 2626 +// @Override
2515 - public void onSuccess(JSONObject result) { 2627 +// public void onSuccess(JSONObject result) {
2516 - int status = result.optInt("status", 2); 2628 +// int status = result.optInt("status", 2);
2517 - if (status == 1) 2629 +// if (status == 1)
2518 - getSharingHistory(request, receiver); 2630 +// getSharingHistory(request, receiver);
2519 - else 2631 +// else
2520 - receiver.onFailure(status); 2632 +// receiver.onFailure(status);
2521 - } 2633 +// }
2634 +//
2635 +// @Override
2636 +// public void onFailure(int errorCode) {
2637 +// receiver.onFailure(errorCode);
2638 +// }
2639 +// });
2522 2640
2523 - @Override 2641 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
2524 - public void onFailure(int errorCode) { 2642 + sessionExpired.setLoyaltySessionExpired(true);
2643 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
2644 +
2645 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2646 + dynatraceEvent.setEventName("custom_error_sharing_history_loyalty");
2647 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
2525 receiver.onFailure(errorCode); 2648 receiver.onFailure(errorCode);
2526 - }
2527 - });
2528 } else { 2649 } else {
2529 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 2650 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2530 dynatraceEvent.setEventName("custom_error_sharing_history_loyalty"); 2651 dynatraceEvent.setEventName("custom_error_sharing_history_loyalty");
...@@ -2561,21 +2682,30 @@ public class WarplyManager { ...@@ -2561,21 +2682,30 @@ public class WarplyManager {
2561 @Override 2682 @Override
2562 public void onFailure(int errorCode) { 2683 public void onFailure(int errorCode) {
2563 if (errorCode == 401) { 2684 if (errorCode == 401) {
2564 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 2685 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
2565 - @Override 2686 +// @Override
2566 - public void onSuccess(JSONObject result) { 2687 +// public void onSuccess(JSONObject result) {
2567 - int status = result.optInt("status", 2); 2688 +// int status = result.optInt("status", 2);
2568 - if (status == 1) 2689 +// if (status == 1)
2569 - postEvent(request, receiver); 2690 +// postEvent(request, receiver);
2570 - else 2691 +// else
2571 - receiver.onFailure(status); 2692 +// receiver.onFailure(status);
2572 - } 2693 +// }
2694 +//
2695 +// @Override
2696 +// public void onFailure(int errorCode) {
2697 +// receiver.onFailure(errorCode);
2698 +// }
2699 +// });
2573 2700
2574 - @Override 2701 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
2575 - public void onFailure(int errorCode) { 2702 + sessionExpired.setLoyaltySessionExpired(true);
2703 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
2704 +
2705 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2706 + dynatraceEvent.setEventName("custom_error_post_event_loyalty");
2707 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
2576 receiver.onFailure(errorCode); 2708 receiver.onFailure(errorCode);
2577 - }
2578 - });
2579 } else { 2709 } else {
2580 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 2710 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2581 dynatraceEvent.setEventName("custom_error_post_event_loyalty"); 2711 dynatraceEvent.setEventName("custom_error_post_event_loyalty");
...@@ -2611,21 +2741,30 @@ public class WarplyManager { ...@@ -2611,21 +2741,30 @@ public class WarplyManager {
2611 @Override 2741 @Override
2612 public void onFailure(int errorCode) { 2742 public void onFailure(int errorCode) {
2613 if (errorCode == 401) { 2743 if (errorCode == 401) {
2614 - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { 2744 +// refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
2615 - @Override 2745 +// @Override
2616 - public void onSuccess(JSONObject result) { 2746 +// public void onSuccess(JSONObject result) {
2617 - int status = result.optInt("status", 2); 2747 +// int status = result.optInt("status", 2);
2618 - if (status == 1) 2748 +// if (status == 1)
2619 - setPacingDetails(request, receiver); 2749 +// setPacingDetails(request, receiver);
2620 - else 2750 +// else
2621 - receiver.onFailure(status); 2751 +// receiver.onFailure(status);
2622 - } 2752 +// }
2753 +//
2754 +// @Override
2755 +// public void onFailure(int errorCode) {
2756 +// receiver.onFailure(errorCode);
2757 +// }
2758 +// });
2623 2759
2624 - @Override 2760 + LoyaltySDKSessionExpiredEventModel sessionExpired = new LoyaltySDKSessionExpiredEventModel();
2625 - public void onFailure(int errorCode) { 2761 + sessionExpired.setLoyaltySessionExpired(true);
2762 + EventBus.getDefault().post(new WarplyEventBusManager(sessionExpired));
2763 +
2764 + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2765 + dynatraceEvent.setEventName("custom_error_save_pacing_loyalty");
2766 + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
2626 receiver.onFailure(errorCode); 2767 receiver.onFailure(errorCode);
2627 - }
2628 - });
2629 } else { 2768 } else {
2630 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); 2769 LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
2631 dynatraceEvent.setEventName("custom_error_save_pacing_loyalty"); 2770 dynatraceEvent.setEventName("custom_error_save_pacing_loyalty");
......
...@@ -124,7 +124,8 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap ...@@ -124,7 +124,8 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
124 simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); 124 simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
125 holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : "")); 125 holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : ""));
126 126
127 - holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro)); 127 + String itemValue = String.format("%.02f", couponItem.getFinal_price());
128 + holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro));
128 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); 129 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
129 } 130 }
130 } 131 }
......
...@@ -144,7 +144,8 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte ...@@ -144,7 +144,8 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte
144 } 144 }
145 } 145 }
146 146
147 - holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro)); 147 + String itemValue = String.format("%.02f", couponItem.getFinal_price());
148 + holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro));
148 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); 149 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
149 } 150 }
150 } 151 }
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
70 <string name="cos_popup_gifts_title">COSMOTE GIFTS FOR YOU</string> 70 <string name="cos_popup_gifts_title">COSMOTE GIFTS FOR YOU</string>
71 <string name="cos_popup_gifts_subtitle">Σε αυτή την ενότητα βρίσκεις τα διαθέσιμα δώρα και επιβραβεύσεις αποκλειστικά για σένα!</string> 71 <string name="cos_popup_gifts_subtitle">Σε αυτή την ενότητα βρίσκεις τα διαθέσιμα δώρα και επιβραβεύσεις αποκλειστικά για σένα!</string>
72 <string name="cos_mycoupon_date">Το κουπόνι ισχύει έως %1$s</string> 72 <string name="cos_mycoupon_date">Το κουπόνι ισχύει έως %1$s</string>
73 - <string name="cos_gift_it">Kάνε δώρο</string> 73 + <string name="cos_gift_it">Δώρισε το</string>
74 <string name="cos_popup_more_title">COSMOTE MORE FOR YOU</string> 74 <string name="cos_popup_more_title">COSMOTE MORE FOR YOU</string>
75 <string name="cos_popup_more_subtitle">Σε αυτή την ενότητα βρες έρευνες, παιχνίδια, διαγωνισμούς και επιβραβεύσεις για τις αθλητικές σου δραστηριότητες!</string> 75 <string name="cos_popup_more_subtitle">Σε αυτή την ενότητα βρες έρευνες, παιχνίδια, διαγωνισμούς και επιβραβεύσεις για τις αθλητικές σου δραστηριότητες!</string>
76 <string name="cos_deals_win_title">Μέχρι τώρα έχεις κερδίσει %1$s€ σε προσφορές από %2$s κουπόνια!</string> 76 <string name="cos_deals_win_title">Μέχρι τώρα έχεις κερδίσει %1$s€ σε προσφορές από %2$s κουπόνια!</string>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
95 <string name="cos_shops">Δες τα καταστήματα</string> 95 <string name="cos_shops">Δες τα καταστήματα</string>
96 <string name="cos_website">Δες το eshop</string> 96 <string name="cos_website">Δες το eshop</string>
97 <string name="cos_coupon_shops_title">Καταστήματα</string> 97 <string name="cos_coupon_shops_title">Καταστήματα</string>
98 - <string name="cos_coupon_gift">Kάνε δώρο</string> 98 + <string name="cos_coupon_gift">Δώρισε το</string>
99 <string name="cos_coupon_share_gift_title">Επίλεξε το κινητό από το οποίο θα γίνει η αποστολή και συμπλήρωσε το COSMOTE κινητό που θα λάβει το δώρο.</string> 99 <string name="cos_coupon_share_gift_title">Επίλεξε το κινητό από το οποίο θα γίνει η αποστολή και συμπλήρωσε το COSMOTE κινητό που θα λάβει το δώρο.</string>
100 <string name="cos_coupon_share_sender">Αποστολέας</string> 100 <string name="cos_coupon_share_sender">Αποστολέας</string>
101 <string name="cos_coupon_share_hint">Καταχώρηση τηλεφώνου</string> 101 <string name="cos_coupon_share_hint">Καταχώρηση τηλεφώνου</string>
......