Manos Chorianopoulos

fix constructCcmsUrl

......@@ -1348,7 +1348,48 @@ public class swiftApi {
return finalUrl
}
public func constructCcmsUrl(_ campaign: LoyaltyContextualOfferModel) -> String {
public func constructCcmsUrl(_ sessionId: String, _ campaign: LoyaltyContextualOfferModel) -> String {
for item in GlobalVariables.campaigns {
if (item.loyaltyCampaignId == campaign._loyaltyCampaignId) {
let instanceOfMyApi = MyApi()
let campaignInfo = instanceOfMyApi.provideInfoForCampaign()
let finalUrl = (item.index_url ?? "")
+ "?web_id=" + (campaignInfo?["web_id"] as! String)
+ "&app_uuid=" + (campaignInfo?["app_uuid"] as! String)
+ "&api_key=" + (campaignInfo?["api_key"] as! String)
+ "&session_uuid=" + (item.session_uuid ?? "")
+ "&access_token=" + (campaignInfo?["access_token"] as! String)
+ "&refresh_token=" + (campaignInfo?["refresh_token"] as! String)
+ "&client_id=" + (campaignInfo?["client_id"] as! String)
+ "&client_secret=" + (campaignInfo?["client_secret"] as! String)
+ "&Session_ID=" + sessionId // (campaign._sessionId as! String)
+ "&businessService="
+ "&offerName=" + (campaign._offerName as! String)
+ "&productType=" + (campaign._productType as! String)
+ "&provDuration=" + (campaign._provDuration as! String)
+ "&noOfRecurrance="+ (campaign._noOfRecurrance as! String)
+ "&price=" + (campaign._price as! String)
+ "&discount=" + (campaign._discount as! String)
+ "&voiceCategory=" + (campaign._voiceCategory as! String)
+ "&dataCategory="+ (campaign._dataCategory as! String)
+ "&minsValue="+ (campaign._minsValue as! String)
+ "&dataValue="+ (campaign._dataValue as! String)
+ "&provStepValueMins=" + (campaign._provStepValueMins as! String)
+ "&UACIOfferTrackingCode="
+ "&MSISDN="
+ "&OFFERCODE1="
+ "&SCORE="
+ "&ZONE="
+ "&WAVE="
+ "&VALIDITY="
+ "&TREATMENT_CODE="
+ "&GUID="
+ "&OfferAudienceLevel=";
return finalUrl
break;
}
}
return ""
}
......