openpayu 0.0.2
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 +15 -0
- data/.gitignore +18 -0
- data/.rspec +3 -0
- data/.rubocop.yml +45 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +10 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +193 -0
- data/Rakefile +1 -0
- data/doc/EmptyResponseError.html +123 -0
- data/doc/HttpStatusException.html +123 -0
- data/doc/NotImplementedException.html +123 -0
- data/doc/OpenPayU.html +436 -0
- data/doc/OpenPayU/Configuration.html +1530 -0
- data/doc/OpenPayU/Connection.html +381 -0
- data/doc/OpenPayU/Document.html +705 -0
- data/doc/OpenPayU/Documents.html +117 -0
- data/doc/OpenPayU/Documents/Request.html +503 -0
- data/doc/OpenPayU/Documents/Response.html +783 -0
- data/doc/OpenPayU/Models.html +117 -0
- data/doc/OpenPayU/Models/Address.html +861 -0
- data/doc/OpenPayU/Models/Buyer.html +587 -0
- data/doc/OpenPayU/Models/Buyer/Delivery.html +312 -0
- data/doc/OpenPayU/Models/Card.html +507 -0
- data/doc/OpenPayU/Models/Fee.html +367 -0
- data/doc/OpenPayU/Models/Model.html +1208 -0
- data/doc/OpenPayU/Models/NotifyResponse.html +297 -0
- data/doc/OpenPayU/Models/Order.html +1155 -0
- data/doc/OpenPayU/Models/PayMethod.html +507 -0
- data/doc/OpenPayU/Models/Product.html +787 -0
- data/doc/OpenPayU/Models/Refund.html +1020 -0
- data/doc/OpenPayU/Models/ShippingMethod.html +367 -0
- data/doc/OpenPayU/Models/StatusUpdate.html +647 -0
- data/doc/OpenPayU/Models/Token.html +507 -0
- data/doc/OpenPayU/Order.html +924 -0
- data/doc/OpenPayU/Refund.html +269 -0
- data/doc/OpenPayU/Token.html +288 -0
- data/doc/OpenPayU/XmlBuilder.html +277 -0
- data/doc/WrongConfigurationError.html +123 -0
- data/doc/WrongNotifyRequest.html +123 -0
- data/doc/WrongOrderParameters.html +267 -0
- data/doc/WrongSignatureException.html +123 -0
- data/doc/_index.html +446 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.README.html +281 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +281 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1007 -0
- data/doc/top-level-namespace.html +114 -0
- data/lib/openpayu.rb +66 -0
- data/lib/openpayu/configuration.rb +62 -0
- data/lib/openpayu/connection.rb +65 -0
- data/lib/openpayu/document.rb +105 -0
- data/lib/openpayu/documents/request.rb +34 -0
- data/lib/openpayu/documents/response.rb +48 -0
- data/lib/openpayu/exceptions.rb +19 -0
- data/lib/openpayu/models/address.rb +12 -0
- data/lib/openpayu/models/buyer.rb +11 -0
- data/lib/openpayu/models/buyer/delivery.rb +7 -0
- data/lib/openpayu/models/buyer/invoice.rb +8 -0
- data/lib/openpayu/models/card.rb +10 -0
- data/lib/openpayu/models/fee.rb +9 -0
- data/lib/openpayu/models/model.rb +151 -0
- data/lib/openpayu/models/notify_response.rb +9 -0
- data/lib/openpayu/models/order.rb +28 -0
- data/lib/openpayu/models/pay_method.rb +10 -0
- data/lib/openpayu/models/product.rb +10 -0
- data/lib/openpayu/models/refund.rb +41 -0
- data/lib/openpayu/models/shipping_method.rb +9 -0
- data/lib/openpayu/models/status_update.rb +14 -0
- data/lib/openpayu/models/token.rb +10 -0
- data/lib/openpayu/order.rb +119 -0
- data/lib/openpayu/refund.rb +26 -0
- data/lib/openpayu/token.rb +27 -0
- data/lib/openpayu/version.rb +4 -0
- data/lib/openpayu/xml_builder.rb +23 -0
- data/lib/openpayu_ruby.rb +2 -0
- data/openpayu_ruby.gemspec +40 -0
- data/spec/cassettes/cancel_order.yml +50 -0
- data/spec/cassettes/create_order.yml +51 -0
- data/spec/cassettes/refund_order.yml +100 -0
- data/spec/cassettes/retrieve_order.yml +51 -0
- data/spec/cassettes/update_order.yml +50 -0
- data/spec/integration/order_spec.rb +103 -0
- data/spec/openpayu.yml +11 -0
- data/spec/spec_helper.rb +27 -0
- data/spec/test_objects/order.rb +97 -0
- data/spec/unit/configuration_spec.rb +71 -0
- data/spec/unit/document_spec.rb +18 -0
- data/spec/unit/models/order_spec.rb +82 -0
- data/spec/unit/models/refund_spec.rb +24 -0
- data/spec/unit/openpayu_spec.rb +27 -0
- metadata +327 -0
@@ -0,0 +1,123 @@
|
|
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
|
+
Exception: HttpStatusException
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.2
|
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#!" + escape(window.location.href);
|
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> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">HttpStatusException</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>Exception: HttpStatusException
|
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">StandardError</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">StandardError</li>
|
82
|
+
|
83
|
+
<li class="next">HttpStatusException</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/openpayu/exceptions.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div id="footer">
|
117
|
+
Generated on Tue Dec 17 15:20:59 2013 by
|
118
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
|
+
0.8.7.2 (ruby-1.9.3).
|
120
|
+
</div>
|
121
|
+
|
122
|
+
</body>
|
123
|
+
</html>
|
@@ -0,0 +1,123 @@
|
|
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
|
+
Exception: NotImplementedException
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.2
|
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#!" + escape(window.location.href);
|
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 (N)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">NotImplementedException</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>Exception: NotImplementedException
|
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">StandardError</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">StandardError</li>
|
82
|
+
|
83
|
+
<li class="next">NotImplementedException</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/openpayu/exceptions.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div id="footer">
|
117
|
+
Generated on Tue Dec 17 15:20:59 2013 by
|
118
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
|
+
0.8.7.2 (ruby-1.9.3).
|
120
|
+
</div>
|
121
|
+
|
122
|
+
</body>
|
123
|
+
</html>
|
data/doc/OpenPayU.html
ADDED
@@ -0,0 +1,436 @@
|
|
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
|
+
Module: OpenPayU
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.2
|
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#!" + escape(window.location.href);
|
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 (O)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">OpenPayU</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>Module: OpenPayU
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/openpayu.rb<span class="defines">,<br />
|
83
|
+
lib/openpayu/order.rb,<br /> lib/openpayu/token.rb,<br /> lib/openpayu/refund.rb,<br /> lib/openpayu/version.rb,<br /> lib/openpayu/document.rb,<br /> lib/openpayu/connection.rb,<br /> lib/openpayu/models/fee.rb,<br /> lib/openpayu/models/card.rb,<br /> lib/openpayu/xml_builder.rb,<br /> lib/openpayu/models/buyer.rb,<br /> lib/openpayu/models/model.rb,<br /> lib/openpayu/models/token.rb,<br /> lib/openpayu/models/order.rb,<br /> lib/openpayu/configuration.rb,<br /> lib/openpayu/models/refund.rb,<br /> lib/openpayu/models/address.rb,<br /> lib/openpayu/models/product.rb,<br /> lib/openpayu/models/pay_method.rb,<br /> lib/openpayu/documents/request.rb,<br /> lib/openpayu/documents/response.rb,<br /> lib/openpayu/models/status_update.rb,<br /> lib/openpayu/models/buyer/invoice.rb,<br /> lib/openpayu/models/buyer/delivery.rb,<br /> lib/openpayu/models/notify_response.rb,<br /> lib/openpayu/models/shipping_method.rb</span>
|
84
|
+
</dd>
|
85
|
+
|
86
|
+
</dl>
|
87
|
+
<div class="clear"></div>
|
88
|
+
|
89
|
+
<h2>Defined Under Namespace</h2>
|
90
|
+
<p class="children">
|
91
|
+
|
92
|
+
|
93
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="OpenPayU/Documents.html" title="OpenPayU::Documents (module)">Documents</a></span>, <span class='object_link'><a href="OpenPayU/Models.html" title="OpenPayU::Models (module)">Models</a></span>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="OpenPayU/Configuration.html" title="OpenPayU::Configuration (class)">Configuration</a></span>, <span class='object_link'><a href="OpenPayU/Connection.html" title="OpenPayU::Connection (class)">Connection</a></span>, <span class='object_link'><a href="OpenPayU/Document.html" title="OpenPayU::Document (class)">Document</a></span>, <span class='object_link'><a href="OpenPayU/Order.html" title="OpenPayU::Order (class)">Order</a></span>, <span class='object_link'><a href="OpenPayU/Refund.html" title="OpenPayU::Refund (class)">Refund</a></span>, <span class='object_link'><a href="OpenPayU/Token.html" title="OpenPayU::Token (class)">Token</a></span>, <span class='object_link'><a href="OpenPayU/XmlBuilder.html" title="OpenPayU::XmlBuilder (class)">XmlBuilder</a></span>
|
98
|
+
|
99
|
+
|
100
|
+
</p>
|
101
|
+
|
102
|
+
<h2>Constant Summary</h2>
|
103
|
+
|
104
|
+
<dl class="constants">
|
105
|
+
|
106
|
+
<dt id="VERSION-constant" class="">VERSION =
|
107
|
+
|
108
|
+
</dt>
|
109
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.0.1</span><span class='tstring_end'>'</span></span></pre></dd>
|
110
|
+
|
111
|
+
</dl>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<h2>
|
122
|
+
Class Method Summary
|
123
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
124
|
+
</h2>
|
125
|
+
|
126
|
+
<ul class="summary">
|
127
|
+
|
128
|
+
<li class="public ">
|
129
|
+
<span class="summary_signature">
|
130
|
+
|
131
|
+
<a href="#hosted_order_form-class_method" title="hosted_order_form (class method)">+ (String) <strong>hosted_order_form</strong>(order) </a>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
</span>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<span class="summary_desc"><div class='inline'>
|
146
|
+
<p>Generate a form body for hosted order.</p>
|
147
|
+
</div></span>
|
148
|
+
|
149
|
+
</li>
|
150
|
+
|
151
|
+
|
152
|
+
<li class="public ">
|
153
|
+
<span class="summary_signature">
|
154
|
+
|
155
|
+
<a href="#sign_form-class_method" title="sign_form (class method)">+ (String) <strong>sign_form</strong>(form_fields, key = nil, algorithm = nil, pos_id = nil) </a>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</span>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="summary_desc"><div class='inline'>
|
170
|
+
<p>Generate a signature for signing form sent directly to PayU.</p>
|
171
|
+
</div></span>
|
172
|
+
|
173
|
+
</li>
|
174
|
+
|
175
|
+
|
176
|
+
</ul>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<div id="class_method_details" class="method_details_list">
|
182
|
+
<h2>Class Method Details</h2>
|
183
|
+
|
184
|
+
|
185
|
+
<div class="method_details first">
|
186
|
+
<h3 class="signature first" id="hosted_order_form-class_method">
|
187
|
+
|
188
|
+
+ (<tt>String</tt>) <strong>hosted_order_form</strong>(order)
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
</h3><div class="docstring">
|
195
|
+
<div class="discussion">
|
196
|
+
|
197
|
+
<p>Generate a form body for hosted order</p>
|
198
|
+
|
199
|
+
|
200
|
+
</div>
|
201
|
+
</div>
|
202
|
+
<div class="tags">
|
203
|
+
<p class="tag_title">Parameters:</p>
|
204
|
+
<ul class="param">
|
205
|
+
|
206
|
+
<li>
|
207
|
+
|
208
|
+
<span class='name'>order</span>
|
209
|
+
|
210
|
+
|
211
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
—
|
216
|
+
<div class='inline'>
|
217
|
+
<p>Hash</p>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
</li>
|
221
|
+
|
222
|
+
</ul>
|
223
|
+
|
224
|
+
<p class="tag_title">Returns:</p>
|
225
|
+
<ul class="return">
|
226
|
+
|
227
|
+
<li>
|
228
|
+
|
229
|
+
|
230
|
+
<span class='type'>(<tt>String</tt>)</span>
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
—
|
235
|
+
<div class='inline'>
|
236
|
+
<p>A full form containign an order</p>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
</li>
|
240
|
+
|
241
|
+
</ul>
|
242
|
+
|
243
|
+
</div><table class="source_code">
|
244
|
+
<tr>
|
245
|
+
<td>
|
246
|
+
<pre class="lines">
|
247
|
+
|
248
|
+
|
249
|
+
53
|
250
|
+
54
|
251
|
+
55
|
252
|
+
56
|
253
|
+
57
|
254
|
+
58
|
255
|
+
59
|
256
|
+
60
|
257
|
+
61
|
258
|
+
62
|
259
|
+
63
|
260
|
+
64
|
261
|
+
65</pre>
|
262
|
+
</td>
|
263
|
+
<td>
|
264
|
+
<pre class="code"><span class="info file"># File 'lib/openpayu.rb', line 53</span>
|
265
|
+
|
266
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_hosted_order_form'>hosted_order_form</span><span class='lparen'>(</span><span class='id identifier rubyid_order'>order</span><span class='rparen'>)</span>
|
267
|
+
<span class='ivar'>@order</span> <span class='op'>=</span> <span class='const'>Models</span><span class='op'>::</span><span class='const'>Order</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_order'>order</span><span class='rparen'>)</span>
|
268
|
+
<span class='id identifier rubyid_render_hash'>render_hash</span> <span class='op'>=</span> <span class='ivar'>@order</span><span class='period'>.</span><span class='id identifier rubyid_to_flatten_hash'>to_flatten_hash</span>
|
269
|
+
<span class='id identifier rubyid_html_form'>html_form</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><form method='post' </span><span class='tstring_end'>"</span></span> <span class='op'>+</span>
|
270
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>action='</span><span class='embexpr_beg'>#{</span><span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_get_base_url'>get_base_url</span><span class='rbrace'>}</span><span class='tstring_content'>order'>\n</span><span class='tstring_end'>"</span></span>
|
271
|
+
<span class='id identifier rubyid_render_hash'>render_hash</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
272
|
+
<span class='id identifier rubyid_html_form'>html_form</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><input type='hidden' name='</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='rbrace'>}</span><span class='tstring_content'>' value='</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='tstring_content'>' />\n</span><span class='tstring_end'>"</span></span>
|
273
|
+
<span class='kw'>end</span>
|
274
|
+
|
275
|
+
<span class='id identifier rubyid_html_form'>html_form</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><input type='hidden' name='OpenPayu-Signature'
|
276
|
+
value='</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sign_form'>sign_form</span><span class='lparen'>(</span><span class='id identifier rubyid_render_hash'>render_hash</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>' />
|
277
|
+
<button type='submit' formtarget='_blank' />\n</form></span><span class='tstring_end'>"</span></span>
|
278
|
+
<span class='kw'>end</span></pre>
|
279
|
+
</td>
|
280
|
+
</tr>
|
281
|
+
</table>
|
282
|
+
</div>
|
283
|
+
|
284
|
+
<div class="method_details ">
|
285
|
+
<h3 class="signature " id="sign_form-class_method">
|
286
|
+
|
287
|
+
+ (<tt>String</tt>) <strong>sign_form</strong>(form_fields, key = nil, algorithm = nil, pos_id = nil)
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
</h3><div class="docstring">
|
294
|
+
<div class="discussion">
|
295
|
+
|
296
|
+
<p>Generate a signature for signing form sent directly to PayU</p>
|
297
|
+
|
298
|
+
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
<div class="tags">
|
302
|
+
<p class="tag_title">Parameters:</p>
|
303
|
+
<ul class="param">
|
304
|
+
|
305
|
+
<li>
|
306
|
+
|
307
|
+
<span class='name'>form_fields</span>
|
308
|
+
|
309
|
+
|
310
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
—
|
315
|
+
<div class='inline'>
|
316
|
+
<p>Hash with all form fields with values</p>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
</li>
|
320
|
+
|
321
|
+
<li>
|
322
|
+
|
323
|
+
<span class='name'>signature_key</span>
|
324
|
+
|
325
|
+
|
326
|
+
<span class='type'>(<tt>String</tt>)</span>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
—
|
331
|
+
<div class='inline'>
|
332
|
+
<p>defaults to Configuration.signature_key</p>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
</li>
|
336
|
+
|
337
|
+
<li>
|
338
|
+
|
339
|
+
<span class='name'>algorithm</span>
|
340
|
+
|
341
|
+
|
342
|
+
<span class='type'>(<tt>String</tt>)</span>
|
343
|
+
|
344
|
+
|
345
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
346
|
+
|
347
|
+
|
348
|
+
—
|
349
|
+
<div class='inline'>
|
350
|
+
<p>defaults to OpenPayU::Configuration.algorithm</p>
|
351
|
+
</div>
|
352
|
+
|
353
|
+
</li>
|
354
|
+
|
355
|
+
<li>
|
356
|
+
|
357
|
+
<span class='name'>merchant_pos_id</span>
|
358
|
+
|
359
|
+
|
360
|
+
<span class='type'>(<tt>String</tt>)</span>
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
—
|
365
|
+
<div class='inline'>
|
366
|
+
<p>defaults to Configuration.merchant_pos_id</p>
|
367
|
+
</div>
|
368
|
+
|
369
|
+
</li>
|
370
|
+
|
371
|
+
</ul>
|
372
|
+
|
373
|
+
<p class="tag_title">Returns:</p>
|
374
|
+
<ul class="return">
|
375
|
+
|
376
|
+
<li>
|
377
|
+
|
378
|
+
|
379
|
+
<span class='type'>(<tt>String</tt>)</span>
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
—
|
384
|
+
<div class='inline'>
|
385
|
+
<p>Signature that should be inserted to field with name “OpenPayu-Signature”</p>
|
386
|
+
</div>
|
387
|
+
|
388
|
+
</li>
|
389
|
+
|
390
|
+
</ul>
|
391
|
+
|
392
|
+
</div><table class="source_code">
|
393
|
+
<tr>
|
394
|
+
<td>
|
395
|
+
<pre class="lines">
|
396
|
+
|
397
|
+
|
398
|
+
39
|
399
|
+
40
|
400
|
+
41
|
401
|
+
42
|
402
|
+
43
|
403
|
+
44
|
404
|
+
45
|
405
|
+
46
|
406
|
+
47</pre>
|
407
|
+
</td>
|
408
|
+
<td>
|
409
|
+
<pre class="code"><span class="info file"># File 'lib/openpayu.rb', line 39</span>
|
410
|
+
|
411
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_sign_form'>sign_form</span><span class='lparen'>(</span><span class='id identifier rubyid_form_fields'>form_fields</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_algorithm'>algorithm</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_pos_id'>pos_id</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
412
|
+
<span class='id identifier rubyid_sorted_values'>sorted_values</span> <span class='op'>=</span> <span class='id identifier rubyid_form_fields'>form_fields</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_array'>array</span><span class='op'>|</span> <span class='id identifier rubyid_array'>array</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
|
413
|
+
<span class='const'>Document</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_generate_signature_structure'>generate_signature_structure</span><span class='lparen'>(</span>
|
414
|
+
<span class='id identifier rubyid_sorted_values'>sorted_values</span><span class='comma'>,</span>
|
415
|
+
<span class='id identifier rubyid_algorithm'>algorithm</span> <span class='op'>||</span> <span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_algorithm'>algorithm</span><span class='comma'>,</span>
|
416
|
+
<span class='id identifier rubyid_pos_id'>pos_id</span> <span class='op'>||</span> <span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_merchant_pos_id'>merchant_pos_id</span><span class='comma'>,</span>
|
417
|
+
<span class='id identifier rubyid_key'>key</span> <span class='op'>||</span> <span class='const'>Configuration</span><span class='period'>.</span><span class='id identifier rubyid_signature_key'>signature_key</span>
|
418
|
+
<span class='rparen'>)</span>
|
419
|
+
<span class='kw'>end</span></pre>
|
420
|
+
</td>
|
421
|
+
</tr>
|
422
|
+
</table>
|
423
|
+
</div>
|
424
|
+
|
425
|
+
</div>
|
426
|
+
|
427
|
+
</div>
|
428
|
+
|
429
|
+
<div id="footer">
|
430
|
+
Generated on Tue Dec 17 15:20:58 2013 by
|
431
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
432
|
+
0.8.7.2 (ruby-1.9.3).
|
433
|
+
</div>
|
434
|
+
|
435
|
+
</body>
|
436
|
+
</html>
|