Giter Site home page Giter Site logo

chargify2's People

Contributors

drewblas avatar jeremywrowe avatar joshnabbott avatar moklett avatar ryansch avatar shayfrendt avatar warmwaffles avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chargify2's Issues

Incorrect signature

I have the following in my haml Rails view:

= chargify.direct.secure_parameters(data: {redirect_uri: 'http://requestb.in/14d7g2l1'}).to_form_inputs.html_safe

I have verified my api keys and the hidden input fields. I receive a message saying incorrect signature, which makes sense because when I copy and paste my secure data and api key directly from the hidden input values, into https://chargify-direct-signature.herokuapp.com, I get a different signature.

How do I make this gem generate the proper signature? Is this gem outdated?

Rails class caching causes uninitialized constant Chargify2::Client

Any time you require 'chargify2' in a rails environment with config.cache_classes = true, the chargify2 gem will throw the following error:

/var/www/apps/sample_app/shared/bundle/ruby/1.9.1/gems/chargify2-0.2.0/lib/chargify2/resource.rb:10:in `<class:Resource>': uninitialized constant Chargify2::Client (NameError)
from /var/www/apps/sample_app/shared/bundle/ruby/1.9.1/gems/chargify2-0.2.0/lib/chargify2/resource.rb:7:in `<module:Chargify2>'
from /var/www/apps/sample_app/shared/bundle/ruby/1.9.1/gems/chargify2-0.2.0/lib/chargify2/resource.rb:1:in `<top (required)>'
from /var/www/apps/sample_app/shared/bundle/ruby/1.9.1/gems/chargify2-0.2.0/lib/chargify2.rb:6:in `block in <top (required)>'
from /var/www/apps/sample_app/shared/bundle/ruby/1.9.1/gems/chargify2-0.2.0/lib/chargify2.rb:6:in `each'
from /var/www/apps/sample_app/shared/bundle/ruby/1.9.1/gems/chargify2-0.2.0/lib/chargify2.rb:6:in `<top (required)>'

In the chargify2.rb file, the following line is requiring each of the files in the gem:

https://github.com/chargify/chargify2/blob/d45dc91ebda58b2e86f0d5ed218767d356a1e9d6/lib/chargify2.rb#L6

If the load order for these files is wrong, it will throw the "uninitialized constant Chargify2::Client" error from the following line:

https://github.com/chargify/chargify2/blob/3b49c01b129b9adc797ba402a42e5de298d0b2ea/lib/chargify2/resource.rb#L10

I'll try to get a failing test going, and probably will list out an explicit load order in chargify2.rb like:

require 'chargify2/utils'
require 'chargify2/client'
require 'chargify2/resource'

This should prevent load order problems when the gem is required.

Chargify::Call#successful? broken

It returns false all the time.

c.successful? #=> false
c.response['result']['status_code'] #=> '200'

Why not use c.success attribute instead ?

Bump Hashery Version

Can we see an update to the Hashery version you are using here? It's breaking my RestClient library.

Chargify2::Call isn't responding to methods

Hi,
Simple example:

chargify2 = Chargify2::Client.new(:api_id => ENV['CHARGIFY_DIRECT_API_ID'], :api_secret => ENV['CHARGIFY_DIRECT_API_SECRET'], :api_password => ENV['CHARGIFY_DIRECT_PASSWORD'], :base_uri => "https://api.chargify.com/api/v2/") 
call = chargify2.calls.read('xxxxxxx')
call.request.signup
=> {}
call.request['signup']
=> {"product"=>{"handle"=>"pro"}, "coupon_code"=>"", "customer"=>{"first_name"=>"Zain", "last_name"=>"Zafar", "email"=>"******@gmail.com"}, "payment_profile"=>{"first_name"=>"", "last_name"=>"", "card_number"=>nil, "expiration_month"=>"", "expiration_year"=>""}} 

This doesn't stop here, all the hash keys aren't symbolized either. Need to manually use .symbolize_keys for it to work.

Status code not set in response

In case of 404 status_code is not getting set in response. Im are using api_v2 branch.

chargify = Chargify2::Client.new(api_id: <masked>, api_password: <masked>, base_uri: 'https://api.chargify.com/api/v2')
chargify.customers.read(1)

<Chargify2::Response:0x007f8c1d878ec0 @resource=#<Chargify2::Customer>, @meta=#<Hashie::Mash errors=[#<Hashie::Mash attribute=nil kind="not_found" message="The requested Customer could not be found.">]>, @status_code=nil, @errors=[#<Hashie::Mash attribute=nil kind="not_found" message="The requested Customer could not be found.">]>

When I tried to hit the api directly, i could see status_code being sent in the chargify api response. So guessing the issue to be in the gem.

curl -v -u  <api_id>:x -H Accept:application/json -H Content-Type:application/json https://mavenhive-ghuk.chargify.com/customers/1
* Hostname was NOT found in DNS cache
*   Trying 54.244.7.151...
* Connected to mavenhive-ghuk.chargify.com (54.244.7.151) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* Server certificate: *.chargify.com
* Server certificate: COMODO RSA Organization Validation Secure Server CA
* Server certificate: COMODO RSA Certification Authority
* Server certificate: AddTrust External CA Root
* Server auth using Basic with user 'dvLih3EFHkpluaBrGP7A'
> GET /customers/1 HTTP/1.1
> Authorization: Basic ZHZMaWgzRUZIa3BsdWFCckdQN0E6eA==
> User-Agent: curl/7.37.1
> Host: mavenhive-ghuk.chargify.com
> Accept:application/json
> Content-Type:application/json
>
< HTTP/1.1 404 Not Found
< Cache-Control: no-cache, private
< Content-Type: application/json; charset=utf-8
< Date: Wed, 04 Mar 2015 11:27:09 GMT
< P3p: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
* Server nginx + Phusion Passenger is not blacklisted
< Server: nginx + Phusion Passenger
< Set-Cookie: _chargify_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFVEkiJTRlMjNlMGVjZGYzOWRkZDAyYmVlZDViOGJmNGM2MzhjBjsAVEkiF3NlbGxlcl9jcmVkZW50aWFscwY7AEZJIgGAZTJlYjBjOTViOWRkZWY2NWYwYTNlZDk4NDYwYmNjN2FlYzFmNzJmNjgxNWRmOWYyMTI4MGJjODgzMmY2NzIyNTczMzlhMjA2NzI5YjU4Y2RiM2RlOWY3YjJhN2YwZTIwMDQ2NzE5YmY0YTM5M2IxYjVlMmY0MzY4MTE0YjU2YzAGOwBGSSIac2VsbGVyX2NyZWRlbnRpYWxzX2lkBjsARmkCsjw%3D--b0cc8c93ff92f3de8d3abf63671acb887fa8b82b; domain=.chargify.com; path=/; secure; HttpOnly
< Status: 404 Not Found
< X-Frame-Options: SAMEORIGIN
< X-Powered-By: Phusion Passenger
< X-Rack-Cache: miss
< X-Ratelimit-Limit: 1000000
< X-Ratelimit-Remaining: 999982
< X-Ratelimit-Reset: 1425513600
< X-Request-Id: f2ab412e-9ab7-464a-88df-695e555b852a
< X-Runtime: 0.029060
< X-Ua-Compatible: IE=Edge,chrome=1
< Content-Length: 1
< Connection: keep-alive
<
* Connection #0 to host mavenhive-ghuk.chargify.com left intact

`chargify/chargify_direct_example` won't show errors. (tl;dr Do a bundle update)

I'm working on a new app using the direct API and all of the response methods are blank. I was able to trace it back to the method call on recursive_symbolize_keys which does not seem to exist.

There's no error shown for this because we're using the magic method_missing crap, so this was a huge pain in the butt to trace.

Without this, it means that chargify/chargify_direct_example is also broken. Please correct me if I'm wrong.

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.