Giter Club home page Giter Club logo

iyzipay-ruby's People

Contributors

brkkyk avatar caglarp avatar can3ry avatar iyzico-ci avatar kadriyedogan avatar ktoprakucar avatar kurtulussahin avatar nurettinbakkal avatar ramazanyetis avatar sotuzun avatar yyenigun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iyzipay-ruby's Issues

Convert price to string in format_price

To avoid NoMethodError (undefined method 'include?' for 3350.0:Float).

The documentation declares both price and paidPrice as Decimals. However, when passing Float to the gem, it raises NoMethodError. format_price method in pki_builder.rb should convert floats to strings before performing include? check.

Drop support for Ruby 2.1

Ruby 2.1 and 2.2 are no longer maintained and they don't receive security updates. We should consider dropping older versions. This will allow us to use newer dependencies (#33, #34) and focus on other features.

Maintenance

Is this gem maintained? If not, I could help, there're some issues and pull requests that need to be resolved.

Use global configuration

Right now options have to be passed in every request in the app. With global configuration we can set options only once. Configurable may be used for this.

Rails6 Incompability for 1.0.45

Rails: 6.0.2.1
Ruby: 2.7.0p0 (2019-12-25 revision 647ee6f091)
Bundler: 2.1.4

Release 1.0.45 seems to fail when installing with bundler in Rails6.

I have created a brand new Rails6 project and added iyzipay to the gemfile.
When I run bundle, bundler installs version 1.0.44 of the gem,
which depends on rest-client ~> 1.8, which is not working properly as tests shows that:

...
KeyError:
      key not found: :ciphers
      # /Users/furkanenes/.rvm/gems/ruby-2.7.0/gems/rest-client-1.8.0/lib/restclient/request.rb:163:in `fetch'
      # /Users/furkanenes/.rvm/gems/ruby-2.7.0/gems/rest-client-1.8.0/lib/restclient/request.rb:163:in `initialize'
      # /Users/furkanenes/.rvm/gems/ruby-2.7.0/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `new'
      # /Users/furkanenes/.rvm/gems/ruby-2.7.0/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'
      # /Users/furkanenes/.rvm/gems/ruby-2.7.0/gems/rest-client-1.8.0/lib/restclient.rb:69:in `post'
      # ./lib/iyzipay/http_client.rb:8:in `post'
      # ./lib/iyzipay/model/threeds_payment.rb:12:in `retrieve'
      # ./spec/threeds_payment_spec.rb:218:in `block (2 levels) in <top (required)>'
...
# Same error occurs in all 39 tests

I believe this is a rest-client related problem due to this issue.

The solution is simply updating rest-client to ~> 2.0, which is already done in iyzipay 1.0.45.
But the problem is that when you force bundler to install iyzipay 1.0.45 in your gemfile, like:

gem 'iyzipay', '~> 1.0.45'
# or
gem 'iyzipay', '1.0.45'

Following output occurs when you run bundle:

Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "rack":
  In snapshot (Gemfile.lock):
    rack (= 2.2.2)

  In Gemfile:
    rails (~> 6.0.2, >= 6.0.2.1) was resolved to 6.0.2.1, which depends on
      actionpack (= 6.0.2.1) was resolved to 6.0.2.1, which depends on
        rack (~> 2.0, >= 2.0.8)

    iyzipay (~> 1.0.45) was resolved to 1.0.45, which depends on
      rack (~> 1.6.4)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

I think the problem is that rack dependency of rails6 (actionpack 6) fails to comply with iyzipay rack dependency, which is 1.6.4.

I have forked the repository and updated rack dependency to 2.0, which forced me to update rspec and rspec-rails dependencies to 3.8.0.

Currenty the tests and my rails6 project are working perfectly well but further testing is required in order to maintain backwards compability of the gem.

I'll generate a PR and hope that this simple solution works for everybody.

Drop rest-client

rest-client hasn't been updated for a while. rest-client itself locks the major version of mime-types and http-cookie, this may cause conflicts when using the gem in apps with newer versions of those gems.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.