Class: Skrill::Payment::Configuration

Inherits:
Object
  • Object
show all
Extended by:
Utils
Defined in:
lib/skrill/payment/configuration.rb

Constant Summary collapse

OPTIONS =
[:merchant_email, :merchant_password, :currency, :subject, :note, :http_proxy]

Class Method Summary collapse

Methods included from Utils

assign_attirbutes, serialize_arguments

Class Method Details

.configure(options = {}, &block) ⇒ Configuration

Sets the Skrill::Payment::Configuration options. Attributes can be passed in by using a block or a Hash. The Skrill API expects the merchant password to be a MD5 hash generated from the password entered in the Skrill developer settings page.

Examples:

Set a configuration option.

Skrill::Payment::Configuration.configure do |config|
  config.merchant_email = '[email protected]'
  config.merchant_password = '7813258ef8c6b632dde8cc80f6bda62f'
end

Returns:

Since:

  • 0.1.0



24
25
26
27
28
29
30
# File 'lib/skrill/payment/configuration.rb', line 24

def configure(options = {}, &block)
  Skrill::Payment::Configuration.tap do |config|
    options.each { |option, value| config.public_send("#{option}=", value) }

    yield(config) if block_given?
  end
end

.serialized_dataHash

Returns all Skrill::Payment::Configuration options in a Hash.

Returns:

  • (Hash)

    The configuration options.

Since:

  • 0.1.0



37
38
39
# File 'lib/skrill/payment/configuration.rb', line 37

def serialized_data
  serialize_arguments(OPTIONS)
end