Panagiotis Triantafyllou

new events

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta97'
PUBLISH_VERSION = '4.5.4-cosbeta98'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ly.warp.sdk.io.models;
import java.util.HashMap;
/**
* Created by Panagiotis Triantafyllou on 21-Oct-22.
*/
public class LoyaltySDKDynatraceEventModel {
private String eventName;
private HashMap<String, String> parameters;
public LoyaltySDKDynatraceEventModel() {
this.eventName = "";
this.parameters = new HashMap();
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public HashMap<String, String> getParameters() {
return parameters;
}
public void setParameter(String key, String value) {
this.parameters.put(key, value);
}
}
......@@ -10,6 +10,7 @@ import ly.warp.sdk.io.models.HealthEventModel;
import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.io.models.LoyaltyEventModel;
import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent;
import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.models.QuestionnaireEventModel;
import ly.warp.sdk.io.models.WarplyCCMSEnabledModel;
......@@ -25,6 +26,7 @@ import ly.warp.sdk.io.models.WarplyPacingEventModel;
public class WarplyEventBusManager {
private String eventName;
private LoyaltySDKFirebaseEventModel fireEvent;
private LoyaltySDKDynatraceEventModel dynatraceEvent;
private LoyaltyContextualOfferModel ccms;
protected HashMap<String, Object> mWarplyEventBusManager = new HashMap();
private WarplyPacingEventModel pacing;
......@@ -90,6 +92,10 @@ public class WarplyEventBusManager {
this.fireEvent = fireEvent;
}
public WarplyEventBusManager(LoyaltySDKDynatraceEventModel dynatraceEvent) {
this.dynatraceEvent = dynatraceEvent;
}
public WarplyEventBusManager(WarplyPacingEventModel pacing) {
this.pacing = pacing;
}
......@@ -144,6 +150,10 @@ public class WarplyEventBusManager {
return fireEvent;
}
public LoyaltySDKDynatraceEventModel getDynaEvent() {
return dynatraceEvent;
}
public LoyaltyContextualOfferModel getCcms() {
return ccms;
}
......
......@@ -79,6 +79,7 @@ import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.Couponset;
import ly.warp.sdk.io.models.CouponsetsList;
import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel;
import ly.warp.sdk.io.models.MerchantCategoriesList;
import ly.warp.sdk.io.models.MerchantList;
import ly.warp.sdk.io.models.PacingDetails;
......@@ -413,17 +414,32 @@ public class WarplyManager {
try {
newResult.putOpt("status", 1);
newResult.putOpt("message", "Success");
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_refresh_token_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(newResult);
} catch (JSONException e) {
e.printStackTrace();
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_refresh_token_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(2);
}
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_refresh_token_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(2);
}
}
@Override
public void onFailure(int errorCode) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_refresh_token_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
if (errorCode == 401) {
WarplyDBHelper.getInstance(Warply.getWarplyContext()).deleteAuth();
WarplyDBHelper.getInstance(Warply.getWarplyContext()).deleteClient();
......@@ -488,14 +504,23 @@ public class WarplyManager {
public void onSuccess(JSONObject result) {
int status = result.optInt("status", 2);
if (status == 1) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_profile_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
result = result.optJSONObject("result");
if (result == null) {
receiver.onFailure(2);
return;
}
receiver.onSuccess(new Consumer(result));
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_profile_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(status);
}
}
@Override
......@@ -516,8 +541,13 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_profile_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
});
}
......@@ -537,9 +567,15 @@ public class WarplyManager {
try {
newResult.putOpt("status", 1);
newResult.putOpt("message", "Success");
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_logout_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(newResult);
} catch (JSONException e) {
e.printStackTrace();
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_logout_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(2);
}
}
......@@ -807,8 +843,15 @@ public class WarplyManager {
try {
newResult.putOpt("status", 1);
newResult.putOpt("message", "Success");
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_login_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(newResult);
} catch (JSONException e) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_login_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
e.printStackTrace();
receiver.onFailure(2);
}
......@@ -861,14 +904,22 @@ public class WarplyManager {
}
});
} else
} else {
receiver.onFailure(2);
} else
}
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_login_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(status);
}
}
@Override
public void onFailure(int errorCode) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_login_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
});
......@@ -894,6 +945,10 @@ public class WarplyManager {
// }
// }
// WarplyManagerHelper.setCouponList(mCouponList);
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_user_coupons_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(/*mCouponList*/ result);
}
......@@ -915,8 +970,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_user_coupons_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
},
request.getSignature()));
......@@ -1298,12 +1357,19 @@ public class WarplyManager {
Warply.postReceiveMicroappData(WarpConstants.MICROAPP_COUPONS, request.toJson(), new CouponsetsHook(new CallbackReceiver<CouponsetsList>() {
@Override
public void onSuccess(CouponsetsList result) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_couponsets_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
WarplyManagerHelper.setCouponsets(result);
receiver.onSuccess(result);
}
@Override
public void onFailure(int errorCode) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_couponsets_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
},
......@@ -1318,7 +1384,18 @@ public class WarplyManager {
Warply.postReceiveMicroappData(WarpConstants.MICROAPP_COUPONS, true, "context", request.toJson(), new CallbackReceiver<JSONObject>() {
@Override
public void onSuccess(JSONObject result) {
receiver.onSuccess(result);
int status = result.optInt("status");
if (status == 1) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_retrieve_coupon_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(result);
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_retrieve_coupon_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(status);
}
}
@Override
......@@ -1339,8 +1416,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_retrieve_coupon_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
});
}
......@@ -1388,6 +1469,10 @@ public class WarplyManager {
Warply.postReceiveMicroappData(WarpConstants.MICROAPP_NEW_CAMPAIGNS, false, "campaigns", request.toJson(), new NewCampaignsHook(new CallbackReceiver<ArrayList<Campaign>>() {
@Override
public void onSuccess(ArrayList<Campaign> result) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_campaigns_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
getCampaignsPersonalized(request, new CallbackReceiver<ArrayList<Campaign>>() {
@Override
public void onSuccess(ArrayList<Campaign> resultPersonalized) {
......@@ -2030,6 +2115,9 @@ public class WarplyManager {
@Override
public void onFailure(int errorCode) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_campaigns_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
},
......@@ -2044,6 +2132,9 @@ public class WarplyManager {
Warply.postReceiveMicroappData(WarpConstants.MICROAPP_NEW_CAMPAIGNS, true, "campaignsPersonalized", request.toJson(), new NewCampaignsHook(new CallbackReceiver<ArrayList<Campaign>>() {
@Override
public void onSuccess(ArrayList<Campaign> result) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_campaigns_personalized_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(result);
}
......@@ -2065,8 +2156,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_campaigns_personalized_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
},
request.getSignature()));
......@@ -2081,10 +2176,17 @@ public class WarplyManager {
@Override
public void onSuccess(JSONObject result) {
int status = result.optInt("status", 2);
if (status == 1)
if (status == 1) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_customer_state_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(result);
else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_customer_state_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(status);
}
}
@Override
......@@ -2105,8 +2207,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_customer_state_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
});
}
......@@ -2120,10 +2226,17 @@ public class WarplyManager {
@Override
public void onSuccess(JSONObject result) {
int status = result.optInt("status", 2);
if (status == 1 || status == 4 || status == 5 || status == 7)
if (status == 1 || status == 4 || status == 5 || status == 7) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_sharing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(result);
else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_sharing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(status);
}
}
@Override
......@@ -2144,8 +2257,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_sharing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
});
}
......@@ -2159,10 +2276,17 @@ public class WarplyManager {
@Override
public void onSuccess(JSONObject result) {
int status = result.optInt("status", 2);
if (status == 1)
if (status == 1) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_retrieve_sharing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(result);
else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_retrieve_sharing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(status);
}
}
@Override
......@@ -2183,8 +2307,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_retrieve_sharing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
});
}
......@@ -2209,6 +2337,10 @@ public class WarplyManager {
// }
// }
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_pacing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(result);
}
......@@ -2230,8 +2362,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_pacing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
},
request.getSignature()));
......@@ -2246,10 +2382,17 @@ public class WarplyManager {
@Override
public void onSuccess(JSONObject result) {
int status = result.optInt("status", 2);
if (status == 1 || status == 3 || status == 4)
if (status == 1 || status == 3 || status == 4) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_coupon_sharing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(result);
else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_coupon_sharing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(status);
}
}
@Override
......@@ -2270,8 +2413,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_coupon_sharing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
});
}
......@@ -2287,6 +2434,9 @@ public class WarplyManager {
@Override
public void onSuccess(MerchantList result) {
WarplyManagerHelper.setMerchantList(result);
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_shops_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
getCouponsets(new WarplyGetCouponsetsRequest()
.setLanguage(WarplyProperty.getLanguage(Warply.getWarplyContext())), new CallbackReceiver<CouponsetsList>() {
......@@ -2366,7 +2516,9 @@ public class WarplyManager {
@Override
public void onFailure(int errorCode) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_shops_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
}
});
}
......@@ -2474,9 +2626,16 @@ public class WarplyManager {
public void onSuccess(JSONObject result) {
int status = result.optInt("status", 2);
if (status == 1) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_submit_order_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(result);
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_submit_order_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(status);
}
}
@Override
......@@ -2497,8 +2656,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_submit_order_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
});
}
......@@ -2511,6 +2674,9 @@ public class WarplyManager {
Warply.postReceiveMicroappData(WarpConstants.MICROAPP_COUPONS, true, "context", request.toJson(), new SharingHook(new CallbackReceiver<SharingList>() {
@Override
public void onSuccess(SharingList response) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_sharing_history_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(response);
}
......@@ -2532,8 +2698,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_sharing_history_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
},
request.getSignature()));
......@@ -2549,9 +2719,16 @@ public class WarplyManager {
public void onSuccess(JSONObject result) {
int status = result.optInt("status", 2);
if (status == 1) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_post_event_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(result);
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_post_event_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(status);
}
}
@Override
......@@ -2572,8 +2749,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_post_event_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
});
}
......@@ -2588,9 +2769,16 @@ public class WarplyManager {
public void onSuccess(JSONObject result) {
int status = result.optInt("status", 2);
if (status == 1) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_save_pacing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onSuccess(result);
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_save_pacing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(status);
}
}
@Override
......@@ -2611,8 +2799,12 @@ public class WarplyManager {
receiver.onFailure(errorCode);
}
});
} else
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_save_pacing_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(errorCode);
}
}
});
}
......@@ -2628,6 +2820,10 @@ public class WarplyManager {
new CallbackReceiver<JSONObject>() {
@Override
public void onSuccess(JSONObject result) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_read_campaign_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), new CallbackReceiver<ArrayList<Campaign>>() {
@Override
public void onSuccess(ArrayList<Campaign> result) {
......@@ -2644,6 +2840,10 @@ public class WarplyManager {
@Override
public void onFailure(int errorCode) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_read_campaign_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), new CallbackReceiver<ArrayList<Campaign>>() {
@Override
public void onSuccess(ArrayList<Campaign> result) {
......