zaakpay_ruby 0.2.0 → 0.2.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/README.md +11 -1
- data/lib/zaakpay_ruby.rb +3 -35
- data/lib/zaakpay_ruby/request.rb +13 -0
- data/lib/zaakpay_ruby/response.rb +18 -0
- data/lib/zaakpay_ruby/transaction.rb +8 -0
- data/lib/zaakpay_ruby/version.rb +1 -1
- data/zaakpay_ruby-0.2.0.gem +0 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea3f3e6f1c7b69ddb2782b5b5ee2cef0c6791512
|
4
|
+
data.tar.gz: ecf9c16db51db631cf804c3af99ccc4b7186a668
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38220269ee1f69446c9bf682250be8fb489f22659cc67f3f375e35f3bbb8c460b6b6d556e2899ea4d924bc4e81ea92009dbff113ff5ec36355fc2fc53b4eadd7
|
7
|
+
data.tar.gz: 5a41fc8db558cd1c20853576163073579928184c31fa21bbe23ea09607f75bdc6716fbeba61af42fac77a0643e13c1c873b2f293f37a95cc8a6d42a2c2cbd6a9
|
data/README.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## Donations and sponsoring
|
2
|
+
|
3
|
+
If you want to support this project please visit the Gratipay and Flattr pages.
|
4
|
+
|
5
|
+
[](https://gratipay.com/shoaibmalik786 "Donate weekly to this project using Gratipay")
|
6
|
+
[](https://flattr.com/submit/auto?user_id=shoaibmalik786&url=https%3A%2F%2Fgithub.com%2Fshoaibmalik786%2Fzaakpay_ruby "Donate monthly to this project using Flattr")
|
7
|
+
|
8
|
+
|
9
|
+
Currently the donations will be used to cover the hosting costs (domain name etc).
|
10
|
+
|
1
11
|
# ZaakpayRuby
|
2
12
|
zaakpay_ruby is a ruby gem that demonstrates the integration of a ruby-on-rails application with Zaakpay's api.
|
3
13
|
|
@@ -144,7 +154,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
144
154
|
|
145
155
|
## Contributing
|
146
156
|
|
147
|
-
1. Fork it ( https://github.com/
|
157
|
+
1. Fork it ( https://github.com/shoaibmalik786/zaakpay_ruby/fork )
|
148
158
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
149
159
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
150
160
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/zaakpay_ruby.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
require "zaakpay_ruby/version"
|
2
|
+
require "zaakpay_ruby/request"
|
3
|
+
require "zaakpay_ruby/response"
|
4
|
+
require "zaakpay_ruby/transaction"
|
2
5
|
|
3
6
|
module ZaakpayRuby
|
4
7
|
|
@@ -51,39 +54,4 @@ module ZaakpayRuby
|
|
51
54
|
sorted_params_hash
|
52
55
|
end
|
53
56
|
|
54
|
-
# This class is for wrappers around the ZaakpayRuby request.
|
55
|
-
class Request
|
56
|
-
attr_reader :params, :all_params, :checksum
|
57
|
-
|
58
|
-
def initialize(args_hash)
|
59
|
-
@params = args_hash
|
60
|
-
@checksum = ZaakpayRuby.generate_checksum(@params)
|
61
|
-
@all_params = {}.merge(@params).merge({'checksum' => @checksum })
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
# This class creates wrappers around the Zaakpay response
|
67
|
-
class Response
|
68
|
-
attr_reader :params, :all_params, :posted_checksum, :checksum
|
69
|
-
|
70
|
-
def initialize(args_str)
|
71
|
-
@all_params = Rack::Utils.parse_query(args_str)
|
72
|
-
@posted_checksum = @all_params['checksum']
|
73
|
-
@params = @all_params.reject{|k,v| k=='checksum'}
|
74
|
-
end
|
75
|
-
|
76
|
-
def valid?
|
77
|
-
@checksum = ZaakpayRuby.generate_checksum(@params)
|
78
|
-
@posted_checksum == @checksum
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
class Transaction
|
84
|
-
def self.sale(options={})
|
85
|
-
zr = ZaakpayRuby::Request.new(options)
|
86
|
-
return zr.all_params
|
87
|
-
end
|
88
|
-
end
|
89
57
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module ZaakpayRuby
|
2
|
+
# This class is for wrappers around the ZaakpayRuby request.
|
3
|
+
class Request
|
4
|
+
attr_reader :params, :all_params, :checksum
|
5
|
+
|
6
|
+
def initialize(args_hash)
|
7
|
+
@params = args_hash
|
8
|
+
@checksum = ZaakpayRuby.generate_checksum(@params)
|
9
|
+
@all_params = {}.merge(@params).merge({'checksum' => @checksum })
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module ZaakpayRuby
|
2
|
+
# This class creates wrappers around the Zaakpay response
|
3
|
+
class Response
|
4
|
+
attr_reader :params, :all_params, :posted_checksum, :checksum
|
5
|
+
|
6
|
+
def initialize(args_str)
|
7
|
+
@all_params = Rack::Utils.parse_query(args_str)
|
8
|
+
@posted_checksum = @all_params['checksum']
|
9
|
+
@params = @all_params.reject{|k,v| k=='checksum'}
|
10
|
+
end
|
11
|
+
|
12
|
+
def valid?
|
13
|
+
@checksum = ZaakpayRuby.generate_checksum(@params)
|
14
|
+
@posted_checksum == @checksum
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/lib/zaakpay_ruby/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zaakpay_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shoaib Malik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -57,10 +57,14 @@ files:
|
|
57
57
|
- lib/generators/templates/zaakpay_initializer.rb
|
58
58
|
- lib/generators/zaakpay_ruby/install_generator.rb
|
59
59
|
- lib/zaakpay_ruby.rb
|
60
|
+
- lib/zaakpay_ruby/request.rb
|
61
|
+
- lib/zaakpay_ruby/response.rb
|
62
|
+
- lib/zaakpay_ruby/transaction.rb
|
60
63
|
- lib/zaakpay_ruby/version.rb
|
61
64
|
- zaakpay_ruby-0.1.0.gem
|
62
65
|
- zaakpay_ruby-0.1.1.gem
|
63
66
|
- zaakpay_ruby-0.1.2.gem
|
67
|
+
- zaakpay_ruby-0.2.0.gem
|
64
68
|
- zaakpay_ruby.gemspec
|
65
69
|
homepage: https://github.com/shoaibmalik786/zaakpay_ruby
|
66
70
|
licenses:
|