Showing
1 changed file
with
42 additions
and
1 deletions
... | @@ -1348,7 +1348,48 @@ public class swiftApi { | ... | @@ -1348,7 +1348,48 @@ public class swiftApi { |
1348 | return finalUrl | 1348 | return finalUrl |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | - public func constructCcmsUrl(_ campaign: LoyaltyContextualOfferModel) -> String { | 1351 | + public func constructCcmsUrl(_ sessionId: String, _ campaign: LoyaltyContextualOfferModel) -> String { |
1352 | + for item in GlobalVariables.campaigns { | ||
1353 | + if (item.loyaltyCampaignId == campaign._loyaltyCampaignId) { | ||
1354 | + let instanceOfMyApi = MyApi() | ||
1355 | + let campaignInfo = instanceOfMyApi.provideInfoForCampaign() | ||
1356 | + let finalUrl = (item.index_url ?? "") | ||
1357 | + + "?web_id=" + (campaignInfo?["web_id"] as! String) | ||
1358 | + + "&app_uuid=" + (campaignInfo?["app_uuid"] as! String) | ||
1359 | + + "&api_key=" + (campaignInfo?["api_key"] as! String) | ||
1360 | + + "&session_uuid=" + (item.session_uuid ?? "") | ||
1361 | + + "&access_token=" + (campaignInfo?["access_token"] as! String) | ||
1362 | + + "&refresh_token=" + (campaignInfo?["refresh_token"] as! String) | ||
1363 | + + "&client_id=" + (campaignInfo?["client_id"] as! String) | ||
1364 | + + "&client_secret=" + (campaignInfo?["client_secret"] as! String) | ||
1365 | + + "&Session_ID=" + sessionId // (campaign._sessionId as! String) | ||
1366 | + + "&businessService=" | ||
1367 | + + "&offerName=" + (campaign._offerName as! String) | ||
1368 | + + "&productType=" + (campaign._productType as! String) | ||
1369 | + + "&provDuration=" + (campaign._provDuration as! String) | ||
1370 | + + "&noOfRecurrance="+ (campaign._noOfRecurrance as! String) | ||
1371 | + + "&price=" + (campaign._price as! String) | ||
1372 | + + "&discount=" + (campaign._discount as! String) | ||
1373 | + + "&voiceCategory=" + (campaign._voiceCategory as! String) | ||
1374 | + + "&dataCategory="+ (campaign._dataCategory as! String) | ||
1375 | + + "&minsValue="+ (campaign._minsValue as! String) | ||
1376 | + + "&dataValue="+ (campaign._dataValue as! String) | ||
1377 | + + "&provStepValueMins=" + (campaign._provStepValueMins as! String) | ||
1378 | + + "&UACIOfferTrackingCode=" | ||
1379 | + + "&MSISDN=" | ||
1380 | + + "&OFFERCODE1=" | ||
1381 | + + "&SCORE=" | ||
1382 | + + "&ZONE=" | ||
1383 | + + "&WAVE=" | ||
1384 | + + "&VALIDITY=" | ||
1385 | + + "&TREATMENT_CODE=" | ||
1386 | + + "&GUID=" | ||
1387 | + + "&OfferAudienceLevel="; | ||
1388 | + | ||
1389 | + return finalUrl | ||
1390 | + break; | ||
1391 | + } | ||
1392 | + } | ||
1352 | return "" | 1393 | return "" |
1353 | } | 1394 | } |
1354 | 1395 | ... | ... |
-
Please register or login to post a comment