Manos Chorianopoulos

CouponViewController disable button when pressed once

...@@ -211,10 +211,12 @@ import SwiftEventBus ...@@ -211,10 +211,12 @@ import SwiftEventBus
211 211
212 func redeemCouponSetRequest(uuid: String, communication_uuid: String) { 212 func redeemCouponSetRequest(uuid: String, communication_uuid: String) {
213 showSpinner() 213 showSpinner()
214 + redeemButton.isEnabled = false
214 215
215 if (ccms == nil) { 216 if (ccms == nil) {
216 swiftApi().redeemCouponSetAsync(uuid: uuid, communication_uuid: communication_uuid, redeemCouponSetCallback, failureCallback: {errorCode in 217 swiftApi().redeemCouponSetAsync(uuid: uuid, communication_uuid: communication_uuid, redeemCouponSetCallback, failureCallback: {errorCode in
217 self.hideSpinner() 218 self.hideSpinner()
219 + self.redeemButton.isEnabled = true
218 220
219 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() 221 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
220 firebaseEvent._eventName = "loyalty_offer_activated" 222 firebaseEvent._eventName = "loyalty_offer_activated"
...@@ -229,6 +231,7 @@ import SwiftEventBus ...@@ -229,6 +231,7 @@ import SwiftEventBus
229 // TODO: MAybe change user_msisdn: profile?._msisdn ?? "" 231 // TODO: MAybe change user_msisdn: profile?._msisdn ?? ""
230 swiftApi().redeemCouponSetAsync(uuid: uuid, communication_uuid: communication_uuid, user_msisdn: profile?._msisdn ?? "", businessService: (ccms?._businessService ?? ""), offerName: (ccms?._offerName ?? ""), productType: (ccms?._productType ?? ""), provDuration: (ccms?._provDuration ?? ""), noOfRecurrance: (ccms?._noOfRecurrance ?? ""), price: (ccms?._price ?? ""), discount: (ccms?._discount ?? ""), voiceCategory: (ccms?._voiceCategory ?? ""), dataCategory: (ccms?._dataCategory ?? ""), minsValue: (ccms?._minsValue ?? ""), dataValue: (ccms?._dataValue ?? ""), provStepValueMins: (ccms?._provStepValueMins ?? ""), OfferAudienceLevel: (ccms?._offerAudienceLevel ?? ""), UACIOfferTrackingCode: (ccms?._uaciOfferTrackingCode ?? ""), OFFERCODE1: (ccms?._offerCode1 ?? ""), SCORE: (ccms?._score ?? ""), ZONE: (ccms?._zone ?? ""), WAVE: (ccms?._wave ?? ""), VALIDITY: (ccms?._validity ?? ""), TREATMENT_CODE: (ccms?._treatmentCode ?? ""), ccms_session_id: (ccms?._sessionId ?? ""), redeemCouponSetCallback, failureCallback: {errorCode in 232 swiftApi().redeemCouponSetAsync(uuid: uuid, communication_uuid: communication_uuid, user_msisdn: profile?._msisdn ?? "", businessService: (ccms?._businessService ?? ""), offerName: (ccms?._offerName ?? ""), productType: (ccms?._productType ?? ""), provDuration: (ccms?._provDuration ?? ""), noOfRecurrance: (ccms?._noOfRecurrance ?? ""), price: (ccms?._price ?? ""), discount: (ccms?._discount ?? ""), voiceCategory: (ccms?._voiceCategory ?? ""), dataCategory: (ccms?._dataCategory ?? ""), minsValue: (ccms?._minsValue ?? ""), dataValue: (ccms?._dataValue ?? ""), provStepValueMins: (ccms?._provStepValueMins ?? ""), OfferAudienceLevel: (ccms?._offerAudienceLevel ?? ""), UACIOfferTrackingCode: (ccms?._uaciOfferTrackingCode ?? ""), OFFERCODE1: (ccms?._offerCode1 ?? ""), SCORE: (ccms?._score ?? ""), ZONE: (ccms?._zone ?? ""), WAVE: (ccms?._wave ?? ""), VALIDITY: (ccms?._validity ?? ""), TREATMENT_CODE: (ccms?._treatmentCode ?? ""), ccms_session_id: (ccms?._sessionId ?? ""), redeemCouponSetCallback, failureCallback: {errorCode in
231 self.hideSpinner() 233 self.hideSpinner()
234 + self.redeemButton.isEnabled = true
232 235
233 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() 236 let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
234 firebaseEvent._eventName = "loyalty_offer_activated" 237 firebaseEvent._eventName = "loyalty_offer_activated"
...@@ -244,6 +247,7 @@ import SwiftEventBus ...@@ -244,6 +247,7 @@ import SwiftEventBus
244 247
245 func redeemCouponSetCallback (_ response: swiftApi.GenericResponseModel?) -> Void { 248 func redeemCouponSetCallback (_ response: swiftApi.GenericResponseModel?) -> Void {
246 hideSpinner() 249 hideSpinner()
250 + self.redeemButton.isEnabled = true
247 251
248 if (response != nil) { 252 if (response != nil) {
249 DispatchQueue.main.async { 253 DispatchQueue.main.async {
......