public PaymentService(IOptions <IyzicoSettings> options, ICustomerRepository customerRepository, ICipherService cipherService)
 {
     _iyziOpt            = new Iyzipay.Options();
     _iyziOpt.ApiKey     = options.Value.ApiKey;
     _iyziOpt.BaseUrl    = options.Value.BaseUrl;
     _iyziOpt.SecretKey  = options.Value.SecretKey;
     _customerRepository = customerRepository;
     _cipherService      = cipherService;
 }
        /// <summary>
        /// Get installment
        /// </summary>
        /// <param name="processPaymentRequest">Process Payment Request</param>
        /// <param name="paymentCard">Payment Card</param>
        /// <param name="options">Iyzipay Options</param>
        /// <returns>installment</returns>
        private Installment GetInstallment(ProcessPaymentRequest processPaymentRequest, PaymentCard paymentCard, Iyzipay.Options options)
        {
            int.TryParse((string)processPaymentRequest.CustomValues.GetValueOrDefault(_localizationService.GetResource("Plugins.Payments.Iyzico.Installment")), out int formInstallment);

            var retrieveInstallmentInfoRequest = new RetrieveInstallmentInfoRequest()
            {
                BinNumber      = paymentCard.CardNumber.ToString(),
                Locale         = Locale.TR.ToString(),
                Price          = _priceCalculationService.RoundPrice(processPaymentRequest.OrderTotal).ToString("f8", CultureInfo.InvariantCulture),
                ConversationId = string.Empty
            };
            var installmentInfo = InstallmentInfo.Retrieve(retrieveInstallmentInfoRequest, options);

            var installment = new Installment()
            {
                InstallmentNumber = 1,
                TotalPrice        = _priceCalculationService.RoundPrice(processPaymentRequest.OrderTotal).ToString("f8", CultureInfo.InvariantCulture)
            };

            if (installmentInfo.Status == "success" && installmentInfo.InstallmentDetails.Count > 0)
            {
                var installmentDetail = installmentInfo.InstallmentDetails.FirstOrDefault().InstallmentPrices.FirstOrDefault(x => x.InstallmentNumber == formInstallment);

                installment.InstallmentNumber = installmentDetail.InstallmentNumber ?? 1;
                installment.TotalPrice        = installmentDetail.TotalPrice;
            }

            return(installment);
        }