-
Notifications
You must be signed in to change notification settings - Fork 24
Updates #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Updates #33
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| class RobokassaController < ActionController::Base | ||
| if respond_to?(:before_action) | ||
| before_action :create_notification | ||
| else | ||
| before_filter :create_notification | ||
| end | ||
| class RobokassaController < ApplicationController | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing magic comment # frozen_string_literal: true. |
||
| before_action :create_notification | ||
|
|
||
| def result | ||
| if @notification.valid_result_signature? | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| config.login = ENV['ROBOKASSA_LOGIN'] | ||
| config.first_password = ENV['ROBOKASSA_FIRST_PASSWORD'] | ||
| config.second_password = ENV['ROBOKASSA_SECOND_PASSWORD'] | ||
| config.currency = ENV['ROBOKASSA_CURRENCY'] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
| config.mode = :test # or :production | ||
| config.http_method = :get # or :post | ||
| config.xml_http_method = :get # or :post | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| module Rubykassa | ||
| class Configuration | ||
| ATTRIBUTES = [ | ||
| :login, :first_password, :second_password, :mode, :http_method, | ||
| :login, :first_password, :second_password, :currency, :mode, :http_method, | ||
| :xml_http_method, :success_callback, :fail_callback, :result_callback, | ||
| :hash_algorithm | ||
| ] | ||
|
|
@@ -13,6 +13,7 @@ def initialize | |
| self.login = 'your_login' | ||
| self.first_password = 'first_password' | ||
| self.second_password = 'second_password' | ||
| self.currency = 'currency' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary spacing detected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary spacing detected. |
||
| self.mode = :test | ||
| self.http_method = :get | ||
| self.xml_http_method = :get | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,13 @@ def initialize(&block) | |
| yield self if block_given? | ||
| end | ||
|
|
||
| def calc_out_summ | ||
| request transform_method_name(__method__), | ||
| 'MerchantLogin' => Rubykassa.login, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
| 'IncCurrLabel' => Rubykassa.currency, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
| 'IncSum' => @total.to_s | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
| end | ||
|
|
||
| def get_currencies | ||
| request transform_method_name(__method__), | ||
| 'MerchantLogin' => Rubykassa.login, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing magic comment # frozen_string_literal: true.