webmoney 0.0.12 → 0.0.13
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.
- data/ChangeLog +9 -2
- data/Gemfile +3 -3
- data/{README → README.md} +80 -35
- data/RUNNING_TESTS +2 -2
- data/VERSION +1 -1
- data/lib/interfaces.rb +48 -22
- data/lib/request_result.rb +7 -1
- data/lib/request_retval.rb +8 -0
- data/lib/request_xml.rb +22 -0
- data/lib/webmoney.rb +41 -34
- data/rakefile +2 -3
- data/spec/unit/check_user.rb +33 -0
- data/spec/unit/iconv_spec.rb +7 -3
- data/spec/unit/interfaces_spec.rb +34 -0
- data/spec/unit/login_spec.rb +32 -0
- data/spec/unit/passport_spec.rb +4 -0
- data/spec/unit/webmoney_spec.rb +1 -48
- data/{lib/certs → ssl-certs}/AddTrust_External_Root.crt +0 -0
- data/{lib/certs → ssl-certs}/WebMoneyCA.crt +0 -0
- data/{lib/certs/0b532bc2.0 → ssl-certs/ca_bundle.crt} +27 -0
- data/webmoney.gemspec +25 -37
- metadata +75 -102
- data/Gemfile.lock +0 -31
- data/lib/certs/3c58f906.0 +0 -27
- data/spec/spec +0 -4
data/ChangeLog
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
ChangeLog
|
2
2
|
|
3
|
-
|
3
|
+
Wed Apr 11 2012 14:16:00 +0400
|
4
|
+
----------------------------
|
5
|
+
V 0.0.13
|
6
|
+
* Added check_owner X19
|
7
|
+
* Compatibility with ruby 1.9.3(-p0,-p125) ( String#encode instead Iconv)
|
8
|
+
* Merged certs into ca_bundle.crt (workaround new CApath hashes in openssl 1.0.0)
|
9
|
+
|
10
|
+
Tue Apr 26 2011 16:31:00 +0400
|
4
11
|
----------------------------
|
5
12
|
V 0.0.12
|
6
13
|
* Fix compile on gcc-4.5 under mingw (unnecessary macros removed)
|
@@ -121,4 +128,4 @@ Tue Aug 7 14:34:00 MSK 2007
|
|
121
128
|
* Bug fixes...
|
122
129
|
|
123
130
|
V 0.0.1
|
124
|
-
* Initial release
|
131
|
+
* Initial release
|
data/Gemfile
CHANGED
data/{README → README.md}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# About Webmoney library
|
2
2
|
|
3
3
|
This library should help to make requests to WebMoney Transfer http://www.wmtransfer.com
|
4
4
|
XML-interfaces: http://www.wmtransfer.com/eng/developers/interfaces/index.shtml
|
@@ -11,32 +11,35 @@ Reqirements: Nokogiri >= 1.4.1 built with libxml2 >= 2.7 (IMPORTANT!)
|
|
11
11
|
Author:: Alexander Oryol (mailto:eagle.alex@gmail.com)
|
12
12
|
License:: MIT License
|
13
13
|
|
14
|
-
|
14
|
+
# Request types
|
15
15
|
|
16
16
|
Completed:
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
-
|
26
|
-
-
|
17
|
+
|
18
|
+
* create_invoice - x1
|
19
|
+
* create_transaction - x2
|
20
|
+
* outgoing_invoices - x4
|
21
|
+
* send_message - x6
|
22
|
+
* find_wm - x8
|
23
|
+
* get_passport - x11
|
24
|
+
* i_trust - x15
|
25
|
+
* trust_me - x15
|
26
|
+
* check_user - x19
|
27
|
+
* bussines_level
|
28
|
+
* login
|
27
29
|
|
28
30
|
Incompleted (help need!):
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
|
32
|
+
* operation_history - x3
|
33
|
+
* finish_protect - x5
|
34
|
+
* check_sign - x7
|
35
|
+
* balance - x9
|
36
|
+
* incoming_invoices - x10
|
37
|
+
* reject_protection - x13
|
38
|
+
* transaction_moneyback - x14
|
39
|
+
* trust_save - x15
|
40
|
+
* create_purse - x16
|
41
|
+
* create_contract - x17
|
42
|
+
* transaction_get - x18
|
40
43
|
|
41
44
|
|
42
45
|
Please, see relative documentation and parameters on wiki:
|
@@ -51,27 +54,35 @@ http://www.wmtransfer.com/eng/developers/interfaces/xml/index.shtml
|
|
51
54
|
|
52
55
|
http://www.webmoney.ru/rus/developers/interfaces/xml/index.shtml (in russian)
|
53
56
|
|
54
|
-
|
57
|
+
# Examples
|
55
58
|
|
56
|
-
|
59
|
+
## Setup
|
57
60
|
|
61
|
+
```ruby
|
58
62
|
class MyWM
|
59
63
|
include Webmoney
|
60
64
|
end
|
65
|
+
```
|
61
66
|
|
67
|
+
```ruby
|
62
68
|
@wm = MyWM.new(:wmid => '123456789012', :password => 'my_pass', :key => 'gQABAIR6...2cC8FZTyKyjBM=')
|
63
69
|
|
64
70
|
wmid = '111222333444'
|
71
|
+
```
|
65
72
|
|
66
|
-
|
73
|
+
## Light
|
67
74
|
|
75
|
+
```ruby
|
68
76
|
cert = OpenSSL::X509::Certificate.new(File.read("webmoney.cert"))
|
69
77
|
key = OpenSSL::PKey::RSA.new(File.read("webmoney.key"), "password")
|
70
78
|
mywm = MyWM.new(:wmid => '123456789012', :cert => cert, :key => key)
|
79
|
+
```
|
71
80
|
|
72
|
-
|
81
|
+
## Passport (X11)
|
73
82
|
|
74
83
|
Get attestat data:
|
84
|
+
|
85
|
+
```ruby
|
75
86
|
passport = Webmoney::Passport.new(wmid)
|
76
87
|
passport.attestat # { # hash
|
77
88
|
# :attestat => 110, # == FORMAL attestat, as example
|
@@ -83,17 +94,25 @@ passport.wmids # All wmids attached to the attestat
|
|
83
94
|
passport.userinfo[:country] # => 'Russia' # Userinfo fields in string context
|
84
95
|
passport.userinfo[:country].checked # => true # with checked/locked attribute
|
85
96
|
passport.directory # Base dictionary
|
97
|
+
```
|
86
98
|
|
87
|
-
|
99
|
+
## Bussines level
|
88
100
|
|
101
|
+
```ruby
|
89
102
|
bl = @wm.request(:bussines_level, :wmid => wmid) # => 15
|
103
|
+
```
|
90
104
|
|
91
|
-
|
105
|
+
## Sending message
|
92
106
|
|
93
107
|
... for one message:
|
108
|
+
|
109
|
+
```ruby
|
94
110
|
@wm.request(:send_message, :wmid => wmid, :subj => 'Subject', :text => 'Body of \<b>message\</b>')
|
111
|
+
```
|
95
112
|
|
96
113
|
... for many messages (with queue):
|
114
|
+
|
115
|
+
```ruby
|
97
116
|
@wm.send_message(:wmid => wmid, :subj => 'Subject', :text => 'Body of \<b>message\</b>') do |msg, result|
|
98
117
|
File.open("logfile", "w") do |file|
|
99
118
|
case result
|
@@ -104,21 +123,27 @@ bl = @wm.request(:bussines_level, :wmid => wmid) # => 15
|
|
104
123
|
end
|
105
124
|
end
|
106
125
|
end
|
126
|
+
```
|
107
127
|
|
108
|
-
|
128
|
+
## Purses and WMIDs
|
109
129
|
|
130
|
+
```ruby
|
110
131
|
@wm.wmid_exist?('123456789012') # => true
|
111
132
|
|
112
133
|
purse = Purse.new('Z123456789012')
|
113
134
|
purse.wmid # => '123456789012'
|
114
135
|
purse.belong_to?('123456789012') # => true
|
136
|
+
```
|
115
137
|
|
138
|
+
## Example: Create invoice and check it's state
|
116
139
|
|
117
|
-
|
118
|
-
|
140
|
+
```ruby
|
119
141
|
@wm = MyWM.new(:wmid => '123456789012', :password => 'my_pass', :key => 'gQABAIR6...2cC8FZTyKyjBM=')
|
142
|
+
```
|
143
|
+
|
144
|
+
### Create invoice
|
120
145
|
|
121
|
-
|
146
|
+
```ruby
|
122
147
|
@invoice = @wm.request(:create_invoice,
|
123
148
|
:orderid => 5,
|
124
149
|
:amount => 10,
|
@@ -127,8 +152,11 @@ purse.belong_to?('123456789012') # => true
|
|
127
152
|
:desc => "Test invoice",
|
128
153
|
:address => "Delivery Address"
|
129
154
|
)
|
155
|
+
```
|
156
|
+
|
157
|
+
### Check state
|
130
158
|
|
131
|
-
|
159
|
+
```ruby
|
132
160
|
res = @wm.request(:outgoing_invoices,
|
133
161
|
:purse => STORE_PURSE,
|
134
162
|
:wminvid => @invoice[:id],
|
@@ -146,6 +174,23 @@ if res[:retval].should == 0 && !res[:invoices].empty?
|
|
146
174
|
when 3 then # Rejected
|
147
175
|
end
|
148
176
|
end
|
149
|
-
|
177
|
+
```
|
178
|
+
|
179
|
+
## Check purse owner
|
180
|
+
|
181
|
+
```ruby
|
182
|
+
res = @wm.request(:check_user,
|
183
|
+
:operation => {
|
184
|
+
:type => 2,
|
185
|
+
:amount => 100,
|
186
|
+
:pursetype => "WMZ"
|
187
|
+
},
|
188
|
+
:userinfo => {
|
189
|
+
:wmid => "123445532523",
|
190
|
+
:iname => "Alexander",
|
191
|
+
:fname => "Ivanov"
|
192
|
+
}
|
193
|
+
)
|
194
|
+
```
|
150
195
|
|
151
196
|
Also, see spec/* for examples.
|
data/RUNNING_TESTS
CHANGED
@@ -18,8 +18,8 @@ second:
|
|
18
18
|
key: webmoney.key
|
19
19
|
wmz: Z012345678901
|
20
20
|
rid: 57f9ff86-1afb-431f-aff4-9dfb00b70773 # site RID from login.wmtransfer.com
|
21
|
-
|
22
|
-
|
21
|
+
iname: "Alexander" # should be real first name for this WMID
|
22
|
+
fname: "Ivanov" # should be real last name for this WMID
|
23
23
|
|
24
24
|
HOWTO convert Light-keys:
|
25
25
|
Russian: https://wiki.webmoney.ru/wiki/show/Konvertatsiya_klyuchey_WM_Keeper_Light_v_PEM_format
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.13
|
data/lib/interfaces.rb
CHANGED
@@ -1,28 +1,54 @@
|
|
1
1
|
module Webmoney
|
2
|
+
|
2
3
|
# Presets for interfaces
|
3
4
|
def interface_urls
|
4
5
|
{
|
5
|
-
:create_invoice
|
6
|
-
:create_transaction
|
7
|
-
:operation_history
|
8
|
-
:outgoing_invoices
|
9
|
-
:finish_protect
|
10
|
-
:send_message
|
11
|
-
:check_sign
|
12
|
-
:find_wm
|
13
|
-
:balance
|
14
|
-
:incoming_invoices
|
15
|
-
:get_passport
|
16
|
-
:reject_protection
|
17
|
-
:transaction_moneyback =>
|
18
|
-
:i_trust
|
19
|
-
:trust_me
|
20
|
-
:trust_save
|
21
|
-
:create_purse
|
22
|
-
:create_contract => 'https://arbitrage.webmoney.ru/xml/X17_CreateContract.aspx', # x17
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
6
|
+
:create_invoice => { :url => 'XMLInvoice.asp' }, # x1
|
7
|
+
:create_transaction => { :url => 'XMLTrans.asp' }, # x2
|
8
|
+
:operation_history => { :url => 'XMLOperations.asp' }, # x3
|
9
|
+
:outgoing_invoices => { :url => 'XMLOutInvoices.asp' }, # x4
|
10
|
+
:finish_protect => { :url => 'XMLFinishProtect.asp' }, # x5
|
11
|
+
:send_message => { :url => 'XMLSendMsg.asp' }, # x6
|
12
|
+
:check_sign => { :url => 'XMLClassicAuth.asp' }, # x7
|
13
|
+
:find_wm => { :url => 'XMLFindWMPurse.asp' }, # x8
|
14
|
+
:balance => { :url => 'XMLPurses.asp' }, # x9
|
15
|
+
:incoming_invoices => { :url => 'XMLInInvoices.asp' }, # x10
|
16
|
+
:get_passport => { :url => 'https://passport.webmoney.ru/asp/XMLGetWMPassport.asp' }, # x11
|
17
|
+
:reject_protection => { :url => 'XMLRejectProtect.asp' }, # x13
|
18
|
+
:transaction_moneyback => { :url => 'XMLTransMoneyback.asp' }, # x14
|
19
|
+
:i_trust => { :url => 'XMLTrustList.asp' }, # x15
|
20
|
+
:trust_me => { :url => 'XMLTrustList2.asp' }, # x15
|
21
|
+
:trust_save => { :url => 'XMLTrustSave2.asp' }, # x15
|
22
|
+
:create_purse => { :url => 'XMLCreatePurse.asp' }, # x16
|
23
|
+
:create_contract => { :url => 'https://arbitrage.webmoney.ru/xml/X17_CreateContract.aspx', }, # x17
|
24
|
+
:get_contract_info => { :url => 'https://arbitrage.webmoney.ru/xml/X17_GetContractInfo.aspx' }, # x17
|
25
|
+
:transaction_get => { :url => 'https://merchant.webmoney.ru/conf/xml/XMLTransGet.asp' }, # x18
|
26
|
+
:check_user => { :url => 'https://apipassport.webmoney.ru/XMLCheckUser.aspx', # x19
|
27
|
+
:x509 => lambda {|url| url.sub(/\.aspx$/, 'Cert.aspx')} },
|
28
|
+
:bussines_level => { :url => 'https://stats.wmtransfer.com/levels/XMLWMIDLevel.aspx' },
|
29
|
+
:login => { :url => 'https://login.wmtransfer.com/ws/authorize.xiface' }, # login
|
26
30
|
}
|
27
31
|
end
|
28
|
-
|
32
|
+
|
33
|
+
protected
|
34
|
+
|
35
|
+
def prepare_interface_urls
|
36
|
+
|
37
|
+
# default transform to x509 version for w3s urls
|
38
|
+
default_lambda = lambda {|url| url.sub(/\.asp$/, 'Cert.asp') }
|
39
|
+
|
40
|
+
@interfaces = interface_urls.inject({}) do |m,k|
|
41
|
+
url = k[1][:url]
|
42
|
+
unless url.match %r{^https://}
|
43
|
+
url = w3s_url + url
|
44
|
+
url = default_lambda.call(url) if !classic?
|
45
|
+
else
|
46
|
+
transform = k[1][:x509]
|
47
|
+
url = transform.call(url) if !classic? && transform && transform.respond_to?(:call)
|
48
|
+
end
|
49
|
+
m.merge!(k[0] => URI.parse(url))
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
data/lib/request_result.rb
CHANGED
@@ -69,7 +69,7 @@ module Webmoney::RequestResult # :nodoc:all
|
|
69
69
|
value = value.to_i if [:orderid, :tranid, :period, :expiration, :wmtranid, :state].include?(name)
|
70
70
|
value = value.to_f if [:rest, :amount, :comiss].include?(name)
|
71
71
|
value = Time.parse(value) if [:datecrt, :dateupd].include?(name)
|
72
|
-
value =
|
72
|
+
value = cp1251_to_utf8(value) if [:desc, :address].include?(name)
|
73
73
|
r[name] = value
|
74
74
|
end
|
75
75
|
r
|
@@ -98,4 +98,10 @@ module Webmoney::RequestResult # :nodoc:all
|
|
98
98
|
|
99
99
|
alias_method :result_i_trust, :result_trust_me
|
100
100
|
|
101
|
+
def result_check_user(doc)
|
102
|
+
{
|
103
|
+
:retval => doc.at('//retval').inner_html.to_i
|
104
|
+
}
|
105
|
+
end
|
106
|
+
|
101
107
|
end
|
data/lib/request_retval.rb
CHANGED
@@ -44,4 +44,12 @@ module Webmoney::RequestRetval # :nodoc:all
|
|
44
44
|
raise Webmoney::ResultError, [@error, @errormsg].join(' ') unless @error == 0
|
45
45
|
end
|
46
46
|
|
47
|
+
def retval_check_user(doc)
|
48
|
+
retval_element = doc.at('//retval')
|
49
|
+
@error = retval_element.inner_html.to_i
|
50
|
+
@errormsg = doc.at('//retdesc') ? doc.at('//retdesc').inner_html : ''
|
51
|
+
not_exception_result_errors = [0, 404]
|
52
|
+
raise Webmoney::ResultError, [@error, @errormsg].join(' ') unless not_exception_result_errors.include?(@error)
|
53
|
+
end
|
54
|
+
|
47
55
|
end
|
data/lib/request_xml.rb
CHANGED
@@ -171,4 +171,26 @@ module Webmoney::RequestXML # :nodoc:all
|
|
171
171
|
}
|
172
172
|
end
|
173
173
|
|
174
|
+
def xml_check_user(opt)
|
175
|
+
req = reqn()
|
176
|
+
Nokogiri::XML::Builder.new { |x|
|
177
|
+
x.send('passport.request') {
|
178
|
+
x.reqn req
|
179
|
+
x.signerwmid @wmid
|
180
|
+
x.sign sign("#{req}#{opt[:operation][:type]}#{opt[:userinfo][:wmid]}") if classic?
|
181
|
+
x.operation do
|
182
|
+
opt[:operation].each do |operation_key, operation_value|
|
183
|
+
operation_key = "#{operation_key}_" if operation_key.to_sym == :type
|
184
|
+
x.send(operation_key, operation_value)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
x.userinfo do
|
188
|
+
opt[:userinfo].each do |userinfo_key, userinfo_value|
|
189
|
+
x.send(userinfo_key, userinfo_value)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
}
|
193
|
+
}
|
194
|
+
end
|
195
|
+
|
174
196
|
end
|
data/lib/webmoney.rb
CHANGED
@@ -7,7 +7,6 @@ require 'time'
|
|
7
7
|
require 'net/http'
|
8
8
|
require 'net/https'
|
9
9
|
require 'rubygems'
|
10
|
-
require 'iconv'
|
11
10
|
require 'nokogiri'
|
12
11
|
|
13
12
|
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
|
@@ -75,33 +74,53 @@ module Webmoney
|
|
75
74
|
# ca_cert or default
|
76
75
|
@ca_cert =
|
77
76
|
if opt[:ca_cert].nil?
|
78
|
-
File.dirname(__FILE__) + '/../
|
77
|
+
File.dirname(__FILE__) + '/../ssl-certs/ca_bundle.crt'
|
79
78
|
else
|
80
79
|
opt[:ca_cert]
|
81
80
|
end
|
82
81
|
|
83
82
|
@rid = opt[:rid]
|
84
83
|
|
85
|
-
#
|
84
|
+
# encode will raise exception,
|
86
85
|
# when uncovertable character in input sequence. It is default behavior.
|
87
|
-
# With option :force_encoding
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
end
|
86
|
+
# With option :force_encoding uncovertable characters will be cutted.
|
87
|
+
@force_encoding = opt[:force_encoding]
|
88
|
+
|
89
|
+
# for backward compatibility with ruby 1.8
|
90
|
+
if String.new.respond_to?(:encode)
|
91
|
+
|
92
|
+
# was: @ic_out
|
93
|
+
def utf8_to_cp1251(str)
|
94
|
+
return str if str.nil? || str.length < 1
|
95
|
+
@force_encoding ? str.encode('CP1251', 'UTF-8', :undef => :replace, :replace => '') : str.encode('CP1251', 'UTF-8')
|
98
96
|
end
|
97
|
+
|
98
|
+
# was: @ic_in
|
99
|
+
def cp1251_to_utf8(str)
|
100
|
+
return str if str.empty?
|
101
|
+
str.encode('UTF-8', 'CP1251')
|
102
|
+
end
|
103
|
+
|
99
104
|
else
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
+
require 'iconv'
|
106
|
+
|
107
|
+
# was: @ic_out
|
108
|
+
def utf8_to_cp1251(str)
|
109
|
+
@force_encoding ? Iconv.iconv('CP1251//IGNORE', 'UTF-8', str)[0] : Iconv.iconv('CP1251', 'UTF-8', str)[0]
|
110
|
+
end
|
111
|
+
|
112
|
+
# was: @ic_in
|
113
|
+
def cp1251_to_utf8(str)
|
114
|
+
Iconv.iconv('UTF-8', 'CP1251', str)[0]
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def filter_str(str)
|
119
|
+
if @force_encoding
|
120
|
+
str_out = utf8_to_cp1251(str)
|
121
|
+
[cp1251_to_utf8(str_out), str_out]
|
122
|
+
else
|
123
|
+
[str, utf8_to_cp1251(str)]
|
105
124
|
end
|
106
125
|
end
|
107
126
|
|
@@ -159,25 +178,13 @@ module Webmoney
|
|
159
178
|
|
160
179
|
protected
|
161
180
|
|
162
|
-
def prepare_interface_urls
|
163
|
-
@interfaces = interface_urls.inject({}) do |m,k|
|
164
|
-
url = k[1]
|
165
|
-
url.sub!(/(\.asp)/, 'Cert.asp') if !classic? && url.match("^"+w3s_url)
|
166
|
-
m.merge!(k[0] => URI.parse(url))
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
181
|
# Make HTTPS request, return result body if 200 OK
|
171
182
|
|
172
183
|
def https_request(iface, xml)
|
173
184
|
@last_request = @last_response = nil
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
when String
|
178
|
-
URI.parse(iface)
|
179
|
-
end
|
180
|
-
raise ArgumentError, iface unless url
|
185
|
+
|
186
|
+
url = @interfaces[iface]
|
187
|
+
|
181
188
|
http = Net::HTTP.new(url.host, url.port)
|
182
189
|
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
183
190
|
if File.file? @ca_cert
|
data/rakefile
CHANGED
@@ -28,9 +28,8 @@ spec = begin
|
|
28
28
|
gemspec.authors = ["Alexander Oryol"]
|
29
29
|
gemspec.email = "eagle.alex@gmail.com"
|
30
30
|
gemspec.summary = "Webmoney interfaces and native wmsigner"
|
31
|
-
gemspec.files
|
32
|
-
|
33
|
-
Dir.glob( 'tools/*.rb' )
|
31
|
+
gemspec.files += %w( ChangeLog ) + Dir.glob( 'ssl-certs/*.crt' )
|
32
|
+
gemspec.test_files += %w( Gemfile ) + Dir.glob( 'spec/**/*.rb' )
|
34
33
|
|
35
34
|
if RUBY_PLATFORM.match("win32")
|
36
35
|
gemspec.platform = Gem::Platform::WIN32
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "check_user (x19) interface" do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
@wm = webmoney()
|
8
|
+
@valid_params = {
|
9
|
+
:operation => {
|
10
|
+
:type => 2,
|
11
|
+
:amount => 100,
|
12
|
+
:pursetype => "WMZ"
|
13
|
+
},
|
14
|
+
:userinfo => {
|
15
|
+
:wmid => WmConfig.second['wmid'],
|
16
|
+
:iname => WmConfig.second['iname'],
|
17
|
+
:fname => WmConfig.second['fname']
|
18
|
+
}
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
it "retval 0 for valid wmid+iname+fname" do
|
23
|
+
result = @wm.request(:check_user, @valid_params)
|
24
|
+
result[:retval].should == 0
|
25
|
+
end
|
26
|
+
|
27
|
+
it "retval 404 for invalid wmid+iname+fname" do
|
28
|
+
@valid_params[:userinfo][:fname] = "invalid"
|
29
|
+
result = @wm.request(:check_user, @valid_params)
|
30
|
+
result[:retval].should == 404
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
data/spec/unit/iconv_spec.rb
CHANGED
@@ -7,14 +7,18 @@ describe 'filter_str' do
|
|
7
7
|
|
8
8
|
it "default behavior" do
|
9
9
|
@wm = TestWM.new
|
10
|
-
|
10
|
+
if String.new.respond_to?(:encode)
|
11
|
+
lambda { @wm.filter_str(test) }.should raise_error(Encoding::UndefinedConversionError)
|
12
|
+
else
|
13
|
+
lambda { @wm.filter_str(test) }.should raise_error(Iconv::IllegalSequence)
|
14
|
+
end
|
11
15
|
end
|
12
16
|
|
13
17
|
it "with force_encoding" do
|
14
18
|
@wm = TestWM.new(:force_encoding => true)
|
15
19
|
input, output = @wm.filter_str(test)
|
16
|
-
output.should ==
|
17
|
-
input.should
|
20
|
+
output.should == "nykpek-0001.xls"
|
21
|
+
input.should == "nykpek-0001.xls"
|
18
22
|
end
|
19
23
|
|
20
24
|
it "should send message with ignore characters" do
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "interfaces url" do
|
5
|
+
|
6
|
+
let(:wmc) { TestWM.new } # classic
|
7
|
+
let(:wml) { TestWM.new :wmid => WmConfig.first['wmid'], :key => nil } # light
|
8
|
+
|
9
|
+
it "should be exactly type" do
|
10
|
+
wmc.should be_classic # @wm.classic? == true
|
11
|
+
wml.should_not be_classic
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should be prepared" do
|
15
|
+
wmc.interfaces[:balance].class.should == URI::HTTPS
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should prepare url to classic version" do
|
19
|
+
# classic version
|
20
|
+
wmc.interfaces[:balance].to_s.should == 'https://w3s.wmtransfer.com/asp/XMLPurses.asp'
|
21
|
+
# non-converted
|
22
|
+
wmc.interfaces[:get_passport].to_s.should == 'https://passport.webmoney.ru/asp/XMLGetWMPassport.asp'
|
23
|
+
wmc.interfaces[:check_user].to_s.should == 'https://apipassport.webmoney.ru/XMLCheckUser.aspx'
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should prepare url to x509 version" do
|
27
|
+
# converted
|
28
|
+
wml.interfaces[:balance].to_s.should == 'https://w3s.wmtransfer.com/asp/XMLPursesCert.asp'
|
29
|
+
wml.interfaces[:check_user].to_s.should == 'https://apipassport.webmoney.ru/XMLCheckUserCert.aspx'
|
30
|
+
# non-converted
|
31
|
+
wml.interfaces[:get_passport].to_s.should == 'https://passport.webmoney.ru/asp/XMLGetWMPassport.asp'
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "login interface" do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
@ca = contragent()
|
8
|
+
end
|
9
|
+
|
10
|
+
it "return InvalidArgument" do
|
11
|
+
lambda { @ca.request(:login,
|
12
|
+
:WmLogin_WMID => @ca.wmid,
|
13
|
+
:WmLogin_UrlID => 'invalid_rid')
|
14
|
+
}.should raise_error(Webmoney::ResultError, "1 InvalidArgument")
|
15
|
+
@ca.error.should == 1
|
16
|
+
@ca.errormsg.should == 'InvalidArgument'
|
17
|
+
end
|
18
|
+
|
19
|
+
it "return InvalidTicket" do
|
20
|
+
lambda { @ca.request(:login,
|
21
|
+
:WmLogin_WMID => @ca.wmid,
|
22
|
+
:WmLogin_UrlID => @ca.rid,
|
23
|
+
:WmLogin_Ticket => 'XVWuooAEOJ0gG5NyDXJ0Zu0GffroqkG7APNKFmCAzA7XNVSx',
|
24
|
+
:WmLogin_AuthType => 'KeeperLight',
|
25
|
+
:remote_ip => '127.0.0.1'
|
26
|
+
)
|
27
|
+
}.should raise_error(Webmoney::ResultError)
|
28
|
+
@ca.error.should == 2
|
29
|
+
@ca.errormsg.should == 'FalseTicket'
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
data/spec/unit/passport_spec.rb
CHANGED
@@ -12,6 +12,10 @@ describe Webmoney::Passport, "class" do
|
|
12
12
|
Webmoney::Passport.new(@wm.wmid).should be_instance_of(Webmoney::Passport)
|
13
13
|
end
|
14
14
|
|
15
|
+
# If you get Webmoney::NonExistentWmidError, visit into browser
|
16
|
+
# http://passport.webmoney.ru/asp/CertView.asp?wmid=000000000001
|
17
|
+
# resolve captcha and retry
|
18
|
+
|
15
19
|
it "request result get_passport should be hash with data" do
|
16
20
|
wmid = '000000000007'
|
17
21
|
res = @wm.request(:get_passport, :wmid => wmid, :dict => 1)
|
data/spec/unit/webmoney_spec.rb
CHANGED
@@ -19,16 +19,6 @@ describe Webmoney, "class" do
|
|
19
19
|
(t2 > t1).should be_true
|
20
20
|
end
|
21
21
|
|
22
|
-
it "should correct prepare interfaces urls" do
|
23
|
-
wm = TestWM.new :wmid => WmConfig.first['wmid'], :key => nil
|
24
|
-
wm.should_not be_classic
|
25
|
-
wm.interfaces[:balance].class.should == URI::HTTPS
|
26
|
-
# converted to light-auth version
|
27
|
-
wm.interfaces[:balance].to_s.should == 'https://w3s.wmtransfer.com/asp/XMLPursesCert.asp'
|
28
|
-
# non-converted to light-auth version
|
29
|
-
wm.interfaces[:get_passport].to_s.should == 'https://passport.webmoney.ru/asp/XMLGetWMPassport.asp'
|
30
|
-
end
|
31
|
-
|
32
22
|
it "should correct reqn" do
|
33
23
|
Time.stub!(:now).and_return(Time.at(1244704683.69677))
|
34
24
|
@wm.send(:reqn).should == '09061111180369'
|
@@ -49,14 +39,6 @@ describe Webmoney, "class" do
|
|
49
39
|
doc.root.should_not be_nil
|
50
40
|
end
|
51
41
|
|
52
|
-
it"should raise error on bad response" do
|
53
|
-
lambda { @wm.send(:https_request,
|
54
|
-
'https://w3s.wmtransfer.com/asp/XMLUnexistantIface.asp', '<w3s.request/>')}.
|
55
|
-
should raise_error(Webmoney::RequestError)
|
56
|
-
@wm.error.should == '404'
|
57
|
-
@wm.errormsg.should match(/^<!DOCTYPE HTML PUBLIC/)
|
58
|
-
end
|
59
|
-
|
60
42
|
it "should parse retval and raise error" do
|
61
43
|
lambda { @wm.request(:send_message, :wmid => '')}.should raise_error(Webmoney::ResultError)
|
62
44
|
@wm.error.should == -2
|
@@ -87,7 +69,7 @@ describe Webmoney, "class" do
|
|
87
69
|
|
88
70
|
it "should check_sign with specials" do
|
89
71
|
plan = '<test>текст</test>'
|
90
|
-
real_plan =
|
72
|
+
real_plan = @wm.utf8_to_cp1251(plan)
|
91
73
|
begin
|
92
74
|
@wm.request(:check_sign,
|
93
75
|
:wmid => @wm.wmid,
|
@@ -193,33 +175,4 @@ describe Webmoney, "class" do
|
|
193
175
|
end
|
194
176
|
end
|
195
177
|
|
196
|
-
describe "login interface" do
|
197
|
-
|
198
|
-
before(:each) do
|
199
|
-
@ca = contragent()
|
200
|
-
end
|
201
|
-
|
202
|
-
it "return InvalidArgument" do
|
203
|
-
lambda { @ca.request(:login,
|
204
|
-
:WmLogin_WMID => @ca.wmid,
|
205
|
-
:WmLogin_UrlID => 'invalid_rid')
|
206
|
-
}.should raise_error(Webmoney::ResultError, "1 InvalidArgument")
|
207
|
-
@ca.error.should == 1
|
208
|
-
@ca.errormsg.should == 'InvalidArgument'
|
209
|
-
end
|
210
|
-
|
211
|
-
it "return InvalidTicket" do
|
212
|
-
lambda { @ca.request(:login,
|
213
|
-
:WmLogin_WMID => @ca.wmid,
|
214
|
-
:WmLogin_UrlID => @ca.rid,
|
215
|
-
:WmLogin_Ticket => 'XVWuooAEOJ0gG5NyDXJ0Zu0GffroqkG7APNKFmCAzA7XNVSx',
|
216
|
-
:WmLogin_AuthType => 'KeeperLight',
|
217
|
-
:remote_ip => '127.0.0.1'
|
218
|
-
)
|
219
|
-
}.should raise_error(Webmoney::ResultError)
|
220
|
-
@ca.error.should == 2
|
221
|
-
@ca.errormsg.should == 'FalseTicket'
|
222
|
-
end
|
223
|
-
end
|
224
|
-
|
225
178
|
end
|
File without changes
|
File without changes
|
@@ -1,4 +1,31 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJT
|
3
|
+
RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4
|
4
|
+
dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5h
|
5
|
+
bCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzEL
|
6
|
+
MAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1B
|
7
|
+
ZGRUcnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1
|
8
|
+
c3QgRXh0ZXJuYWwgQ0EgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
|
9
|
+
AQoCggEBALf3GjPm8gAELTngTlvtH7xsD821+iO2zt6bETOXpClMfZOfvUq8
|
10
|
+
k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfwTz/oMp50
|
11
|
+
ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504
|
12
|
+
B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDez
|
13
|
+
eWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5
|
14
|
+
aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0WicCAwEAAaOB
|
15
|
+
3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0PBAQD
|
16
|
+
AgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6
|
17
|
+
xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
|
18
|
+
cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdv
|
19
|
+
cmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJ
|
20
|
+
KoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl
|
21
|
+
j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5R
|
22
|
+
xNKWt9x+Tu5w/Rw56wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjT
|
23
|
+
K3rMUUKhemPR5ruhxSvCNr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1
|
24
|
+
n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHx
|
25
|
+
REzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49O
|
26
|
+
hgQ=
|
27
|
+
-----END CERTIFICATE-----
|
28
|
+
-----BEGIN CERTIFICATE-----
|
2
29
|
MIIFsTCCA5mgAwIBAgIQA7dHzSZ7uJdBxFycIWn+WjANBgkqhkiG9w0BAQUFADBr
|
3
30
|
MSswKQYDVQQLEyJXTSBUcmFuc2ZlciBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzMRgw
|
4
31
|
FgYDVQQKEw9XTSBUcmFuc2ZlciBMdGQxIjAgBgNVBAMTGVdlYk1vbmV5IFRyYW5z
|
data/webmoney.gemspec
CHANGED
@@ -4,23 +4,22 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.0.
|
7
|
+
s.name = "webmoney"
|
8
|
+
s.version = "0.0.13"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alexander Oryol"]
|
12
|
-
s.date =
|
13
|
-
s.email =
|
12
|
+
s.date = "2012-04-11"
|
13
|
+
s.email = "eagle.alex@gmail.com"
|
14
14
|
s.extensions = ["ext/wmsigner/extconf.rb"]
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"ChangeLog",
|
17
|
-
"README"
|
17
|
+
"README.md"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
"ChangeLog",
|
21
21
|
"Gemfile",
|
22
|
-
"
|
23
|
-
"README",
|
22
|
+
"README.md",
|
24
23
|
"RUNNING_TESTS",
|
25
24
|
"VERSION",
|
26
25
|
"ext/wmsigner/base64.cpp",
|
@@ -39,10 +38,6 @@ Gem::Specification.new do |s|
|
|
39
38
|
"ext/wmsigner/stdafx.cpp",
|
40
39
|
"ext/wmsigner/stdafx.h",
|
41
40
|
"ext/wmsigner/wmsigner.cpp",
|
42
|
-
"lib/certs/0b532bc2.0",
|
43
|
-
"lib/certs/3c58f906.0",
|
44
|
-
"lib/certs/AddTrust_External_Root.crt",
|
45
|
-
"lib/certs/WebMoneyCA.crt",
|
46
41
|
"lib/interfaces.rb",
|
47
42
|
"lib/messenger.rb",
|
48
43
|
"lib/passport.rb",
|
@@ -53,9 +48,11 @@ Gem::Specification.new do |s|
|
|
53
48
|
"lib/webmoney.rb",
|
54
49
|
"lib/wmid.rb",
|
55
50
|
"rakefile",
|
56
|
-
"spec/spec",
|
57
51
|
"spec/spec_helper.rb",
|
52
|
+
"spec/unit/check_user.rb",
|
58
53
|
"spec/unit/iconv_spec.rb",
|
54
|
+
"spec/unit/interfaces_spec.rb",
|
55
|
+
"spec/unit/login_spec.rb",
|
59
56
|
"spec/unit/messenger_spec.rb",
|
60
57
|
"spec/unit/passport_spec.rb",
|
61
58
|
"spec/unit/purse_spec.rb",
|
@@ -64,47 +61,38 @@ Gem::Specification.new do |s|
|
|
64
61
|
"spec/unit/trust_spec.rb",
|
65
62
|
"spec/unit/webmoney_spec.rb",
|
66
63
|
"spec/unit/wmid_spec.rb",
|
64
|
+
"ssl-certs/AddTrust_External_Root.crt",
|
65
|
+
"ssl-certs/WebMoneyCA.crt",
|
66
|
+
"ssl-certs/ca_bundle.crt",
|
67
67
|
"webmoney.gemspec"
|
68
68
|
]
|
69
69
|
s.require_paths = ["lib"]
|
70
|
-
s.rubyforge_project =
|
71
|
-
s.rubygems_version =
|
72
|
-
s.summary =
|
73
|
-
s.test_files = [
|
74
|
-
"spec/spec_helper.rb",
|
75
|
-
"spec/unit/iconv_spec.rb",
|
76
|
-
"spec/unit/messenger_spec.rb",
|
77
|
-
"spec/unit/passport_spec.rb",
|
78
|
-
"spec/unit/purse_spec.rb",
|
79
|
-
"spec/unit/signer_spec.rb",
|
80
|
-
"spec/unit/time_spec.rb",
|
81
|
-
"spec/unit/trust_spec.rb",
|
82
|
-
"spec/unit/webmoney_spec.rb",
|
83
|
-
"spec/unit/wmid_spec.rb"
|
84
|
-
]
|
70
|
+
s.rubyforge_project = "webmoney"
|
71
|
+
s.rubygems_version = "1.8.17"
|
72
|
+
s.summary = "Webmoney interfaces and native wmsigner"
|
73
|
+
s.test_files = ["Gemfile", "spec/spec_helper.rb", "spec/unit/interfaces_spec.rb", "spec/unit/check_user.rb", "spec/unit/purse_spec.rb", "spec/unit/messenger_spec.rb", "spec/unit/iconv_spec.rb", "spec/unit/webmoney_spec.rb", "spec/unit/signer_spec.rb", "spec/unit/time_spec.rb", "spec/unit/wmid_spec.rb", "spec/unit/trust_spec.rb", "spec/unit/login_spec.rb", "spec/unit/passport_spec.rb"]
|
85
74
|
|
86
75
|
if s.respond_to? :specification_version then
|
87
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
88
76
|
s.specification_version = 3
|
89
77
|
|
90
78
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
91
79
|
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
92
|
-
s.add_development_dependency(%q<rspec>, ["
|
93
|
-
s.add_development_dependency(%q<bundler>, ["
|
94
|
-
s.add_development_dependency(%q<jeweler>, ["
|
80
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
81
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
82
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
95
83
|
s.add_development_dependency(%q<rake-compiler>, [">= 0"])
|
96
84
|
else
|
97
85
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
98
|
-
s.add_dependency(%q<rspec>, ["
|
99
|
-
s.add_dependency(%q<bundler>, ["
|
100
|
-
s.add_dependency(%q<jeweler>, ["
|
86
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
87
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
88
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
101
89
|
s.add_dependency(%q<rake-compiler>, [">= 0"])
|
102
90
|
end
|
103
91
|
else
|
104
92
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
105
|
-
s.add_dependency(%q<rspec>, ["
|
106
|
-
s.add_dependency(%q<bundler>, ["
|
107
|
-
s.add_dependency(%q<jeweler>, ["
|
93
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
94
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
95
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
108
96
|
s.add_dependency(%q<rake-compiler>, [">= 0"])
|
109
97
|
end
|
110
98
|
end
|
metadata
CHANGED
@@ -1,107 +1,83 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmoney
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 12
|
9
|
-
version: 0.0.12
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.13
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Alexander Oryol
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-04-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: nokogiri
|
22
|
-
requirement: &
|
16
|
+
requirement: &84373370 !ruby/object:Gem::Requirement
|
23
17
|
none: false
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
- 0
|
29
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
30
22
|
type: :runtime
|
31
23
|
prerelease: false
|
32
|
-
version_requirements: *
|
33
|
-
- !ruby/object:Gem::Dependency
|
24
|
+
version_requirements: *84373370
|
25
|
+
- !ruby/object:Gem::Dependency
|
34
26
|
name: rspec
|
35
|
-
requirement: &
|
27
|
+
requirement: &84373070 !ruby/object:Gem::Requirement
|
36
28
|
none: false
|
37
|
-
requirements:
|
38
|
-
- -
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
|
41
|
-
- 2
|
42
|
-
- 3
|
43
|
-
- 0
|
44
|
-
version: 2.3.0
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
45
33
|
type: :development
|
46
34
|
prerelease: false
|
47
|
-
version_requirements: *
|
48
|
-
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: *84373070
|
36
|
+
- !ruby/object:Gem::Dependency
|
49
37
|
name: bundler
|
50
|
-
requirement: &
|
38
|
+
requirement: &84372740 !ruby/object:Gem::Requirement
|
51
39
|
none: false
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
|
56
|
-
- 1
|
57
|
-
- 0
|
58
|
-
- 0
|
59
|
-
version: 1.0.0
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
60
44
|
type: :development
|
61
45
|
prerelease: false
|
62
|
-
version_requirements: *
|
63
|
-
- !ruby/object:Gem::Dependency
|
46
|
+
version_requirements: *84372740
|
47
|
+
- !ruby/object:Gem::Dependency
|
64
48
|
name: jeweler
|
65
|
-
requirement: &
|
49
|
+
requirement: &84372410 !ruby/object:Gem::Requirement
|
66
50
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
|
71
|
-
- 1
|
72
|
-
- 5
|
73
|
-
- 2
|
74
|
-
version: 1.5.2
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
75
55
|
type: :development
|
76
56
|
prerelease: false
|
77
|
-
version_requirements: *
|
78
|
-
- !ruby/object:Gem::Dependency
|
57
|
+
version_requirements: *84372410
|
58
|
+
- !ruby/object:Gem::Dependency
|
79
59
|
name: rake-compiler
|
80
|
-
requirement: &
|
60
|
+
requirement: &84372120 !ruby/object:Gem::Requirement
|
81
61
|
none: false
|
82
|
-
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
86
|
-
- 0
|
87
|
-
version: "0"
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
88
66
|
type: :development
|
89
67
|
prerelease: false
|
90
|
-
version_requirements: *
|
68
|
+
version_requirements: *84372120
|
91
69
|
description:
|
92
70
|
email: eagle.alex@gmail.com
|
93
71
|
executables: []
|
94
|
-
|
95
|
-
extensions:
|
72
|
+
extensions:
|
96
73
|
- ext/wmsigner/extconf.rb
|
97
|
-
extra_rdoc_files:
|
74
|
+
extra_rdoc_files:
|
98
75
|
- ChangeLog
|
99
|
-
- README
|
100
|
-
files:
|
76
|
+
- README.md
|
77
|
+
files:
|
101
78
|
- ChangeLog
|
102
79
|
- Gemfile
|
103
|
-
-
|
104
|
-
- README
|
80
|
+
- README.md
|
105
81
|
- RUNNING_TESTS
|
106
82
|
- VERSION
|
107
83
|
- ext/wmsigner/base64.cpp
|
@@ -120,10 +96,6 @@ files:
|
|
120
96
|
- ext/wmsigner/stdafx.cpp
|
121
97
|
- ext/wmsigner/stdafx.h
|
122
98
|
- ext/wmsigner/wmsigner.cpp
|
123
|
-
- lib/certs/0b532bc2.0
|
124
|
-
- lib/certs/3c58f906.0
|
125
|
-
- lib/certs/AddTrust_External_Root.crt
|
126
|
-
- lib/certs/WebMoneyCA.crt
|
127
99
|
- lib/interfaces.rb
|
128
100
|
- lib/messenger.rb
|
129
101
|
- lib/passport.rb
|
@@ -134,9 +106,11 @@ files:
|
|
134
106
|
- lib/webmoney.rb
|
135
107
|
- lib/wmid.rb
|
136
108
|
- rakefile
|
137
|
-
- spec/spec
|
138
109
|
- spec/spec_helper.rb
|
110
|
+
- spec/unit/check_user.rb
|
139
111
|
- spec/unit/iconv_spec.rb
|
112
|
+
- spec/unit/interfaces_spec.rb
|
113
|
+
- spec/unit/login_spec.rb
|
140
114
|
- spec/unit/messenger_spec.rb
|
141
115
|
- spec/unit/passport_spec.rb
|
142
116
|
- spec/unit/purse_spec.rb
|
@@ -145,47 +119,46 @@ files:
|
|
145
119
|
- spec/unit/trust_spec.rb
|
146
120
|
- spec/unit/webmoney_spec.rb
|
147
121
|
- spec/unit/wmid_spec.rb
|
122
|
+
- ssl-certs/AddTrust_External_Root.crt
|
123
|
+
- ssl-certs/WebMoneyCA.crt
|
124
|
+
- ssl-certs/ca_bundle.crt
|
148
125
|
- webmoney.gemspec
|
149
|
-
has_rdoc: true
|
150
126
|
homepage:
|
151
127
|
licenses: []
|
152
|
-
|
153
128
|
post_install_message:
|
154
129
|
rdoc_options: []
|
155
|
-
|
156
|
-
require_paths:
|
130
|
+
require_paths:
|
157
131
|
- lib
|
158
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
159
133
|
none: false
|
160
|
-
requirements:
|
161
|
-
- -
|
162
|
-
- !ruby/object:Gem::Version
|
163
|
-
|
164
|
-
|
165
|
-
version: "0"
|
166
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ! '>='
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
139
|
none: false
|
168
|
-
requirements:
|
169
|
-
- -
|
170
|
-
- !ruby/object:Gem::Version
|
171
|
-
|
172
|
-
- 0
|
173
|
-
version: "0"
|
140
|
+
requirements:
|
141
|
+
- - ! '>='
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
174
144
|
requirements: []
|
175
|
-
|
176
145
|
rubyforge_project: webmoney
|
177
|
-
rubygems_version: 1.
|
146
|
+
rubygems_version: 1.8.17
|
178
147
|
signing_key:
|
179
148
|
specification_version: 3
|
180
149
|
summary: Webmoney interfaces and native wmsigner
|
181
|
-
test_files:
|
150
|
+
test_files:
|
151
|
+
- Gemfile
|
182
152
|
- spec/spec_helper.rb
|
183
|
-
- spec/unit/
|
184
|
-
- spec/unit/
|
185
|
-
- spec/unit/passport_spec.rb
|
153
|
+
- spec/unit/interfaces_spec.rb
|
154
|
+
- spec/unit/check_user.rb
|
186
155
|
- spec/unit/purse_spec.rb
|
156
|
+
- spec/unit/messenger_spec.rb
|
157
|
+
- spec/unit/iconv_spec.rb
|
158
|
+
- spec/unit/webmoney_spec.rb
|
187
159
|
- spec/unit/signer_spec.rb
|
188
160
|
- spec/unit/time_spec.rb
|
189
|
-
- spec/unit/trust_spec.rb
|
190
|
-
- spec/unit/webmoney_spec.rb
|
191
161
|
- spec/unit/wmid_spec.rb
|
162
|
+
- spec/unit/trust_spec.rb
|
163
|
+
- spec/unit/login_spec.rb
|
164
|
+
- spec/unit/passport_spec.rb
|
data/Gemfile.lock
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
diff-lcs (1.1.2)
|
5
|
-
git (1.2.5)
|
6
|
-
jeweler (1.5.2)
|
7
|
-
bundler (~> 1.0.0)
|
8
|
-
git (>= 1.2.5)
|
9
|
-
rake
|
10
|
-
nokogiri (1.4.4)
|
11
|
-
rake (0.8.7)
|
12
|
-
rake-compiler (0.7.5)
|
13
|
-
rake
|
14
|
-
rspec (2.3.0)
|
15
|
-
rspec-core (~> 2.3.0)
|
16
|
-
rspec-expectations (~> 2.3.0)
|
17
|
-
rspec-mocks (~> 2.3.0)
|
18
|
-
rspec-core (2.3.1)
|
19
|
-
rspec-expectations (2.3.0)
|
20
|
-
diff-lcs (~> 1.1.2)
|
21
|
-
rspec-mocks (2.3.0)
|
22
|
-
|
23
|
-
PLATFORMS
|
24
|
-
ruby
|
25
|
-
|
26
|
-
DEPENDENCIES
|
27
|
-
bundler (~> 1.0.0)
|
28
|
-
jeweler (~> 1.5.2)
|
29
|
-
nokogiri
|
30
|
-
rake-compiler
|
31
|
-
rspec (~> 2.3.0)
|
data/lib/certs/3c58f906.0
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJT
|
3
|
-
RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4
|
4
|
-
dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5h
|
5
|
-
bCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzEL
|
6
|
-
MAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1B
|
7
|
-
ZGRUcnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1
|
8
|
-
c3QgRXh0ZXJuYWwgQ0EgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
|
9
|
-
AQoCggEBALf3GjPm8gAELTngTlvtH7xsD821+iO2zt6bETOXpClMfZOfvUq8
|
10
|
-
k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfwTz/oMp50
|
11
|
-
ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504
|
12
|
-
B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDez
|
13
|
-
eWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5
|
14
|
-
aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0WicCAwEAAaOB
|
15
|
-
3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0PBAQD
|
16
|
-
AgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6
|
17
|
-
xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
|
18
|
-
cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdv
|
19
|
-
cmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJ
|
20
|
-
KoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl
|
21
|
-
j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5R
|
22
|
-
xNKWt9x+Tu5w/Rw56wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjT
|
23
|
-
K3rMUUKhemPR5ruhxSvCNr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1
|
24
|
-
n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHx
|
25
|
-
REzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49O
|
26
|
-
hgQ=
|
27
|
-
-----END CERTIFICATE-----
|
data/spec/spec
DELETED