twocheckout 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/twocheckout/checkout.rb +4 -4
- data/test/twocheckout_test.rb +1 -1
- data/twocheckout-0.1.2.gem +0 -0
- data/twocheckout.gemspec +2 -2
- metadata +5 -5
- data/twocheckout-0.1.1.gem +0 -0
data/lib/twocheckout/checkout.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
module Twocheckout
|
2
2
|
class Checkout
|
3
3
|
|
4
|
-
def self.form(params={})
|
4
|
+
def self.form(params={}, button_text='Proceed to Checkout')
|
5
5
|
@form = "<form id=\"2checkout\" action=\"https://www.2checkout.com/checkout/purchase\" method=\"post\">\n";
|
6
6
|
params.each do |k,v|
|
7
7
|
@form = @form + "<input type=\"hidden\" name=\"" + k + "\" value=\"" + v.to_s + "\" />\n"
|
8
8
|
end
|
9
|
-
@form + "<input type=\"submit\" value=\"
|
9
|
+
@form + "<input type=\"submit\" value=\"" + button_text + "\" />\n</form>"
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.submit(params={})
|
@@ -18,12 +18,12 @@ module Twocheckout
|
|
18
18
|
@form = @form + "<script type=\"text/javascript\">document.getElementById('2checkout').submit();</script>"
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.direct(params={})
|
21
|
+
def self.direct(params={}, button_text='Proceed to Checkout')
|
22
22
|
@form = "<form id=\"2checkout\" action=\"https://www.2checkout.com/checkout/purchase\" method=\"post\">\n";
|
23
23
|
params.each do |k,v|
|
24
24
|
@form = @form + "<input type=\"hidden\" name=\"" + k + "\" value=\"" + v.to_s + "\" />\n"
|
25
25
|
end
|
26
|
-
@form = @form + "<input type=\"submit\" value=\"
|
26
|
+
@form = @form + "<input type=\"submit\" value=\"" + button_text + "\" />\n</form>\n"
|
27
27
|
@form = @form + "<script src=\"https://www.2checkout.com/static/checkout/javascript/direct.min.js\"></script>"
|
28
28
|
end
|
29
29
|
|
data/test/twocheckout_test.rb
CHANGED
@@ -219,7 +219,7 @@ describe Twocheckout::Checkout do
|
|
219
219
|
|
220
220
|
#form
|
221
221
|
it "Form returns a form" do
|
222
|
-
form = Twocheckout::Checkout.form({ 'sid' => '1817037', 'cart_order_id' => 'Example Sale', 'total' => '1.00'})
|
222
|
+
form = Twocheckout::Checkout.form({ 'sid' => '1817037', 'cart_order_id' => 'Example Sale', 'total' => '1.00'}, "Proceed")
|
223
223
|
@form = "<form id=\"2checkout\" action=\"https://www.2checkout.com/checkout/purchase\" method=\"post\">\n" +
|
224
224
|
"<input type=\"hidden\" name=\"sid\" value=\"1817037\" />\n" +
|
225
225
|
"<input type=\"hidden\" name=\"cart_order_id\" value=\"Example Sale\" />\n" +
|
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.
|
7
|
+
s.version = '0.1.3'
|
8
8
|
s.summary = '2Checkout Ruby Library'
|
9
|
-
s.description = '0.1.
|
9
|
+
s.description = '0.1.3'
|
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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twocheckout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-05-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|
@@ -28,7 +28,7 @@ dependencies:
|
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: '1.4'
|
31
|
-
description: 0.1.
|
31
|
+
description: 0.1.3
|
32
32
|
email: christensoncraig@gmail.com
|
33
33
|
executables: []
|
34
34
|
extensions: []
|
@@ -53,7 +53,7 @@ files:
|
|
53
53
|
- lib/twocheckout/version.rb
|
54
54
|
- test/minitest_helper.rb
|
55
55
|
- test/twocheckout_test.rb
|
56
|
-
- twocheckout-0.1.
|
56
|
+
- twocheckout-0.1.2.gem
|
57
57
|
- twocheckout.gemspec
|
58
58
|
homepage: https://github.com/craigchristenson
|
59
59
|
licenses: []
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
requirements:
|
77
77
|
- none
|
78
78
|
rubyforge_project:
|
79
|
-
rubygems_version: 1.8.
|
79
|
+
rubygems_version: 1.8.24
|
80
80
|
signing_key:
|
81
81
|
specification_version: 3
|
82
82
|
summary: 2Checkout Ruby Library
|
data/twocheckout-0.1.1.gem
DELETED
Binary file
|