conekta / conekta-ruby

Ruby Bindings for Conekta
https://www.conekta.com
MIT License
31 stars 28 forks source link

payment sources are filtered from API #78

Closed nicklloyd closed 7 years ago

nicklloyd commented 7 years ago

Using count -1 is not reliable as the payment sources returned by the API are filtered, but maintain their original index.

Also ensures that @values is initialised if it doesn't exist.

context:

we've discovered the issue is related to users who've added 6 or more payment sources.

I've submitted a PR for the new release that prevents the error: #78

That said, be aware that the API only returns 5 payment sources. In the raw response there is a has_more attribute and a link to the next_page_url, but the gem does not seem make use of it...

resource : https://github.com/conekta/conekta-ruby/issues/68