rubykassa 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +2 -2
- data/app/controllers/robokassa_controller.rb +5 -5
- data/lib/generators/rubykassa/templates/rubykassa.rb +5 -0
- data/lib/rubykassa/configuration.rb +4 -4
- data/lib/rubykassa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c52a778739e02a0c460779e56ef5aa8f1551a341
|
4
|
+
data.tar.gz: a8c7956dad7f2320f9c53edf8b159348a931b75b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21cc076fa77de32594bf1e7ee3e13874ff1853a8c14dbc58ef8d3a51fd8c8a4fdb984f22ab17183b0c0746add7a34602319914b4b6bb8eacb168c8d2e8dc40a4
|
7
|
+
data.tar.gz: 4c18a84c4d1153f1a71ed7fc416958f2f1557a5b06868cabd2c23ed447b106f84ce712fee9be7f7a6281d4f2e8ae180d678195ec6e3e85ab6fba48fda2bc5929
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## Edge (not released)
|
2
2
|
|
3
|
+
## 0.3.1
|
4
|
+
|
5
|
+
* Pass `controller` and `notification` variables to callback block by @1um [#12][]
|
6
|
+
* Create `@notification` for `RobokassaController#fail` by @1um [#13][]
|
7
|
+
|
8
|
+
[#12]:https://github.com/ZeroOneStudio/rubykassa/pull/12
|
9
|
+
[#13]:https://github.com/ZeroOneStudio/rubykassa/pull/13
|
10
|
+
|
3
11
|
## 0.3.0
|
4
12
|
|
5
13
|
* Add confugurable success and fail callbacks
|
data/README.md
CHANGED
@@ -47,8 +47,8 @@ To define custom success/fail callbacks you can also use the initializer:
|
|
47
47
|
|
48
48
|
Rubykassa.configure do |config|
|
49
49
|
...
|
50
|
-
config.success_callback = -> { render text: 'success' }
|
51
|
-
config.fail_callback = -> { redirect_to root_path }
|
50
|
+
config.success_callback = -> (controller, notification){ render text: 'success' }
|
51
|
+
config.fail_callback = -> (controller, notification){ redirect_to root_path }
|
52
52
|
end
|
53
53
|
|
54
54
|
Lambdas are called in RobokassaController so you can respond with [any kind that is supported by Rails](http://guides.rubyonrails.org/layouts_and_rendering.html#creating-responses)
|
@@ -1,25 +1,25 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
class RobokassaController < ApplicationController
|
3
|
-
before_filter :create_notification
|
3
|
+
before_filter :create_notification
|
4
4
|
|
5
5
|
def paid
|
6
6
|
if @notification.valid_result_signature?
|
7
7
|
render text: @notification.success
|
8
8
|
else
|
9
|
-
Rubykassa.fail_callback.call
|
9
|
+
Rubykassa.fail_callback.call(self, @notification)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
def success
|
14
14
|
if @notification.valid_success_signature?
|
15
|
-
Rubykassa.success_callback.call
|
15
|
+
Rubykassa.success_callback.call(self, @notification)
|
16
16
|
else
|
17
|
-
Rubykassa.fail_callback.call
|
17
|
+
Rubykassa.fail_callback.call(self, @notification)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
def fail
|
22
|
-
Rubykassa.fail_callback.call
|
22
|
+
Rubykassa.fail_callback.call(self, @notification)
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
@@ -6,4 +6,9 @@ Rubykassa.configure do |c|
|
|
6
6
|
c.mode = :test # or :production
|
7
7
|
c.http_method = :get # or :post
|
8
8
|
c.xml_http_method = :get # or :post
|
9
|
+
|
10
|
+
# Define success or failure callbacks here like:
|
11
|
+
|
12
|
+
# config.success_callback = -> (controller, notification){ render text: 'success' }
|
13
|
+
# config.fail_callback = -> (controller, notification){ redirect_to root_path }
|
9
14
|
end
|
@@ -12,12 +12,12 @@ module Rubykassa
|
|
12
12
|
self.mode = :test
|
13
13
|
self.http_method = :get
|
14
14
|
self.xml_http_method = :get
|
15
|
-
self.success_callback =
|
15
|
+
self.success_callback = Proc.new do |controller, notification|
|
16
16
|
render text: 'success'
|
17
|
-
|
18
|
-
self.fail_callback =
|
17
|
+
end
|
18
|
+
self.fail_callback = Proc.new do |controller, notification|
|
19
19
|
render text: 'fail'
|
20
|
-
|
20
|
+
end
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
data/lib/rubykassa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubykassa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Kishenin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|