vaulted_billing 0.0.15 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ module VaultedBilling
12
12
  # gateway in the library.
13
13
  #
14
14
  class GatewayConfiguration
15
- attr_accessor :username, :password, :test_mode
15
+ attr_accessor :username, :password, :test_mode, :raw_options
16
16
 
17
17
  ##
18
18
  # Possible options are:
@@ -27,6 +27,7 @@ module VaultedBilling
27
27
  options = options.with_indifferent_access
28
28
  self.username = options[:username]
29
29
  self.password = options[:password]
30
+ self.raw_options = options[:raw_options]
30
31
  self.test_mode = options.has_key?(:test_mode) ?
31
32
  options[:test_mode] : true
32
33
  yield(self) if block_given?
@@ -14,9 +14,10 @@ module VaultedBilling
14
14
  self.test_uri = 'https://apitest.authorize.net/xml/v1/request.api'
15
15
  self.live_uri = 'https://api.authorize.net/xml/v1/request.api'
16
16
 
17
- options = HashWithIndifferentAccess.new(options)
17
+ options = options.symbolize_keys!
18
18
  @login = options[:username] || VaultedBilling.config.authorize_net_cim.username
19
19
  @password = options[:password] || VaultedBilling.config.authorize_net_cim.password
20
+ @raw_options = options[:raw_options] || VaultedBilling.config.authorize_net_cim.raw_options
20
21
  self.use_test_uri = options.has_key?(:test) ? options[:test] : (VaultedBilling.config.authorize_net_cim.test_mode || VaultedBilling.config.test_mode)
21
22
  end
22
23
 
@@ -104,7 +105,7 @@ module VaultedBilling
104
105
  xml.customerPaymentProfileId credit_card.vault_id
105
106
  end
106
107
  end
107
- xml.extraOptions 'x_duplicate_window=0'
108
+ xml.extraOptions @raw_options.presence
108
109
  })
109
110
  respond_with(new_transaction_from_response(result.body), result, :success => result.success?)
110
111
  end
@@ -120,7 +121,7 @@ module VaultedBilling
120
121
  xml.customerPaymentProfileId credit_card.vault_id
121
122
  end
122
123
  end
123
- xml.extraOptions 'x_duplicate_window=0'
124
+ xml.extraOptions @raw_options.presence
124
125
  })
125
126
  respond_with(new_transaction_from_response(result.body), result, :success => result.success?)
126
127
  end
@@ -133,7 +134,7 @@ module VaultedBilling
133
134
  xml.transId transaction_id
134
135
  end
135
136
  end
136
- xml.extraOptions 'x_duplicate_window=0'
137
+ xml.extraOptions @raw_options.presence
137
138
  })
138
139
  respond_with(new_transaction_from_response(result.body), result, :success => result.success?)
139
140
  end
@@ -149,7 +150,7 @@ module VaultedBilling
149
150
  xml.transId transaction_id
150
151
  end
151
152
  end
152
- xml.extraOptions 'x_duplicate_window=0'
153
+ xml.extraOptions @raw_options.presence
153
154
  })
154
155
  respond_with(new_transaction_from_response(result.body), result, :success => result.success?)
155
156
  end
@@ -161,7 +162,7 @@ module VaultedBilling
161
162
  xml.transId transaction_id
162
163
  end
163
164
  end
164
- xml.extraOptions 'x_duplicate_window=0'
165
+ xml.extraOptions @raw_options.presence
165
166
  })
166
167
  respond_with(new_transaction_from_response(result.body), result, :success => result.success?)
167
168
  end
@@ -21,6 +21,7 @@ module VaultedBilling
21
21
  options = HashWithIndifferentAccess.new(options)
22
22
  @username = options[:username] || VaultedBilling.config.nmi_customer_vault.username
23
23
  @password = options[:password] || VaultedBilling.config.nmi_customer_vault.password
24
+ @raw_options = options[:raw_options] || VaultedBilling.config.nmi_customer_vault.raw_options
24
25
  self.use_test_uri = options.has_key?(:test) ? options[:test] : (VaultedBilling.config.nmi_customer_vault.test_mode || VaultedBilling.config.test_mode)
25
26
  end
26
27
 
@@ -152,7 +153,9 @@ module VaultedBilling
152
153
  def transaction_data(method, overrides = {})
153
154
  core_data.merge({
154
155
  :type => method.to_s
155
- }).merge(overrides).to_querystring
156
+ }).merge(overrides).to_querystring.tap do |query|
157
+ query << "&" + @raw_options if @raw_options
158
+ end
156
159
  end
157
160
 
158
161
  def storage_data(method, customer, credit_card)
@@ -1,3 +1,3 @@
1
1
  module VaultedBilling
2
- Version = '0.0.15'
2
+ Version = '1.0.0'
3
3
  end
@@ -1,3 +1,14 @@
1
+ begin
2
+ require 'active_support/core_ext/object/blank'
3
+ require 'active_support/core_ext/object/try'
4
+ require 'active_support/core_ext/hash/conversions'
5
+ require 'active_support/core_ext/hash/indifferent_access'
6
+ require 'active_support/core_ext/hash/reverse_merge'
7
+ require 'active_support/core_ext/string/inflections'
8
+ rescue LoadError
9
+ require 'active_support'
10
+ end
11
+
1
12
  module VaultedBilling
2
13
  autoload :Version, 'vaulted_billing/version'
3
14
  autoload :Configuration, 'vaulted_billing/configuration'
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vaulted_billing
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease: false
5
6
  segments:
7
+ - 1
6
8
  - 0
7
9
  - 0
8
- - 15
9
- version: 0.0.15
10
+ version: 1.0.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - Nathaniel Bibler
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-01-03 00:00:00 -05:00
18
+ date: 2011-01-14 00:00:00 -05:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
@@ -25,6 +26,7 @@ dependencies:
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 5
28
30
  segments:
29
31
  - 2
30
32
  - 3
@@ -39,6 +41,7 @@ dependencies:
39
41
  requirements:
40
42
  - - ">="
41
43
  - !ruby/object:Gem::Version
44
+ hash: 15
42
45
  segments:
43
46
  - 2
44
47
  - 1
@@ -52,13 +55,14 @@ dependencies:
52
55
  requirement: &id003 !ruby/object:Gem::Requirement
53
56
  none: false
54
57
  requirements:
55
- - - ">="
58
+ - - ~>
56
59
  - !ruby/object:Gem::Version
60
+ hash: 31
57
61
  segments:
58
62
  - 2
59
- - 3
63
+ - 4
60
64
  - 0
61
- version: 2.3.0
65
+ version: 2.4.0
62
66
  type: :development
63
67
  version_requirements: *id003
64
68
  - !ruby/object:Gem::Dependency
@@ -67,13 +71,14 @@ dependencies:
67
71
  requirement: &id004 !ruby/object:Gem::Requirement
68
72
  none: false
69
73
  requirements:
70
- - - ">="
74
+ - - ~>
71
75
  - !ruby/object:Gem::Version
76
+ hash: 31
72
77
  segments:
73
78
  - 0
74
79
  - 0
75
- - 3
76
- version: 0.0.3
80
+ - 0
81
+ version: 0.0.0
77
82
  type: :development
78
83
  version_requirements: *id004
79
84
  - !ruby/object:Gem::Dependency
@@ -82,13 +87,14 @@ dependencies:
82
87
  requirement: &id005 !ruby/object:Gem::Requirement
83
88
  none: false
84
89
  requirements:
85
- - - ">="
90
+ - - ~>
86
91
  - !ruby/object:Gem::Version
92
+ hash: 3
87
93
  segments:
88
94
  - 1
89
- - 4
95
+ - 5
90
96
  - 0
91
- version: 1.4.0
97
+ version: 1.5.0
92
98
  type: :development
93
99
  version_requirements: *id005
94
100
  - !ruby/object:Gem::Dependency
@@ -97,13 +103,14 @@ dependencies:
97
103
  requirement: &id006 !ruby/object:Gem::Requirement
98
104
  none: false
99
105
  requirements:
100
- - - ">="
106
+ - - ~>
101
107
  - !ruby/object:Gem::Version
108
+ hash: 15
102
109
  segments:
103
110
  - 1
104
111
  - 6
105
- - 1
106
- version: 1.6.1
112
+ - 0
113
+ version: 1.6.0
107
114
  type: :development
108
115
  version_requirements: *id006
109
116
  - !ruby/object:Gem::Dependency
@@ -112,13 +119,14 @@ dependencies:
112
119
  requirement: &id007 !ruby/object:Gem::Requirement
113
120
  none: false
114
121
  requirements:
115
- - - ">="
122
+ - - ~>
116
123
  - !ruby/object:Gem::Version
124
+ hash: 27
117
125
  segments:
118
126
  - 1
119
127
  - 3
120
- - 2
121
- version: 1.3.2
128
+ - 0
129
+ version: 1.3.0
122
130
  type: :development
123
131
  version_requirements: *id007
124
132
  - !ruby/object:Gem::Dependency
@@ -127,13 +135,14 @@ dependencies:
127
135
  requirement: &id008 !ruby/object:Gem::Requirement
128
136
  none: false
129
137
  requirements:
130
- - - ">="
138
+ - - ~>
131
139
  - !ruby/object:Gem::Version
140
+ hash: 59
132
141
  segments:
133
142
  - 0
134
- - 3
135
- - 1
136
- version: 0.3.1
143
+ - 9
144
+ - 0
145
+ version: 0.9.0
137
146
  type: :development
138
147
  version_requirements: *id008
139
148
  description: Several card processors and gateways support offloading the storage of credit card information onto their service. This offloads PCI compliance to the gateway rather than keeping it with each retailer. This library abstracts the interface to many of them, making it trivial to work with any or all of them.
@@ -177,6 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
177
186
  requirements:
178
187
  - - ">="
179
188
  - !ruby/object:Gem::Version
189
+ hash: 3
180
190
  segments:
181
191
  - 0
182
192
  version: "0"
@@ -185,6 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
195
  requirements:
186
196
  - - ">="
187
197
  - !ruby/object:Gem::Version
198
+ hash: 23
188
199
  segments:
189
200
  - 1
190
201
  - 3