vaulted_billing 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vaulted_billing/gateway.rb +1 -1
- data/lib/vaulted_billing/gateways/authorize_net_cim.rb +12 -3
- data/lib/vaulted_billing/gateways/bogus.rb +3 -2
- data/lib/vaulted_billing/gateways/nmi_customer_vault.rb +1 -1
- data/lib/vaulted_billing/transaction.rb +1 -0
- data/lib/vaulted_billing/version.rb +1 -1
- metadata +4 -4
@@ -139,11 +139,14 @@ module VaultedBilling
|
|
139
139
|
respond_with(new_transaction_from_response(result.body), result, :success => result.success?)
|
140
140
|
end
|
141
141
|
|
142
|
-
def refund(transaction_id, amount)
|
142
|
+
def refund(transaction_id, amount, options = {})
|
143
143
|
result = post_data(build_request('createCustomerProfileTransactionRequest') { |xml|
|
144
144
|
xml.transaction do
|
145
145
|
xml.profileTransRefund do
|
146
146
|
xml.amount amount
|
147
|
+
xml.customerProfileId options[:customer_vault_id] if options[:customer_vault_id]
|
148
|
+
xml.customerPaymentProfileId options[:credit_card_vault_id] if options[:credit_card_vault_id]
|
149
|
+
xml.creditCardNumberMasked mask_card_number(options[:masked_card_number]) if options[:masked_card_number]
|
147
150
|
xml.transId transaction_id
|
148
151
|
end
|
149
152
|
end
|
@@ -241,7 +244,8 @@ module VaultedBilling
|
|
241
244
|
:cvv_response => direct_response['cvv_response'],
|
242
245
|
:authcode => direct_response['approval_code'],
|
243
246
|
:message => direct_response['message'] || response[root]['messages']['text'],
|
244
|
-
:code => response[root]['messages']['code']
|
247
|
+
:code => response[root]['messages']['code'],
|
248
|
+
:masked_card_number => direct_response['masked_card_number']
|
245
249
|
})
|
246
250
|
end
|
247
251
|
|
@@ -253,7 +257,8 @@ module VaultedBilling
|
|
253
257
|
'approval_code' => fields[4],
|
254
258
|
'avs_response' => fields[5],
|
255
259
|
'transaction_id' => fields[6],
|
256
|
-
'cvv_response' => fields[39]
|
260
|
+
'cvv_response' => fields[39],
|
261
|
+
'masked_card_number' => fields[50]
|
257
262
|
}
|
258
263
|
end
|
259
264
|
|
@@ -269,6 +274,10 @@ module VaultedBilling
|
|
269
274
|
end
|
270
275
|
end
|
271
276
|
|
277
|
+
def mask_card_number(input)
|
278
|
+
"XXXX%04d" % [input.to_s[-4..-1].to_i]
|
279
|
+
end
|
280
|
+
|
272
281
|
end
|
273
282
|
|
274
283
|
end
|
@@ -48,7 +48,7 @@ module VaultedBilling
|
|
48
48
|
transaction_response
|
49
49
|
end
|
50
50
|
|
51
|
-
def refund(transaction_id, amount)
|
51
|
+
def refund(transaction_id, amount, options = {})
|
52
52
|
transaction_response
|
53
53
|
end
|
54
54
|
|
@@ -63,7 +63,8 @@ module VaultedBilling
|
|
63
63
|
def transaction_response
|
64
64
|
respond_with VaultedBilling::Transaction.new({
|
65
65
|
:id => new_identifier,
|
66
|
-
:authcode => new_identifier[0..5]
|
66
|
+
:authcode => new_identifier[0..5],
|
67
|
+
:masked_card_number => "XXXX%04d" % [rand(9999)]
|
67
68
|
})
|
68
69
|
end
|
69
70
|
end
|
@@ -102,7 +102,7 @@ module VaultedBilling
|
|
102
102
|
:success => response.success?)
|
103
103
|
end
|
104
104
|
|
105
|
-
def refund(transaction_id, amount)
|
105
|
+
def refund(transaction_id, amount, options = {})
|
106
106
|
response = post_data(transaction_data('refund', {
|
107
107
|
:transactionid => transaction_id,
|
108
108
|
:amount => amount
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vaulted_billing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 13
|
10
|
+
version: 0.0.13
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nathaniel Bibler
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-21 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|