Module: Payanyway::Controller
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/payanyway/controller.rb
Instance Method Summary collapse
- #check ⇒ Object
- #fail ⇒ Object
- #in_progress ⇒ Object
- #pay ⇒ Object
- #return ⇒ Object
- #success ⇒ Object
Instance Method Details
#check ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/payanyway/controller.rb', line 51 def check request = Payanyway::Request::Check.new(permitted_params) if request.pretty_params.present? raise request. unless request.success? render xml: request.response(check_implementation(request.pretty_params)).to_xml else # Не выдавать ошибку, если параметры пустые # Необходимо для проверки со стороны moneta.ru head :ok end end |
#fail ⇒ Object
33 34 35 36 37 |
# File 'lib/payanyway/controller.rb', line 33 def fail request = Payanyway::Request::Base.new(permitted_params) fail_implementation(request.pretty_params[:transaction_id]) end |
#in_progress ⇒ Object
45 46 47 48 49 |
# File 'lib/payanyway/controller.rb', line 45 def in_progress request = Payanyway::Request::Base.new(permitted_params) in_progress_implementation(request.pretty_params[:transaction_id]) end |
#pay ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/payanyway/controller.rb', line 14 def pay request = Payanyway::Request::Pay.new(permitted_params) request.success? ? pay_implementation(request.pretty_params) : Rails.logger.error(request.) if Gem::Version.new(Rails.version) < Gem::Version.new('5.1') render text: request.response else render plain: request.response end end |