twocheckout 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2a2acbfc07a3287a39e71714a070b5911d147e25
4
+ data.tar.gz: c801f81540adb9d02a2075221ed5150a33a49cf7
5
+ SHA512:
6
+ metadata.gz: 4ab8f184567bf54ef622302fef869cdbf306c63b13374ed728de7a878c62a7c52829a594ef6d564e10fd2e1c0cb29a0550faf64c4e6d29c2f1c4127986a3ffed
7
+ data.tar.gz: 7523bb892b93543c8ccbf4ae000c37e3e2b38b17d3e4c57a85dfd5ab7e6e8dd2e86e3ca0b46452251fad6e0c7d854b3c69e12de0ee0f6764da8dbdcf6c597854
@@ -9,8 +9,8 @@ module Twocheckout
9
9
  end
10
10
 
11
11
  def self.purchase(options)
12
- options[:demo] == 'Y' ? 1 : options[:order_number]
13
- if valid?(options[:secret], options[:sid], options[:order_number], options[:total], options[:key])
12
+ oid = options[:demo] == 'Y' ? 1 : options[:order_number]
13
+ if valid?(options[:secret], options[:sid], oid, options[:total], options[:key])
14
14
  {:code => "PASS", :message => "Hash Matched"}
15
15
  else
16
16
  {:code => "FAIL", :message => "Hash Mismatch"}
@@ -189,6 +189,13 @@ describe Twocheckout::Coupon do
189
189
  end
190
190
 
191
191
  describe Twocheckout::ValidateResponse do
192
+ #demo
193
+ it "Validates Purchase MD5 Hash" do
194
+ result = Twocheckout::ValidateResponse.purchase({:sid => 1817037, :secret => "tango", :order_number => 1, :total => 0.01,
195
+ :key => '1BC47EA0D63EB76496E294F434138AD3'})
196
+ assert_equal('PASS', result[:code])
197
+ end
198
+
192
199
  #purchase
193
200
  it "Validates Purchase MD5 Hash" do
194
201
  result = Twocheckout::ValidateResponse.purchase({:sid => 1817037, :secret => "tango", :order_number => 4789848870, :total => 0.01,
@@ -224,7 +231,7 @@ describe Twocheckout::Checkout do
224
231
  "<input type=\"hidden\" name=\"sid\" value=\"1817037\" />\n" +
225
232
  "<input type=\"hidden\" name=\"cart_order_id\" value=\"Example Sale\" />\n" +
226
233
  "<input type=\"hidden\" name=\"total\" value=\"1.00\" />\n" +
227
- "<input type=\"submit\" value=\"Proceed to Checkout\" />\n" +
234
+ "<input type=\"submit\" value=\"Proceed\" />\n" +
228
235
  "</form>"
229
236
  assert_equal(form, @form)
230
237
  end
Binary file
data/twocheckout.gemspec CHANGED
@@ -4,9 +4,9 @@ $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
4
4
  Gem::Specification.new do |s|
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.name = 'twocheckout'
7
- s.version = '0.1.3'
7
+ s.version = '0.1.4'
8
8
  s.summary = '2Checkout Ruby Library'
9
- s.description = '0.1.3'
9
+ s.description = '0.1.4'
10
10
  s.summary = '2Checkout Ruby Library'
11
11
  s.author = "Craig Christenson", "Ernesto Garcia"
12
12
  s.email = 'christensoncraig@gmail.com'
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twocheckout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
5
- prerelease:
4
+ version: 0.1.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Craig Christenson
@@ -10,12 +9,11 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-05-06 00:00:00.000000000 Z
12
+ date: 2013-06-06 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rest-client
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ~>
21
19
  - !ruby/object:Gem::Version
@@ -23,12 +21,11 @@ dependencies:
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ~>
29
26
  - !ruby/object:Gem::Version
30
27
  version: '1.4'
31
- description: 0.1.3
28
+ description: 0.1.4
32
29
  email: christensoncraig@gmail.com
33
30
  executables: []
34
31
  extensions: []
@@ -53,31 +50,30 @@ files:
53
50
  - lib/twocheckout/version.rb
54
51
  - test/minitest_helper.rb
55
52
  - test/twocheckout_test.rb
56
- - twocheckout-0.1.2.gem
53
+ - twocheckout-0.1.3.gem
57
54
  - twocheckout.gemspec
58
55
  homepage: https://github.com/craigchristenson
59
56
  licenses: []
57
+ metadata: {}
60
58
  post_install_message:
61
59
  rdoc_options: []
62
60
  require_paths:
63
61
  - lib
64
62
  required_ruby_version: !ruby/object:Gem::Requirement
65
- none: false
66
63
  requirements:
67
- - - ! '>='
64
+ - - '>='
68
65
  - !ruby/object:Gem::Version
69
66
  version: '0'
70
67
  required_rubygems_version: !ruby/object:Gem::Requirement
71
- none: false
72
68
  requirements:
73
- - - ! '>='
69
+ - - '>='
74
70
  - !ruby/object:Gem::Version
75
71
  version: '0'
76
72
  requirements:
77
73
  - none
78
74
  rubyforge_project:
79
- rubygems_version: 1.8.24
75
+ rubygems_version: 2.0.3
80
76
  signing_key:
81
- specification_version: 3
77
+ specification_version: 4
82
78
  summary: 2Checkout Ruby Library
83
79
  test_files: []
Binary file