Class: Payanyway::Request::Pay
- Defined in:
- lib/payanyway/request/pay.rb
Constant Summary collapse
- @@_params =
{ 'MNT_ID' => :moneta_id, 'MNT_TRANSACTION_ID' => :transaction_id, 'MNT_OPERATION_ID' => :operation_id, 'MNT_AMOUNT' => :amount, 'MNT_CURRENCY_CODE' => :currency, 'MNT_SUBSCRIBER_ID' => :subscriber_id, 'MNT_TEST_MODE' => :test_mode, 'MNT_SIGNATURE' => :signature, 'MNT_USER' => :user, 'MNT_CORRACCOUNT' => :corraccount, 'MNT_CUSTOM1' => :custom1, 'MNT_CUSTOM2' => :custom2, 'MNT_CUSTOM3' => :custom3 }.invert.to_settings
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(params) ⇒ Pay
constructor
A new instance of Pay.
- #response ⇒ Object
- #success? ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(params) ⇒ Pay
Returns a new instance of Pay.
20 21 22 23 |
# File 'lib/payanyway/request/pay.rb', line 20 def initialize(params) super @valid_signature = (@pretty_params[:signature] == Payanyway::Helpers::SignatureGenerate.for_pay(@params)) end |
Instance Method Details
#response ⇒ Object
29 30 31 |
# File 'lib/payanyway/request/pay.rb', line 29 def response @valid_signature ? 'SUCCESS' : 'FAIL' end |
#success? ⇒ Boolean
25 26 27 |
# File 'lib/payanyway/request/pay.rb', line 25 def success? @valid_signature end |