versapay 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,5 +8,13 @@ module Versapay
8
8
  end
9
9
  "<a href=\"#{link}\">#{anchor}</a>"
10
10
  end
11
+
12
+ def payment_checkout_link_to(anchor, message = "Credit Card payment", opts = {})
13
+ link = "https://" + Versapay::site + "/send_money?api_token=#{Versapay.token}&message=#{html_escape(message).gsub(/ /, "+")}"
14
+ opts.each do |k, v|
15
+ link += "&#{k}=#{html_escape(v)}"
16
+ end
17
+ "<a href=\"#{link}\">#{anchor}</a>"
18
+ end
11
19
  end
12
20
  end
@@ -1,3 +1,3 @@
1
1
  module Versapay
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -15,4 +15,9 @@ class HelperTest < ActionView::TestCase
15
15
  assert_equal expected, debit_agreement_link_to("test", "Testing 123", {:reference => "abc123"})
16
16
  end
17
17
 
18
+ test "creating a credit card link" do
19
+ expected = '<a href="https://demo.versapay.com/send_money?api_token=' + Versapay::token + '&message=Testing+123&pref=cc">test</a>'
20
+ assert_equal expected, payment_checkout_link_to("test", "Testing 123", {:pref => "cc"})
21
+ end
22
+
18
23
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: versapay
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Walberg
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-14 00:00:00 -05:00
18
+ date: 2011-10-06 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency