activemerchant 1.0.0
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 +40 -0
- data/MIT-LICENSE +20 -0
- data/README +93 -0
- data/lib/active_merchant.rb +59 -0
- data/lib/active_merchant/billing/base.rb +52 -0
- data/lib/active_merchant/billing/credit_card.rb +217 -0
- data/lib/active_merchant/billing/gateway.rb +100 -0
- data/lib/active_merchant/billing/gateways.rb +15 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +236 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +92 -0
- data/lib/active_merchant/billing/gateways/eway.rb +235 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +445 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +205 -0
- data/lib/active_merchant/billing/gateways/payflow.rb +84 -0
- data/lib/active_merchant/billing/gateways/payflow/f73e89fd.0 +17 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +190 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +30 -0
- data/lib/active_merchant/billing/gateways/payflow_express.rb +123 -0
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +9 -0
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +17 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +90 -0
- data/lib/active_merchant/billing/gateways/paypal/api_cert_chain.crt +35 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +208 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +30 -0
- data/lib/active_merchant/billing/gateways/paypal_express.rb +115 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +265 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +330 -0
- data/lib/active_merchant/billing/gateways/usa_epay.rb +189 -0
- data/lib/active_merchant/billing/integrations.rb +12 -0
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +65 -0
- data/lib/active_merchant/billing/integrations/bogus.rb +17 -0
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +17 -0
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +11 -0
- data/lib/active_merchant/billing/integrations/chronopay.rb +17 -0
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +81 -0
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +156 -0
- data/lib/active_merchant/billing/integrations/gestpay.rb +21 -0
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +42 -0
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +72 -0
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +83 -0
- data/lib/active_merchant/billing/integrations/helper.rb +79 -0
- data/lib/active_merchant/billing/integrations/nochex.rb +21 -0
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +68 -0
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +101 -0
- data/lib/active_merchant/billing/integrations/notification.rb +52 -0
- data/lib/active_merchant/billing/integrations/paypal.rb +35 -0
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +103 -0
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +187 -0
- data/lib/active_merchant/billing/response.rb +28 -0
- data/lib/active_merchant/lib/country.rb +297 -0
- data/lib/active_merchant/lib/posts_data.rb +21 -0
- data/lib/active_merchant/lib/requires_parameters.rb +17 -0
- data/lib/active_merchant/lib/validateable.rb +76 -0
- data/lib/tasks/cia.rb +90 -0
- metadata +129 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module PostsData #:nodoc:
|
3
|
+
|
4
|
+
def included?(base)
|
5
|
+
base.class_eval do
|
6
|
+
attr_accessor :ssl_strict
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def ssl_post(url, data, headers = {})
|
11
|
+
uri = URI.parse(url)
|
12
|
+
|
13
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
14
|
+
|
15
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless @ssl_strict
|
16
|
+
http.use_ssl = true
|
17
|
+
|
18
|
+
http.post(uri.path, data, headers).body
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module RequiresParameters #:nodoc:
|
3
|
+
def requires!(hash, *params)
|
4
|
+
keys = hash.keys
|
5
|
+
params.each do |param|
|
6
|
+
if param.is_a?(Array)
|
7
|
+
raise ArgumentError.new("Missing required parameter: #{param}") unless keys.include?(param.first)
|
8
|
+
|
9
|
+
valid_options = param[1..-1]
|
10
|
+
raise ArgumentError.new("Parameter :#{param.first} must be one of #{valid_options.inspect}") unless valid_options.include?(hash[param.first])
|
11
|
+
else
|
12
|
+
raise ArgumentError.new("Missing required parameter: #{param}") unless keys.include?(param)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Validateable #:nodoc:
|
3
|
+
def valid?
|
4
|
+
errors.clear
|
5
|
+
|
6
|
+
before_validate if respond_to?(:before_validate)
|
7
|
+
validate if respond_to?(:validate)
|
8
|
+
|
9
|
+
errors.empty?
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize(attributes = {})
|
13
|
+
self.attributes = attributes
|
14
|
+
end
|
15
|
+
|
16
|
+
def errors
|
17
|
+
@errors ||= Error.new(self)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def attributes=(attributes)
|
23
|
+
unless attributes.nil?
|
24
|
+
for key, value in attributes
|
25
|
+
send("#{key}=", value )
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# This hash keeps the errors of the object
|
31
|
+
class Error < Hash
|
32
|
+
|
33
|
+
def initialize(base)
|
34
|
+
@base = base
|
35
|
+
end
|
36
|
+
|
37
|
+
def count
|
38
|
+
size
|
39
|
+
end
|
40
|
+
|
41
|
+
# returns a specific fields error message.
|
42
|
+
# if more than one error is available we will only return the first. If no error is available
|
43
|
+
# we return an empty string
|
44
|
+
def on(field)
|
45
|
+
self[field].to_a.first
|
46
|
+
end
|
47
|
+
|
48
|
+
def add(field, error)
|
49
|
+
self[field] ||= []
|
50
|
+
self[field] << error
|
51
|
+
end
|
52
|
+
|
53
|
+
def add_to_base(error)
|
54
|
+
add(:base, error)
|
55
|
+
end
|
56
|
+
|
57
|
+
def each_full
|
58
|
+
full_messages.each { |msg| yield msg }
|
59
|
+
end
|
60
|
+
|
61
|
+
def full_messages
|
62
|
+
result = []
|
63
|
+
|
64
|
+
self.each do |key, messages|
|
65
|
+
if key == :base
|
66
|
+
result << "#{messages.first}"
|
67
|
+
else
|
68
|
+
result << "#{key.to_s.humanize} #{messages.first}"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
result
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
data/lib/tasks/cia.rb
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
# Figure out the root path of this app. The default method will assume that
|
2
|
+
# its the same as the location of the running Rakefile
|
3
|
+
ROOT = File.expand_path(FileUtils.pwd) + '/'
|
4
|
+
|
5
|
+
# Standard settings, you can override each of them using the environment
|
6
|
+
# e.g. rake cia EMAIL_TO=your@email.com
|
7
|
+
#
|
8
|
+
RAKE_TASK = ENV['RAKE_TASK'] || ''
|
9
|
+
EMAIL_TO = ENV['EMAIL_TO'] || 'tobi@leetsoft.com'
|
10
|
+
EMAIL_FROM = ENV['EMAIL_FROM'] || 'CIA <cia@jadedpixel.com>'
|
11
|
+
|
12
|
+
# Get last segment of application's path and treat it as name.
|
13
|
+
NAME = ENV['NAME'] || ROOT.scan(/(\w+)\/$/).flatten.first.capitalize
|
14
|
+
|
15
|
+
|
16
|
+
class Build
|
17
|
+
attr_reader :status, :output, :success
|
18
|
+
|
19
|
+
def self.run
|
20
|
+
Build.new.run
|
21
|
+
end
|
22
|
+
|
23
|
+
def run
|
24
|
+
update if @status.nil?
|
25
|
+
make if @success.nil?
|
26
|
+
end
|
27
|
+
|
28
|
+
def revision
|
29
|
+
info['Revision'].to_i
|
30
|
+
end
|
31
|
+
|
32
|
+
def url
|
33
|
+
info['URL']
|
34
|
+
end
|
35
|
+
|
36
|
+
def commit_message
|
37
|
+
`svn log #{ROOT} -rHEAD`
|
38
|
+
end
|
39
|
+
|
40
|
+
def author
|
41
|
+
info['Last Changed Author']
|
42
|
+
end
|
43
|
+
|
44
|
+
def tests_ok?
|
45
|
+
run if @success.nil?
|
46
|
+
@success == true
|
47
|
+
end
|
48
|
+
|
49
|
+
def has_changes?
|
50
|
+
update if @status.nil?
|
51
|
+
@status =~ /[A-Z]\s+[\w\/]+/
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def update
|
57
|
+
@status = `svn update #{ROOT}`
|
58
|
+
end
|
59
|
+
|
60
|
+
def info
|
61
|
+
@info ||= YAML.load(`svn info #{ROOT}`)
|
62
|
+
end
|
63
|
+
|
64
|
+
def make
|
65
|
+
@output, @success = `cd #{ROOT} && rake #{RAKE_TASK}`, ($?.exitstatus == 0)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
task :cia do
|
70
|
+
build = Build.new
|
71
|
+
|
72
|
+
if build.has_changes? and not build.tests_ok?
|
73
|
+
|
74
|
+
require_gem 'actionmailer'
|
75
|
+
|
76
|
+
ActionMailer::Base.delivery_method = :sendmail
|
77
|
+
|
78
|
+
class Notifier < ActionMailer::Base
|
79
|
+
def failure(build, sent_at = Time.now)
|
80
|
+
@subject = "[#{NAME}] Build Failure (##{build.revision})"
|
81
|
+
@recipients, @from, @sent_on = EMAIL_TO, EMAIL_FROM, sent_at
|
82
|
+
@body = ["#{build.author} broke the build!", build.commit_message, build.output].join("\n\n")
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
Notifier.deliver_failure(build)
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.0
|
3
|
+
specification_version: 1
|
4
|
+
name: activemerchant
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 1.0.0
|
7
|
+
date: 2007-02-20 00:00:00 -05:00
|
8
|
+
summary: Framework and tools for dealing with credit card transactions.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: tobi@leetsoft.com
|
12
|
+
homepage: http://activemerchant.org/
|
13
|
+
rubyforge_project:
|
14
|
+
description:
|
15
|
+
autorequire: active_merchant
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Tobias Luetke
|
31
|
+
files:
|
32
|
+
- README
|
33
|
+
- MIT-LICENSE
|
34
|
+
- CHANGELOG
|
35
|
+
- lib/active_merchant
|
36
|
+
- lib/active_merchant.rb
|
37
|
+
- lib/tasks
|
38
|
+
- lib/active_merchant/billing
|
39
|
+
- lib/active_merchant/lib
|
40
|
+
- lib/active_merchant/billing/base.rb
|
41
|
+
- lib/active_merchant/billing/credit_card.rb
|
42
|
+
- lib/active_merchant/billing/gateway.rb
|
43
|
+
- lib/active_merchant/billing/gateways
|
44
|
+
- lib/active_merchant/billing/gateways.rb
|
45
|
+
- lib/active_merchant/billing/integrations
|
46
|
+
- lib/active_merchant/billing/integrations.rb
|
47
|
+
- lib/active_merchant/billing/response.rb
|
48
|
+
- lib/active_merchant/billing/gateways/authorize_net.rb
|
49
|
+
- lib/active_merchant/billing/gateways/bogus.rb
|
50
|
+
- lib/active_merchant/billing/gateways/eway.rb
|
51
|
+
- lib/active_merchant/billing/gateways/linkpoint.rb
|
52
|
+
- lib/active_merchant/billing/gateways/moneris.rb
|
53
|
+
- lib/active_merchant/billing/gateways/payflow
|
54
|
+
- lib/active_merchant/billing/gateways/payflow.rb
|
55
|
+
- lib/active_merchant/billing/gateways/payflow_express.rb
|
56
|
+
- lib/active_merchant/billing/gateways/payflow_express_uk.rb
|
57
|
+
- lib/active_merchant/billing/gateways/payflow_uk.rb
|
58
|
+
- lib/active_merchant/billing/gateways/paypal
|
59
|
+
- lib/active_merchant/billing/gateways/paypal.rb
|
60
|
+
- lib/active_merchant/billing/gateways/paypal_express.rb
|
61
|
+
- lib/active_merchant/billing/gateways/psigate.rb
|
62
|
+
- lib/active_merchant/billing/gateways/trust_commerce.rb
|
63
|
+
- lib/active_merchant/billing/gateways/usa_epay.rb
|
64
|
+
- lib/active_merchant/billing/gateways/payflow/f73e89fd.0
|
65
|
+
- lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb
|
66
|
+
- lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb
|
67
|
+
- lib/active_merchant/billing/gateways/paypal/api_cert_chain.crt
|
68
|
+
- lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb
|
69
|
+
- lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb
|
70
|
+
- lib/active_merchant/billing/integrations/action_view_helper.rb
|
71
|
+
- lib/active_merchant/billing/integrations/bogus
|
72
|
+
- lib/active_merchant/billing/integrations/bogus.rb
|
73
|
+
- lib/active_merchant/billing/integrations/chronopay
|
74
|
+
- lib/active_merchant/billing/integrations/chronopay.rb
|
75
|
+
- lib/active_merchant/billing/integrations/gestpay
|
76
|
+
- lib/active_merchant/billing/integrations/gestpay.rb
|
77
|
+
- lib/active_merchant/billing/integrations/helper.rb
|
78
|
+
- lib/active_merchant/billing/integrations/nochex
|
79
|
+
- lib/active_merchant/billing/integrations/nochex.rb
|
80
|
+
- lib/active_merchant/billing/integrations/notification.rb
|
81
|
+
- lib/active_merchant/billing/integrations/paypal
|
82
|
+
- lib/active_merchant/billing/integrations/paypal.rb
|
83
|
+
- lib/active_merchant/billing/integrations/bogus/helper.rb
|
84
|
+
- lib/active_merchant/billing/integrations/bogus/notification.rb
|
85
|
+
- lib/active_merchant/billing/integrations/chronopay/helper.rb
|
86
|
+
- lib/active_merchant/billing/integrations/chronopay/notification.rb
|
87
|
+
- lib/active_merchant/billing/integrations/gestpay/common.rb
|
88
|
+
- lib/active_merchant/billing/integrations/gestpay/helper.rb
|
89
|
+
- lib/active_merchant/billing/integrations/gestpay/notification.rb
|
90
|
+
- lib/active_merchant/billing/integrations/nochex/helper.rb
|
91
|
+
- lib/active_merchant/billing/integrations/nochex/notification.rb
|
92
|
+
- lib/active_merchant/billing/integrations/paypal/helper.rb
|
93
|
+
- lib/active_merchant/billing/integrations/paypal/notification.rb
|
94
|
+
- lib/active_merchant/lib/country.rb
|
95
|
+
- lib/active_merchant/lib/posts_data.rb
|
96
|
+
- lib/active_merchant/lib/requires_parameters.rb
|
97
|
+
- lib/active_merchant/lib/validateable.rb
|
98
|
+
- lib/tasks/cia.rb
|
99
|
+
test_files: []
|
100
|
+
|
101
|
+
rdoc_options: []
|
102
|
+
|
103
|
+
extra_rdoc_files: []
|
104
|
+
|
105
|
+
executables: []
|
106
|
+
|
107
|
+
extensions: []
|
108
|
+
|
109
|
+
requirements: []
|
110
|
+
|
111
|
+
dependencies:
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: activesupport
|
114
|
+
version_requirement:
|
115
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 1.4.1
|
120
|
+
version:
|
121
|
+
- !ruby/object:Gem::Dependency
|
122
|
+
name: builder
|
123
|
+
version_requirement:
|
124
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: 2.0.0
|
129
|
+
version:
|