kaznachey_payments 0.9.7.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +50 -0
  5. data/Rakefile +2 -0
  6. data/doc/HttpHelper.html +221 -0
  7. data/doc/KaznacheyConfigurations.html +132 -0
  8. data/doc/KaznacheyPayments.html +117 -0
  9. data/doc/KaznacheyPaymentsApi.html +294 -0
  10. data/doc/Md5Helper.html +189 -0
  11. data/doc/PaySystem.html +430 -0
  12. data/doc/PaymentDetails.html +900 -0
  13. data/doc/Product.html +480 -0
  14. data/doc/ReqCommonObject.html +274 -0
  15. data/doc/ReqCreatePayment.html +534 -0
  16. data/doc/ReqGetMerchantInfo.html +202 -0
  17. data/doc/RespCommonObject.html +274 -0
  18. data/doc/RespCreatePayment.html +303 -0
  19. data/doc/RespMerchantInfo.html +387 -0
  20. data/doc/RespPaymentStatus.html +689 -0
  21. data/doc/_index.html +212 -0
  22. data/doc/class_list.html +58 -0
  23. data/doc/css/common.css +1 -0
  24. data/doc/css/full_list.css +57 -0
  25. data/doc/css/style.css +339 -0
  26. data/doc/file.README.html +110 -0
  27. data/doc/file_list.html +60 -0
  28. data/doc/frames.html +26 -0
  29. data/doc/index.html +126 -0
  30. data/doc/js/app.js +219 -0
  31. data/doc/js/full_list.js +181 -0
  32. data/doc/js/jquery.js +4 -0
  33. data/doc/method_list.html +333 -0
  34. data/doc/top-level-namespace.html +114 -0
  35. data/lib/ApiObjects/Requests/payment_details.rb +34 -0
  36. data/lib/ApiObjects/Requests/product.rb +16 -0
  37. data/lib/ApiObjects/Requests/req_common_object.rb +6 -0
  38. data/lib/ApiObjects/Requests/req_create_payment.rb +42 -0
  39. data/lib/ApiObjects/Requests/req_get_merchant_info.rb +11 -0
  40. data/lib/ApiObjects/Responses/pay_system.rb +19 -0
  41. data/lib/ApiObjects/Responses/resp_common_object.rb +6 -0
  42. data/lib/ApiObjects/Responses/resp_create_payment.rb +15 -0
  43. data/lib/ApiObjects/Responses/resp_merchant_info.rb +26 -0
  44. data/lib/ApiObjects/Responses/resp_payment_status.rb +43 -0
  45. data/lib/ApiObjects/kaznachey_configurations.rb +9 -0
  46. data/lib/Helpers/http_helper.rb +26 -0
  47. data/lib/Helpers/md5_helper.rb +7 -0
  48. data/lib/kaznachey_payments/version.rb +3 -0
  49. data/lib/kaznachey_payments_api.rb +32 -0
  50. data/test/test_get_merchant_info.rb +55 -0
  51. metadata +95 -0
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDU0OTllZDZmOGY4NGQwZDU1YWJhNWM3Y2JhZDRjZWU0MzhlNDc1ZA==
5
+ data.tar.gz: !binary |-
6
+ YjE0NjE1MWU3YmIzYWM5YzM0NmMyYjQwZTEwMDBmMGJiMzYzY2U3NA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ OGJhNmZmOGI0NWE5MWQ2YmE3ZjMyMTk2ZGIzNGYxNmVmNWYzZTZjNGNlNjA0
10
+ OTQ1YzY2OWJlNGRmOTllZDZmMWMzZjM1MTNhMmJjNjc5M2IzY2NlMzY0MWZj
11
+ ODYyOTE5MjViNmUzNzc5NGY0MGM3ZjhhOWIxNmJhMzNjOGM2YTM=
12
+ data.tar.gz: !binary |-
13
+ NjcyOTRlZTA1OTdlZGQ5OWU5MjZkMTU2OTVhYzE4Y2ZlMTAzMGM0ZWE1ZWVh
14
+ Yjg1ZGZjNDNiMTAxODE3NWEwMDRhNTMwZDE1Njk1MzdmM2JiNzBlNWZmMjUw
15
+ NjAwOTlmNjFiMmJmMzI5NTQ1MTZmNWM2ZTYzZTkyYjM0ZjhkOTk=
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in kaznachey_payments.gemspec
4
+ gemspec
5
+
6
+ require 'rubygems'
7
+ require 'bundler/setup'
8
+
9
+ gem 'activesupport'
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Vladimir Yamborko
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,50 @@
1
+ # KaznacheyApi
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ $ gem install kaznachey_payments
8
+
9
+ ## Usage
10
+
11
+ Getting merchant's payment systems:
12
+
13
+ KaznacheyConfigurations.MerchantGuid = 'YOUR_MERHCANT_GUID'
14
+ KaznacheyConfigurations.MerchantSecretKey = 'YOUR_MERCHANT_KEY'
15
+
16
+ api = KaznacheyPaymentsApi.new
17
+
18
+ request = ReqGetMerchantInfo.new
19
+
20
+ request.MerchantGuid = KaznacheyConfigurations.MerchantGuid
21
+
22
+ response = api.GetMerchantInfo(request)
23
+
24
+ Payment example:
25
+
26
+ KaznacheyConfigurations.MerchantGuid = 'YOUR_MERHCANT_GUID'
27
+ KaznacheyConfigurations.MerchantSecretKey = 'YOUR_MERHCANT_GUID'
28
+
29
+ api = KaznacheyPaymentsApi.new
30
+
31
+ request = ReqCreatePayment.new
32
+ request.MerchantGuid = KaznacheyConfigurations.MerchantGuid
33
+ request.SelectedPaySystemId = 1
34
+
35
+ paymentDetails = PaymentDetails.new
36
+ paymentDetails.PhoneNumber = '123123123'
37
+ paymentDetails.EMail = 'email@email.com'
38
+ paymentDetails.MerchantInternalPaymentId = '0'
39
+ paymentDetails.BuyerFirstname = 'Test'
40
+ request.PaymentDetails = paymentDetails
41
+
42
+ product = Product.new
43
+ product.ProductId = '1'
44
+ product.ProductItemsNum = 1
45
+ product.ProductName = 'Test Item'
46
+ product.ProductPrice = 1
47
+ request.Products = [ product ]
48
+ request
49
+
50
+ response = api.CreatePayment(request)
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,221 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: HttpHelper
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!HttpHelper.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index (H)</a> &raquo;
35
+
36
+
37
+ <span class="title">HttpHelper</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: HttpHelper
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">HttpHelper</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/Helpers/http_helper.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <h2>
111
+ Class Method Summary
112
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
113
+ </h2>
114
+
115
+ <ul class="summary">
116
+
117
+ <li class="public ">
118
+ <span class="summary_signature">
119
+
120
+ <a href="#SendRequest-class_method" title="SendRequest (class method)">+ (Object) <strong>SendRequest</strong>(request, uri) </a>
121
+
122
+
123
+
124
+ </span>
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+ <span class="summary_desc"><div class='inline'></div></span>
135
+
136
+ </li>
137
+
138
+
139
+ </ul>
140
+
141
+
142
+
143
+
144
+ <div id="class_method_details" class="method_details_list">
145
+ <h2>Class Method Details</h2>
146
+
147
+
148
+ <div class="method_details first">
149
+ <h3 class="signature first" id="SendRequest-class_method">
150
+
151
+ + (<tt>Object</tt>) <strong>SendRequest</strong>(request, uri)
152
+
153
+
154
+
155
+
156
+
157
+ </h3><table class="source_code">
158
+ <tr>
159
+ <td>
160
+ <pre class="lines">
161
+
162
+
163
+ 7
164
+ 8
165
+ 9
166
+ 10
167
+ 11
168
+ 12
169
+ 13
170
+ 14
171
+ 15
172
+ 16
173
+ 17
174
+ 18
175
+ 19
176
+ 20
177
+ 21
178
+ 22
179
+ 23
180
+ 24
181
+ 25</pre>
182
+ </td>
183
+ <td>
184
+ <pre class="code"><span class="info file"># File 'lib/Helpers/http_helper.rb', line 7</span>
185
+
186
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='const'>SendRequest</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='comma'>,</span> <span class='id identifier rubyid_uri'>uri</span><span class='rparen'>)</span>
187
+
188
+ <span class='id identifier rubyid_uri'>uri</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='const'>KaznacheyConfigurations</span><span class='period'>.</span><span class='const'>ServerUrl</span> <span class='op'>+</span> <span class='id identifier rubyid_uri'>uri</span><span class='rparen'>)</span>
189
+ <span class='kw'>begin</span>
190
+ <span class='id identifier rubyid_header'>header</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>'</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text/json</span><span class='tstring_end'>'</span></span><span class='rbrace'>}</span>
191
+ <span class='id identifier rubyid_http'>http</span> <span class='op'>=</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>HTTP</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_uri'>uri</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span><span class='comma'>,</span> <span class='id identifier rubyid_uri'>uri</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span><span class='rparen'>)</span>
192
+ <span class='id identifier rubyid_httpRequest'>httpRequest</span> <span class='op'>=</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>HTTP</span><span class='op'>::</span><span class='const'>Post</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_uri'>uri</span><span class='period'>.</span><span class='id identifier rubyid_request_uri'>request_uri</span><span class='comma'>,</span> <span class='id identifier rubyid_header'>header</span><span class='rparen'>)</span>
193
+ <span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_encode'>encode</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
194
+ <span class='id identifier rubyid_httpRequest'>httpRequest</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='id identifier rubyid_body'>body</span>
195
+
196
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_http'>http</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='id identifier rubyid_httpRequest'>httpRequest</span><span class='rparen'>)</span>
197
+
198
+ <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
199
+ <span class='kw'>rescue</span>
200
+
201
+ <span class='kw'>ensure</span>
202
+ <span class='kw'>nil</span>
203
+ <span class='kw'>end</span>
204
+ <span class='kw'>end</span></pre>
205
+ </td>
206
+ </tr>
207
+ </table>
208
+ </div>
209
+
210
+ </div>
211
+
212
+ </div>
213
+
214
+ <div id="footer">
215
+ Generated on Wed Dec 3 14:19:56 2014 by
216
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
217
+ 0.8.7.6 (ruby-1.9.3).
218
+ </div>
219
+
220
+ </body>
221
+ </html>
@@ -0,0 +1,132 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: KaznacheyConfigurations
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!KaznacheyConfigurations.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index (K)</a> &raquo;
35
+
36
+
37
+ <span class="title">KaznacheyConfigurations</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: KaznacheyConfigurations
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">KaznacheyConfigurations</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/ApiObjects/kaznachey_configurations.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+
103
+ <h2>Constant Summary</h2>
104
+
105
+ <dl class="constants">
106
+
107
+ <dt id="ServerUrl-classvariable" class="">@@ServerUrl =
108
+
109
+ </dt>
110
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://payment.kaznachey.net/api/PaymentInterface/</span><span class='tstring_end'>'</span></span></pre></dd>
111
+
112
+ </dl>
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ </div>
124
+
125
+ <div id="footer">
126
+ Generated on Wed Dec 3 14:19:56 2014 by
127
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
128
+ 0.8.7.6 (ruby-1.9.3).
129
+ </div>
130
+
131
+ </body>
132
+ </html>