Ejemplo n.º 1
0
        public SubscriptionResponse Subscribe(string mobileNumber, InputMechanisms inputMechanism, string keyword, string shortCode, int reference)
        {
            SubscriptionResponse response = new SubscriptionResponse
            {
                MobileNumber = mobileNumber,
                Service      = this.service,
                NetworkID    = CUtility.GetNetworkID(mobileNumber)
            };

            if (IsSubscribed(mobileNumber, this.service.ID))
            {
                response.Status = ServiceMessages.AlreadySubscribed;
                return(response);
            }

            response.SubscriptionID = AddSubscription(service.ID, mobileNumber, response.NetworkID, reference, shortCode, keyword);
            SendSubscribeResponse(service, response.SubscriptionID, mobileNumber, reference, CSubscriptionEngineCapsule.RequestResults.Success);

            AddSubscriptionInteraction(response.SubscriptionID, (int)inputMechanism, InteractionTypes.Subscribe);
            AddSubscriptionInteraction(response.SubscriptionID, (int)inputMechanism, InteractionTypes.Confirmation);

            PaymentWrapper.WrapperResponse paymentResponse = null;
            bool result = Execute(service.PaymentSystemClientID, service.ID, response.SubscriptionID, mobileNumber, response.NetworkID, service.BillingAmount, true, reference, out paymentResponse);

            if (!result)
            {
                response.Exception = string.Format("{0}: {1}", paymentResponse.statusDescription, paymentResponse.Exception);
                response.Status    = ServiceMessages.FailedBillings;
                return(response);
            }

            response.Status = ServiceMessages.SubscriptionActivated;

            return(response);
        }
Ejemplo n.º 2
0
        public static void sendSMS(int campaignId, string recipient, string message)
        {
            CQueueWrapper smsSender = new CQueueWrapper("smsSterkinekorQ");
            CSMSCapsule   sms       = new CSMSCapsule(recipient, "", false, CSMSCapsule.MessageTypes.DEFAULT, 1, 5, 7, 5, CUtility.GetNetworkID(recipient), false, CUtility.ToHex(message), false);

            smsSender.Send(sms);
            smsSender = null;
            sms       = null;

            Transaction.InsertSMS(campaignId, recipient, message);
        }
Ejemplo n.º 3
0
        public static void sendSMS(string Msisdn, string message)
        {
            CQueueWrapper smsSender = new CQueueWrapper("CUSTOM_CAMP_BUILDEROUTQ");
            CSMSCapsule   sms       = new CSMSCapsule(Msisdn, "", false, CSMSCapsule.MessageTypes.DEFAULT, 1, 5, 7, 5, CUtility.GetNetworkID(Msisdn), false, CUtility.ToHex(message), false);

            smsSender.Send(sms);
            smsSender = null;
            sms       = null;
        }