Class: Vnpay::Url

Inherits:
Object
  • Object
show all
Defined in:
lib/vnpay/url.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order_info, ip_address, callback) ⇒ Url

Returns a new instance of Url.



5
6
7
8
9
# File 'lib/vnpay/url.rb', line 5

def initialize(order_info, ip_address, callback)
  @order_info = order_info
  @ip_address = ip_address
  @callback_url = callback_url
end

Instance Attribute Details

#callback_urlObject

Returns the value of attribute callback_url.



3
4
5
# File 'lib/vnpay/url.rb', line 3

def callback_url
  @callback_url
end

#ip_addressObject

Returns the value of attribute ip_address.



3
4
5
# File 'lib/vnpay/url.rb', line 3

def ip_address
  @ip_address
end

#order_infoObject

Returns the value of attribute order_info.



3
4
5
# File 'lib/vnpay/url.rb', line 3

def order_info
  @order_info
end

Instance Method Details

#generateObject



11
12
13
14
# File 'lib/vnpay/url.rb', line 11

def generate
  raise "OrderInfo missing attributes" unless order_info.valid?
  config.payment_url + query_string + "&vnp_SecureHashType=MD5&vnp_SecureHash=#{secure_hash}"
end