twocheckout 0.1.2 → 0.1.3

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.
@@ -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=\"Proceed to Checkout\" />\n</form>"
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=\"Proceed to Checkout\" />\n</form>\n"
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
 
@@ -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.2'
7
+ s.version = '0.1.3'
8
8
  s.summary = '2Checkout Ruby Library'
9
- s.description = '0.1.2'
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.2
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-04-26 00:00:00.000000000 Z
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.2
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.1.gem
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.25
79
+ rubygems_version: 1.8.24
80
80
  signing_key:
81
81
  specification_version: 3
82
82
  summary: 2Checkout Ruby Library
Binary file