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,15 +504,24 @@ 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
public void onFailure(int errorCode) {
......@@ -516,9 +541,14 @@ 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,9 +970,13 @@ 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) {
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,9 +1416,13 @@ 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,9 +2156,13 @@ 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,11 +2176,18 @@ 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
public void onFailure(int errorCode) {
......@@ -2105,9 +2207,13 @@ 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,11 +2226,18 @@ 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
public void onFailure(int errorCode) {
......@@ -2144,9 +2257,13 @@ 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,11 +2276,18 @@ 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
public void onFailure(int errorCode) {
......@@ -2183,9 +2307,13 @@ 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,9 +2362,13 @@ 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,11 +2382,18 @@ 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
public void onFailure(int errorCode) {
......@@ -2270,9 +2413,13 @@ 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,10 +2626,17 @@ 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
public void onFailure(int errorCode) {
......@@ -2497,9 +2656,13 @@ 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,9 +2698,13 @@ 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,10 +2719,17 @@ 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
public void onFailure(int errorCode) {
......@@ -2572,9 +2749,13 @@ 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,10 +2769,17 @@ 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
public void onFailure(int errorCode) {
......@@ -2611,9 +2799,13 @@ 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) {
......