Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Updated README, fix for using without configuration #3

Merged
merged 1 commit into from

2 participants

@johankok

I've updated documentation to use Sisow.configure.

When using the Sisow.setup from the README, the configuration object remains nil. Request#can_perform?does not appreciate that and throws a NoMethodError while evaluating nil.empty?. I've added a fix for that too.

@marceldegraaf marceldegraaf merged commit c61366c into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 10, 2012
  1. @johankok
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +1 −1  README.rdoc
  2. +1 −1  lib/sisow/api/request.rb
View
2  README.rdoc
@@ -23,7 +23,7 @@ And update your bundle with <tt>bundle install</tt>
To be able to use the gem, you must first configure it. If you're on Rails, insert the following code in <tt>config/initializers/sisow.rb</tt>:
- Sisow.setup do |config|
+ Sisow.configure do |config|
config.merchant_key = 'your-merchant-key'
config.merchant_id = 'your-merchant-id'
View
2  lib/sisow/api/request.rb
@@ -38,7 +38,7 @@ def validate!; raise 'Implement me in a subclass'; end
private
def can_perform?
- !Sisow.configuration.merchant_id.empty? && !Sisow.configuration.merchant_key.empty?
+ !(Sisow.configuration.merchant_id.nil? || Sisow.configuration.merchant_id.empty?) && !(Sisow.configuration.merchant_key.nil? || Sisow.configuration.merchant_key.empty?)
end
def uri
Something went wrong with that request. Please try again.