Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: 9721988c06
...
compare: 58042fcb5c
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 23 additions and 9 deletions.
  1. +7 −1 README.md
  2. +16 −8 lib/buckaroo-ideal/config.rb
View
8 README.md
@@ -20,7 +20,13 @@ Or install it yourself as:
### Configuration
-TODO: Write configuration instructions here
+You can add code to your initialization process to configure the integration with Buckaroo:
+
+ Buckaroo::Ideal::Config.configure(
+ partner_key: "Your Partner Key",
+ secret_key: "Your Secret Key",
+ test_mode: false # or true during development
+ )
## Usage
View
24 lib/buckaroo-ideal/config.rb
@@ -2,22 +2,30 @@ module Buckaroo
module Ideal
class Config
class << self
+ DEFAULTS = {
+ merchant_key: nil,
+ secret_key: nil,
+ test_mode: false
+ }
+
attr_accessor :merchant_key,
:secret_key,
:test_mode
def configure(settings = {})
- reset
-
- self.merchant_key = settings[:merchant_key]
- self.secret_key = settings[:secret_key]
- self.test_mode = settings[:test_mode]
+ DEFAULTS.merge(settings).each do |key, value|
+ set key, value
+ end
end
def reset
- self.merchant_key = nil
- self.secret_key = nil
- self.test_mode = false
+ configure({})
+ end
+
+ private
+
+ def set(key, value)
+ instance_variable_set(:"@#{key}", value)
end
end
end

No commit comments for this range

Something went wrong with that request. Please try again.