examples/5-payments-history.rb in mollie-api-ruby-1.4.2 vs examples/5-payments-history.rb in mollie-api-ruby-2.0.0
- old
+ new
@@ -1,24 +1,24 @@
#
# Example 5 - How to retrieve your payments history.
#
-require File.expand_path "../lib/Mollie/API/Client", File.dirname(__FILE__)
+require File.expand_path "../lib/mollie/api/client", File.dirname(__FILE__)
begin
#
# Initialize the Mollie API library with your API key.
#
# See: https://www.mollie.nl/beheer/account/profielen/
#
mollie = Mollie::API::Client.new
- mollie.setApiKey "test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"
+ mollie.api_key = "test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"
#
# Get the all payments for this API key ordered by newest.
#
payments = mollie.payments.all
- $response.body = "Your API key has #{payments.totalCount} payments, last #{payments.count}:<br>"
+ $response.body = "Your API key has #{payments.total_count} payments, last #{payments.count}:<br>"
payments.each { |payment|
$response.body << "€ #{payment.amount}, status: #{CGI.escapeHTML payment.status} (#{CGI.escapeHTML payment.id})<br>"
}
rescue Mollie::API::Exception => e