vaulted_billing 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -28,7 +28,7 @@ module VaultedBilling
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
result = post_data(data)
|
31
|
-
respond_with(customer, :success => result.success?, :raw_response => result.raw_response) { |c| c.vault_id = (result.body['createCustomerProfileResponse'] || {})['customerProfileId'] }
|
31
|
+
respond_with(customer, :success => result.success?, :raw_response => result.raw_response.try(:body)) { |c| c.vault_id = (result.body['createCustomerProfileResponse'] || {})['customerProfileId'] }
|
32
32
|
end
|
33
33
|
|
34
34
|
def update_customer(customer)
|
@@ -39,7 +39,7 @@ module VaultedBilling
|
|
39
39
|
xml.customerProfileId customer.vault_id
|
40
40
|
}
|
41
41
|
})
|
42
|
-
respond_with(customer, :success => result.success?, :raw_response => result.raw_response)
|
42
|
+
respond_with(customer, :success => result.success?, :raw_response => result.raw_response.try(:body))
|
43
43
|
end
|
44
44
|
|
45
45
|
def remove_customer(customer)
|
@@ -60,7 +60,7 @@ module VaultedBilling
|
|
60
60
|
credit_card_info!(xml, customer, credit_card)
|
61
61
|
end
|
62
62
|
})
|
63
|
-
respond_with(credit_card, :success => result.success?, :raw_response => result.raw_response) { |c| c.vault_id = (result.body['createCustomerPaymentProfileResponse'] || {})['customerPaymentProfileId'] }
|
63
|
+
respond_with(credit_card, :success => result.success?, :raw_response => result.raw_response.try(:body)) { |c| c.vault_id = (result.body['createCustomerPaymentProfileResponse'] || {})['customerPaymentProfileId'] }
|
64
64
|
end
|
65
65
|
|
66
66
|
def update_customer_credit_card(customer, credit_card)
|
@@ -84,7 +84,7 @@ module VaultedBilling
|
|
84
84
|
xml.customerProfileId customer.vault_id
|
85
85
|
xml.customerPaymentProfileId credit_card.vault_id
|
86
86
|
})
|
87
|
-
respond_with(credit_card, :success => result.success?, :raw_response => result.raw_response)
|
87
|
+
respond_with(credit_card, :success => result.success?, :raw_response => result.raw_response.try(:body))
|
88
88
|
end
|
89
89
|
|
90
90
|
def authorize(customer, credit_card, amount)
|
@@ -100,7 +100,7 @@ module VaultedBilling
|
|
100
100
|
end
|
101
101
|
xml.extraOptions 'x_duplicate_window=0'
|
102
102
|
})
|
103
|
-
respond_with(new_transaction_from_response(result.body), :success => result.success?, :raw_response => result.raw_response)
|
103
|
+
respond_with(new_transaction_from_response(result.body), :success => result.success?, :raw_response => result.raw_response.try(:body))
|
104
104
|
end
|
105
105
|
|
106
106
|
def capture(transaction_id, amount)
|
@@ -113,7 +113,7 @@ module VaultedBilling
|
|
113
113
|
end
|
114
114
|
xml.extraOptions 'x_duplicate_window=0'
|
115
115
|
})
|
116
|
-
respond_with(new_transaction_from_response(result.body), :success => result.success?, :raw_response => result.raw_response)
|
116
|
+
respond_with(new_transaction_from_response(result.body), :success => result.success?, :raw_response => result.raw_response.try(:body))
|
117
117
|
end
|
118
118
|
|
119
119
|
def refund(transaction_id, amount)
|
@@ -126,7 +126,7 @@ module VaultedBilling
|
|
126
126
|
end
|
127
127
|
xml.extraOptions 'x_duplicate_window=0'
|
128
128
|
})
|
129
|
-
respond_with(new_transaction_from_response(result.body), :success => result.success?, :raw_response => result.raw_response)
|
129
|
+
respond_with(new_transaction_from_response(result.body), :success => result.success?, :raw_response => result.raw_response.try(:body))
|
130
130
|
end
|
131
131
|
|
132
132
|
def void(transaction_id)
|
@@ -138,7 +138,7 @@ module VaultedBilling
|
|
138
138
|
end
|
139
139
|
xml.extraOptions 'x_duplicate_window=0'
|
140
140
|
})
|
141
|
-
respond_with(new_transaction_from_response(result.body), :success => result.success?, :raw_response => result.raw_response)
|
141
|
+
respond_with(new_transaction_from_response(result.body), :success => result.success?, :raw_response => result.raw_response.try(:body))
|
142
142
|
end
|
143
143
|
|
144
144
|
|
@@ -54,14 +54,14 @@ module VaultedBilling
|
|
54
54
|
|
55
55
|
def add_customer_credit_card(customer, credit_card)
|
56
56
|
response = post_data(storage_data('add_customer', customer.to_vaulted_billing, credit_card.to_vaulted_billing))
|
57
|
-
respond_with(credit_card, :success => response.success?, :raw_response => response.raw_response) do |c|
|
57
|
+
respond_with(credit_card, :success => response.success?, :raw_response => response.raw_response.try(:body)) do |c|
|
58
58
|
c.vault_id = response.body['customer_vault_id']
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
62
|
def update_customer_credit_card(customer, credit_card)
|
63
63
|
response = post_data(storage_data('update_customer', customer.to_vaulted_billing, credit_card.to_vaulted_billing))
|
64
|
-
respond_with(credit_card, :success => response.success?, :raw_response => response.raw_response)
|
64
|
+
respond_with(credit_card, :success => response.success?, :raw_response => response.raw_response.try(:body))
|
65
65
|
end
|
66
66
|
|
67
67
|
def remove_customer_credit_card(customer, credit_card)
|
@@ -69,7 +69,7 @@ module VaultedBilling
|
|
69
69
|
:customer_vault => 'delete_customer',
|
70
70
|
:customer_vault_id => credit_card.to_vaulted_billing.vault_id
|
71
71
|
}).to_querystring)
|
72
|
-
respond_with(credit_card, :success => response.success?, :raw_response => response.raw_response)
|
72
|
+
respond_with(credit_card, :success => response.success?, :raw_response => response.raw_response.try(:body))
|
73
73
|
end
|
74
74
|
|
75
75
|
def authorize(customer, credit_card, amount)
|
@@ -78,7 +78,7 @@ module VaultedBilling
|
|
78
78
|
:amount => amount
|
79
79
|
}))
|
80
80
|
respond_with(new_transaction_from_response(response.body),
|
81
|
-
:success => response.success?, :raw_response => response.raw_response)
|
81
|
+
:success => response.success?, :raw_response => response.raw_response.try(:body))
|
82
82
|
end
|
83
83
|
|
84
84
|
def capture(transaction_id, amount)
|
@@ -87,7 +87,7 @@ module VaultedBilling
|
|
87
87
|
:amount => amount
|
88
88
|
}))
|
89
89
|
respond_with(new_transaction_from_response(response.body),
|
90
|
-
:success => response.success?, :raw_response => response.raw_response)
|
90
|
+
:success => response.success?, :raw_response => response.raw_response.try(:body))
|
91
91
|
end
|
92
92
|
|
93
93
|
def refund(transaction_id, amount)
|
@@ -96,7 +96,7 @@ module VaultedBilling
|
|
96
96
|
:amount => amount
|
97
97
|
}))
|
98
98
|
respond_with(new_transaction_from_response(response.body),
|
99
|
-
:success => response.success?, :raw_response => response.raw_response)
|
99
|
+
:success => response.success?, :raw_response => response.raw_response.try(:body))
|
100
100
|
end
|
101
101
|
|
102
102
|
def void(transaction_id)
|
@@ -104,7 +104,7 @@ module VaultedBilling
|
|
104
104
|
:transactionid => transaction_id
|
105
105
|
}))
|
106
106
|
respond_with(new_transaction_from_response(response.body),
|
107
|
-
:success => response.success?, :raw_response => response.raw_response)
|
107
|
+
:success => response.success?, :raw_response => response.raw_response.try(:body))
|
108
108
|
end
|
109
109
|
|
110
110
|
|
@@ -145,7 +145,7 @@ module VaultedBilling
|
|
145
145
|
:currency => credit_card.currency,
|
146
146
|
:method => 'creditcard',
|
147
147
|
:ccnumber => credit_card.card_number,
|
148
|
-
:ccexp => credit_card.expires_on.try(:strftime, "%y
|
148
|
+
:ccexp => credit_card.expires_on.try(:strftime, "%m%y"),
|
149
149
|
:first_name => credit_card.first_name,
|
150
150
|
:last_name => credit_card.last_name,
|
151
151
|
:address1 => credit_card.street_address,
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nathaniel Bibler
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-26 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|