Class: KhipuRails::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/khipu_rails/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#button_defaultsObject

Returns the value of attribute button_defaults

Returns:

  • (Object)

    the current value of button_defaults



2
3
4
# File 'lib/khipu_rails/config.rb', line 2

def button_defaults
  @button_defaults
end

#button_imagesObject

Returns the value of attribute button_images

Returns:

  • (Object)

    the current value of button_images



2
3
4
# File 'lib/khipu_rails/config.rb', line 2

def button_images
  @button_images
end

#receiversObject

Returns the value of attribute receivers

Returns:

  • (Object)

    the current value of receivers



2
3
4
# File 'lib/khipu_rails/config.rb', line 2

def receivers
  @receivers
end

Class Method Details

.defaultObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/khipu_rails/config.rb', line 4

def self.default
  config = new

  config.receivers = []

  config.button_images = {
    "50x25"    => "https://s3.amazonaws.com/static.khipu.com/buttons/50x25.png",
    "100x25"   => "https://s3.amazonaws.com/static.khipu.com/buttons/100x25.png",
    "100x50"   => "https://s3.amazonaws.com/static.khipu.com/buttons/100x50.png",
    "150x25"   => "https://s3.amazonaws.com/static.khipu.com/buttons/150x25.png",
    "150x50"   => "https://s3.amazonaws.com/static.khipu.com/buttons/150x50.png",
    "150x75"   => "https://s3.amazonaws.com/static.khipu.com/buttons/150x75.png",
    "150x75-B" => "https://s3.amazonaws.com/static.khipu.com/buttons/150x75-B.png",
    "200x50"   => "https://s3.amazonaws.com/static.khipu.com/buttons/200x50.png",
    "200x75"   => "https://s3.amazonaws.com/static.khipu.com/buttons/200x75.png"
  }

  config.button_defaults = {
    subject:        '',
    amount:          1,
    body:           '',
    return_url:     '',
    cancel_url:     '',
    transaction_id: '',
    payer_email:    '',
    picture_url:    '',
    custom:         '',
    button_image:   '50x25'
  }

  config
end

Instance Method Details

#add_receiver(id, key, mode = :prod) ⇒ Object



37
38
39
# File 'lib/khipu_rails/config.rb', line 37

def add_receiver id, key, mode = :prod
  self.receivers << KhipuRails::Receiver.new(id, key, mode)
end