Skip to content

Ruby client for accessing Braintree Payment Solution's reporting API

License

Notifications You must be signed in to change notification settings

jjolma/braintree_query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

braintree_query

Client for accessing Braintree Payment Solution’s reporting API.

To see their API: dev.braintreepaymentsolutions.com/query/

Username and password must be passed in to the finder methods (see examples)

Example usage

# find a specific transaction
txn = BraintreeQuery::Transaction.find(1177101697, :username => 'testapi', :password => 'password1')
txn.condition
#=> 'pendingsettlement'

# find transactions within a time range
txns = BraintreeQuery::Transaction.all(:username => 'testapi',
                                       :password => 'password1',
                                       :start_date => ['2010', '01', '20', '15', '00'].join,
                                       :end_date => ['2010', '01', '20', '15', '18'].join)
txns.size
#=> 3
txns.map(&:condition)
#=> ["pending", "pending", "pendingsettlement"]

# find refunds within a time range
txns = BraintreeQuery::Transaction.all(:username => 'testapi',
                                       :password => 'password1',
                                       :start_date => ['2010', '01', '19', '00'].join,
                                       :end_date => ['2010', '01', '19', '12'].join,
                                       :action_type => 'refund')
txns.map(&:transaction_id)
#=> ["1176565207", "1176565239"]

txns.map(&:original_transaction_id)
#=> ["1176565193", "1176565221"]

TODO

  • rdoc

  • better way to do integration tests (i.e. hitting the real server)

  • add better merchant defined field support

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 Jeff Jolma. See LICENSE for details.

About

Ruby client for accessing Braintree Payment Solution's reporting API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages