lib/przelewy24_payment.rb in przelewy24_payment-0.1.2 vs lib/przelewy24_payment.rb in przelewy24_payment-0.1.3
- old
+ new
@@ -3,11 +3,11 @@
require "przelewy24_payment/przelewy24_payment_controller"
module Przelewy24Payment
mattr_accessor :seller_id
- @@seller_id = '17329'
+ @@seller_id = ''
mattr_accessor :language
@@language = 'pl'
mattr_accessor :mode
@@ -20,10 +20,13 @@
@@comeback_url = ''
mattr_accessor :crc_key
@@crc_key = ''
+ mattr_accessor :hostname
+ @@hostname = { :development => "http://localhost:3000" }
+
def self.setup
yield self
end
def self.complete_url(params)
@@ -55,8 +58,20 @@
end
def self.calculate_crc(value,session_id, crc_key=nil)
calc_md5 = Digest::MD5.hexdigest(session_id.to_s + "|" + (seller_id).to_s + "|" + (p24_price(value)).to_s + "|" + (crc_key.nil? ? "" : crc_key.to_s))
return calc_md5
+ end
+
+ def self.get_hostname
+ @@hostname[@@mode]
+ end
+
+ def self.get_comeback_url
+ get_hostname + @@comeback_url
+ end
+
+ def self.get_error_url
+ get_hostname + @@error_url
end
end