class Przelewy24::Configuration
Attributes
confirm_transaction_params[RW]
confirm_transaction_url[R]
crc[RW]
merchant_id[RW]
register_transaction_params[RW]
register_url[R]
request_url[R]
test_connection_params[RW]
test_url[R]
url_return[RW]
url_status[RW]
Public Class Methods
new()
click to toggle source
# File lib/przelewy24/configuration.rb, line 9 def initialize @merchant_id = nil @crc = nil namespace = Rails.env=='production' ? 'secure' : 'sandbox' @test_url = "https://#{namespace}.przelewy24.pl/testConnection" @register_url = "https://#{namespace}.przelewy24.pl/trnRegister" @request_url = "https://#{namespace}.przelewy24.pl/trnRequest/" @confirm_transaction_url = "https://#{namespace}.przelewy24.pl/trnVerify" @url_return = nil @url_status = nil @test_connection_params = hash_of %w(merchant_id pos_id sign) @register_transaction_params = hash_of %w(session_id merchant_id pos_id amount currency description email country url_return url_status api_version sign) @confirm_transaction_params = hash_of %w(merchant_id pos_id session_id amount currency order_id sign) @api_version = '3.2' end
Public Instance Methods
default_transaction_options()
click to toggle source
# File lib/przelewy24/configuration.rb, line 25 def default_transaction_options out = {} self.instance_values.each do |o,v| out[o.to_sym] = v end out end
Private Instance Methods
hash_of(params)
click to toggle source
# File lib/przelewy24/configuration.rb, line 35 def hash_of(params) new_hash = Hash.new params.each do |k| new_hash[('p24_'+k).to_sym] = nil end new_hash end