Class: Payu::Configuration
- Inherits:
-
Object
- Object
- Payu::Configuration
- Defined in:
- lib/payu/configuration.rb
Constant Summary collapse
- PAYMENT_URL =
Production endpoints (docs.payu.in, confirmed May 2026)
"https://secure.payu.in/_payment"- API_URL =
"https://secure.payu.in/merchant/postservice?form=2"- TEST_PAYMENT_URL =
Sandbox endpoints
"https://test.payu.in/_payment"- TEST_API_URL =
"https://test.payu.in/merchant/postservice?form=2"
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#salt ⇒ Object
Returns the value of attribute salt.
-
#test_mode ⇒ Object
Returns the value of attribute test_mode.
Instance Method Summary collapse
- #api_url ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #payment_url ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 |
# File 'lib/payu/configuration.rb', line 13 def initialize @test_mode = false end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/payu/configuration.rb', line 3 def key @key end |
#salt ⇒ Object
Returns the value of attribute salt.
3 4 5 |
# File 'lib/payu/configuration.rb', line 3 def salt @salt end |
#test_mode ⇒ Object
Returns the value of attribute test_mode.
3 4 5 |
# File 'lib/payu/configuration.rb', line 3 def test_mode @test_mode end |
Instance Method Details
#api_url ⇒ Object
18 |
# File 'lib/payu/configuration.rb', line 18 def api_url = test_mode ? TEST_API_URL : API_URL |
#payment_url ⇒ Object
17 |
# File 'lib/payu/configuration.rb', line 17 def payment_url = test_mode ? TEST_PAYMENT_URL : PAYMENT_URL |
#validate! ⇒ Object
20 21 22 23 |
# File 'lib/payu/configuration.rb', line 20 def validate! raise ConfigurationError, "Payu key is required" if key.nil? || key.empty? raise ConfigurationError, "Payu salt is required" if salt.nil? || salt.empty? end |