Class: Vnpay::Url
- Inherits:
-
Object
- Object
- Vnpay::Url
- Defined in:
- lib/vnpay/url.rb
Instance Attribute Summary collapse
-
#callback_url ⇒ Object
Returns the value of attribute callback_url.
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#order_info ⇒ Object
Returns the value of attribute order_info.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(order_info, ip_address, callback) ⇒ Url
constructor
A new instance of Url.
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_url ⇒ Object
Returns the value of attribute callback_url.
3 4 5 |
# File 'lib/vnpay/url.rb', line 3 def callback_url @callback_url end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
3 4 5 |
# File 'lib/vnpay/url.rb', line 3 def ip_address @ip_address end |
#order_info ⇒ Object
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
#generate ⇒ Object
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 |