Exemple #1
0
            public InternalServiceCallVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new InternalServiceCallVo(this));
            }
Exemple #2
0
            public SearchSubProductVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new SearchSubProductVo(this));
            }
            public BuyCreditByAmountVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new BuyCreditByAmountVo(this));
            }
        public SsoService(ClientInfo clientInfo)
        {
            var hasErrorFields = clientInfo.Validate();

            if (hasErrorFields.Any())
            {
                throw PodException.BuildException(new InvalidParameter(hasErrorFields));
            }

            this.clientInfo = clientInfo;
        }
            public LicensePlateReaderVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new LicensePlateReaderVo(this));
            }
            public GetInvoiceListAsFileVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new GetInvoiceListAsFileVo(this));
            }
Exemple #7
0
            public PayInvoiceByWalletVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new PayInvoiceByWalletVo(this));
            }
Exemple #8
0
            public BookingAvailabilityVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new BookingAvailabilityVo(this));
            }
            public AddUserAndBusinessVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new AddUserAndBusinessVo(this));
            }
            public ConfirmEditProfileVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new ConfirmEditProfileVo(this));
            }
            public PushNotificationByAppIdVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new PushNotificationByAppIdVo(this));
            }
Exemple #12
0
            public DealerProductPermissionListVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new DealerProductPermissionListVo(this));
            }
            public DirectionVo Build()
            {
                var hasErrorFields = this.ValidateFieldAndPropertyByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new DirectionVo(this));
            }
            public GetTagTreeCategoryListVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new GetTagTreeCategoryListVo(this));
            }
Exemple #15
0
            public UpdateDirectWithdrawVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new UpdateDirectWithdrawVo(this));
            }
Exemple #16
0
            public RevokeTokenVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new RevokeTokenVo(this));
            }
            public AddAutoSettlementVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new AddAutoSettlementVo(this));
            }
Exemple #18
0
            public DeactivateVoucherVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new DeactivateVoucherVo(this));
            }
Exemple #19
0
            public VerifyAndCloseInvoiceVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new VerifyAndCloseInvoiceVo(this));
            }
Exemple #20
0
            public SendInvoicePaymentSmsVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new SendInvoicePaymentSmsVo(this));
            }
            public SubscriptionPlanListVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new SubscriptionPlanListVo(this));
            }
        /// <summary>
        /// برای نمایش فاکتور به کاربر باید او را به آدرس موجود در خروجی هدایت نمایید
        /// </summary>
        public LinkSrv GetLink(ResultSrv <ServiceCallResultSrv <PrivateCallSrv> > output)
        {
            var hashCode = ((PrivateCallSrv)output.Result.Result).Result;

            if (string.IsNullOrEmpty(hashCode))
            {
                throw PodException.BuildException(new InvalidParameter(new KeyValuePair <string, string>("HashCode", "The field is required.")));
            }
            return(new LinkSrv {
                HashCode = hashCode, RedirectUrl = $"{BaseUrl.PrivateCallAddress}/v1/pbc/preinvoice/{hashCode}"
            });
        }
            public GetShebaByCardNumberVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                var dataToSign = "{" + $"\"UserName\":\"{userName}\",\"CardNumber\":\"{cardNumber}\",\"Timestamp\":\"{timestamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:fff")}\"" + "}";

                signature = dataToSign.GetBankingSignature(privateKey, HashAlgorithmName.SHA1);

                return(new GetShebaByCardNumberVo(this));
            }
        public static void GetResult(IRestResponse restResponse, out string output)
        {
            if (restResponse.IsSuccessful)
            {
                output = $"-- {(int)restResponse.StatusCode}-The operation was successful";
            }
            else
            {
                if (restResponse.ErrorException != null)
                {
                    OnFailure(restResponse);
                }

                throw PodException.BuildException(new DeveloperException((int)restResponse.StatusCode, restResponse.Content));
            }
        }
        public static void GetResult <T>(IRestResponse <T> restResponse, out T output)
        {
            if (restResponse.IsSuccessful)
            {
                output = restResponse.Data;
            }
            else
            {
                if (restResponse.ErrorException != null)
                {
                    OnFailure(restResponse);
                }

                throw PodException.BuildException(new DeveloperException((int)restResponse.StatusCode, restResponse.Content));
            }
        }
            public GetTransferStateVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                string dataToSign = "{" + $"\"UserName\":\"{userName}\",\"Date\":\"{date}\",\"PaymentId\":\"{paymentId}\"" +
                                    $",\"Timestamp\":\"{timestamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:fff")}\"" + "}";

                signature = dataToSign.GetBankingSignature(privateKey, HashAlgorithmName.SHA1);

                return(new GetTransferStateVo(this));
            }
Exemple #27
0
            public SingleProductVo Build()
            {
                var hasErrorFields = this.ValidateFieldAndPropertyByAttribute();
                var attCodeError   = ValidateAttributeTempCode(attTemplateCode);

                if (attCodeError.Key != null)
                {
                    hasErrorFields.Add(attCodeError);
                }

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new SingleProductVo(this));
            }
            public DefineCreditVoucherVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();
                var hashCodeError  = VoucherContentVo.ValidateHashCodeCount(vouchersContent);

                if (hashCodeError.Key != null)
                {
                    hasErrorFields.Add(hashCodeError);
                }

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                return(new DefineCreditVoucherVo(this));
            }
        public static void GetResult <T>(IRestResponse <ResultSrv <T> > restResponse, out ResultSrv <T> output)
        {
            output = new ResultSrv <T>();
            if (restResponse.IsSuccessful)
            {
                var resultSrv = restResponse.Data;
                if (resultSrv.HasError)
                {
                    throw PodException.BuildException(new DeveloperException(resultSrv.ErrorCode, resultSrv.Message, resultSrv));
                }

                output = resultSrv;
            }
            else
            {
                OnFailure(restResponse);
            }
        }
Exemple #30
0
            public PayaServiceVo Build()
            {
                var hasErrorFields = this.ValidateByAttribute();

                if (hasErrorFields.Any())
                {
                    throw PodException.BuildException(new InvalidParameter(hasErrorFields));
                }

                var dataToSign = "{" +
                                 $"\"UserName\":\"{userName}\",\"SourceDepositNumber\":\"{sourceDepositNumber}\",\"FileUniqueIdentifier\":\"{fileUniqueIdentifier}\"" +
                                 $",\"TransferMoneyBillNumber\":\"{transferMoneyBillNumber}\",\"BatchPayaItemInfos\":{batchPayaItemInfosJson}" +
                                 $",\"Timestamp\":\"{timestamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:fff")}\"" +
                                 "}";

                signature = dataToSign.GetBankingSignature(privateKey, HashAlgorithmName.SHA1);

                return(new PayaServiceVo(this));
            }