Exemplo n.º 1
0
        public void RegisterOptin(JObject data)
        {
            Exception innerEx = null;

            try
            {
                RegisterSubscriptionNotification(data);

                if (subscription_operation_status.ToUpper() == "SUBSCRIBED")
                {
                    DataSet dsData = get_subscription_data();

                    if (dsData.Tables[0].Rows.Count == 0)
                    {
                        ErrorAssignation(ERROR_CODE.Mobiera_OperatorProduct_Not_Registered,
                                         "Mobiera Operator_product not registered",
                                         string.Format("WRONG INFORMATION [operator_product_id={0}]",
                                                       JsonUtil.AsInteger(data, "subscriptionId")), data.ToString());

                        throw new Exception();
                    }

                    else
                    {
                        package_id = DataUtil.AsInteger(dsData.Tables[0].Rows[0], "package_id", false);


                        if (dsData.Tables[1].Rows.Count == 0)
                        {
                            RegisterSuscription();
                        }
                    }
                }

                else
                {
                    UpdateSubscription();
                }
            }
            catch (Exception ex)
            {
                innerEx = ex;

                if (errorCode == ERROR_CODE.OK)
                {
                    //ErrorAssignation(ERROR_CODE.GENR_Unidentified, ex.Message, ex.StackTrace, data.ToString());
                    ErrorAssignation(ERROR_CODE.Mobiera_NoDataInTable, " Faltan datos en la tabla  ", ex.StackTrace, data.ToString());
                }
            }
            finally
            {
                if (errorCode != ERROR_CODE.OK)
                {
                    Insert_Error_log();
                }
            }
        }
Exemplo n.º 2
0
        public void RegisterPayment(JObject data)
        {
            Exception innerEx = null;

            try
            {
                RegisterNotification(data);

                DataSet dsData1 = get_price_data();
                service_id    = DataUtil.AsInteger(dsData1.Tables[0].Rows[0], "service_id", false);
                subservice_id = DataUtil.AsInteger(dsData1.Tables[0].Rows[0], "subservice_id", false);

                DataSet dsDispatch = get_dispatch_data();

                created_on            = DataUtil.AsDateTime(dsDispatch.Tables[0].Rows[0], "created_on");
                short_number          = DataUtil.AsString(dsDispatch.Tables[0].Rows[0], "short_number");
                msg_content_id        = DataUtil.AsInteger(dsDispatch.Tables[0].Rows[0], "msg_content_id", false);
                msg_text              = DataUtil.AsString(dsDispatch.Tables[0].Rows[0], "msg_text");
                package_id            = DataUtil.AsInteger(dsDispatch.Tables[0].Rows[0], "package_id", false);
                suscription_id        = DataUtil.AsInteger64(dsDispatch.Tables[0].Rows[0], "suscription_id", false);
                operator_service_id   = DataUtil.AsInteger(dsDispatch.Tables[0].Rows[0], "operator_service_id", false);
                service_identifier_id = DataUtil.AsInteger(dsDispatch.Tables[0].Rows[0], "service_identifier_id", false);

                Int16 status = -1;
                Registerdebit(data);
                PriorityTime();
                RegisterMobiera_Dispatch(data, short_number);
                RegisterMobiera_Out(status, plannedOn);
            }
            catch (Exception ex)
            {
                innerEx = ex;

                if (errorCode == ERROR_CODE.OK)
                {
                    //ErrorAssignation(ERROR_CODE.GENR_Unidentified, ex.Message, ex.StackTrace, data.ToString());
                    ErrorAssignation(ERROR_CODE.Mobiera_NoSubscription, " No se ha registrado suscripción para el payment  ", ex.StackTrace, data.ToString());
                }
            }
            finally
            {
                if (errorCode != ERROR_CODE.OK)
                {
                    Insert_Error_log();
                }
            }
        }