Class: PaymentsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- PaymentsController
- Defined in:
- app/controllers/payments_controller.rb
Instance Method Summary collapse
Instance Method Details
#failed ⇒ Object
30 31 32 |
# File 'app/controllers/payments_controller.rb', line 30 def failed redirect_to pay_path, alert: 'Failed' end |
#result ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/payments_controller.rb', line 2 def result out_sum = params['OutSum'] invoice_id = params['InvId'] user = params['Shp_user'] signature_1 = params['SignatureValue'] signature_2 = RobokassaApi.create_signature(args = { out_sum: out_sum, invoice_id: invoice_id, user: user }) @result = RobokassaApi.check_signatures(signature1, signature2, invoice_id) if @result # В случае успешного сравнения подписей, сюда можно передать блок кода: # - Создание заказа в базе # - Оплата доступа # - и т.д. end @result end |
#success ⇒ Object
26 27 28 |
# File 'app/controllers/payments_controller.rb', line 26 def success redirect_to pay_path, notice: 'Success' end |