Last active
July 4, 2016 12:32
-
-
Save kubicek/258466ffe239208d8e5422497891fc2e to your computer and use it in GitHub Desktop.
bitcoinpay transaction history import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rest-client' | |
require 'json' | |
data = RestClient::Request.execute( | |
method: :get, | |
url: 'https://www.bitcoinpay.com/api/v1/transaction-history/', | |
headers: {Authorization: 'Token nastoken'} | |
) | |
transactions = JSON.parse(data)['data'] | |
transactions.select{|t| | |
t['status']=="confirmed" && t['currency']=="CZK" && t['confirmations'].to_i > 3 | |
}.each{|t| | |
puts t["payment_id"] # STRING!! | |
puts t["price"] #string | |
puts t["reference"] #string | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
6WksSFBVdZP7sL53
2000.00
9903585