rubykassa 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3bb9879d9d2b86beba88015e506782c4bd57fd4d
4
- data.tar.gz: b47aa33a7cad9f81ec111b031b911ab2e9ac41d9
3
+ metadata.gz: 612e486181e1ee5501533f83ab6e331aca5f260b
4
+ data.tar.gz: 8b560867289cc9e919ab19c9a4823edad94e665c
5
5
  SHA512:
6
- metadata.gz: 3370eb1c5bf9c0923ac17d4795f381d1d2ad120128a5858888ff11c9fc3e8d292addeb77e7cc2362e376ae0141f046dc3aa77e5f7d49d4fb6233518cd5bdf3a5
7
- data.tar.gz: 216ff6f6ab2db1479ea5e2108ce7c4a0090a7a4e35d324afc53f770c679733346b736686b0cf143f933127114b71c09f88fedff3881a1653d28ba10aa4fa32e7
6
+ metadata.gz: cb8a34b79e6684c3f3af9ed5854e7ca9157a49c13ed66aa1ddf0cd5de8ea7964d77668b38af2d2d9b99bb2d90d65fe2a22649d0676587d291fbc70bba8a25fea
7
+ data.tar.gz: 1ad1106701142d4e6b68f94e2eb01edc6102016116e28969b298138f60e13be1710c1235b17e807c926d486ef5182335cb2856f0dd92662562899ca5da83a252
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Edge (not released)
2
2
 
3
+ ## 0.4.1
4
+
5
+ * Add support html options in params.
6
+
3
7
  ## 0.4.0
4
8
 
5
9
  * Simplify callbacks logic: no more necessity to pass `controller` variable to lambda. Thanks @BrainNya for active promotion.
data/README.md CHANGED
@@ -48,9 +48,9 @@ To define custom success/fail callbacks you can also use the initializer:
48
48
 
49
49
  Rubykassa.configure do |config|
50
50
  ...
51
- config.success_callback = -> (notification) { render text: 'success' }
52
- config.fail_callback = -> (notification) { redirect_to root_path }
53
- config.result_callback = -> (notification) { render text: notification.success }
51
+ config.success_callback = ->(notification) { render text: 'success' }
52
+ config.fail_callback = ->(notification) { redirect_to root_path }
53
+ config.result_callback = ->(notification) { render text: notification.success }
54
54
  end
55
55
 
56
56
  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).
@@ -70,7 +70,11 @@ Additionally you may want to pass extra options. There is no problem:
70
70
 
71
71
  Or if you would like to pass some custom params use `custom` key in options hash:
72
72
 
73
- <%= pay_url "Pay with Robokassa", ivoice_id, total_sum, { description: "Invoice description", email: "foo@bar.com", currency: "WMZM", culture: :ru, custom: { param1: "value1", param2: "value2" }} %>
73
+ <%= pay_url "Pay with Robokassa", ivoice_id, total_sum, { description: "Invoice description", email: "foo@bar.com", currency: "WMZM", culture: :ru, custom: { param1: "value1", param2: "value2" }} %>
74
+
75
+ You can also pass some HTML options with `html` key in options hash (Bootstrap 3 example):
76
+
77
+ <%= pay_url "Pay with Robokassa", ivoice_id, total_sum, { html: { class: 'btn btn-primary btn-bg' }}
74
78
 
75
79
  If you need to implement Robokassa's XML interface functionality you have to the following:
76
80
 
@@ -12,10 +12,10 @@ Rubykassa.configure do |config|
12
12
  # was generated. It should always return "OK#{ invoice_id }" string, so implement
13
13
  # your custom logic above `render text: notification.success` line
14
14
 
15
- config.result_callback = -> (notification) { render text: notification.success }
15
+ config.result_callback = ->(notification) { render text: notification.success }
16
16
 
17
17
  # Define success or failure callbacks here like:
18
18
 
19
- # config.success_callback = -> (notification) { render text: 'success' }
20
- # config.fail_callback = -> (notification) { redirect_to root_path }
19
+ # config.success_callback = ->(notification) { render text: 'success' }
20
+ # config.fail_callback = ->(notification) { redirect_to root_path }
21
21
  end
@@ -3,9 +3,10 @@ module Rubykassa
3
3
  module ActionViewExtension
4
4
  def pay_url phrase, invoice_id, total, options = {}
5
5
  total, invoice_id = total.to_s, invoice_id.to_s
6
- extra_params = options.except(:custom)
6
+ extra_params = options.except([:custom, :html])
7
7
  custom_params = options[:custom] ||= {}
8
- link_to phrase, Rubykassa.pay_url(invoice_id, total, custom_params, extra_params)
8
+ html_params = options[:html] ||= {}
9
+ link_to phrase, Rubykassa.pay_url(invoice_id, total, custom_params, extra_params), html_params
9
10
  end
10
11
  end
11
- end
12
+ end
@@ -15,9 +15,9 @@ module Rubykassa
15
15
  self.mode = :test
16
16
  self.http_method = :get
17
17
  self.xml_http_method = :get
18
- self.success_callback = -> (notification) { render text: 'success' }
19
- self.fail_callback = -> (notification) { render text: 'fail' }
20
- self.result_callback = -> (notification) { render text: notification.success }
18
+ self.success_callback = ->(notification) { render text: 'success' }
19
+ self.fail_callback = ->(notification) { render text: 'fail' }
20
+ self.result_callback = ->(notification) { render text: notification.success }
21
21
  end
22
22
  end
23
23
  end
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Rubykassa
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
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.4.0
4
+ version: 0.4.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-08-12 00:00:00.000000000 Z
11
+ date: 2014-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails