GNU Taler payment API for Ruby
The Taler library let's you interact with a Taler merchant backend API to take payments.
Installation
gem install taler # or
bundle add talerUsage
require "taler"
backend_url = "https://backend.demo.taler.net/instances/sandbox"
backend_password = "sandbox"
order = Taler::Order.new(backend_url:, password:)
order.create(
amount: "KUDOS:4",
summary: "Order total",
fulfillment_message: "Thank you!"
)
puts "Pay at: #{order.status_url}"
while order.fetch("order_status") == "unpaid"
sleep 1
order.reload
end
if order.fetch("order_status") == "paid"
puts "Great. All paid."
else
puts "Sorry, the order is #{order.fetch("order_status")}. Try again."
endRead more in the official documentation:
Development
After checking out the repo, run bin/setup to install dependencies.
Then, run rake to run the tests.
You can also run bin/console for an interactive prompt.
Release
- Update the version number in
lib/taler/version.rb. - Update the
CHANGELOG.mdfile. - Commit.
- Run
bundle exec rake releaseto build, tag and push the gem.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/openfoodfoundation/taler-ruby.