virtual_merchant 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/virtual_merchant.rb +10 -10
- metadata +1 -1
data/lib/virtual_merchant.rb
CHANGED
@@ -7,27 +7,27 @@ class VirtualMerchant
|
|
7
7
|
require 'virtual_merchant/response'
|
8
8
|
|
9
9
|
def self.charge(card, amount, creds)
|
10
|
-
xml = self.generateXMLforVirtualMerchant(card, amount, creds)
|
10
|
+
xml = self.generateXMLforVirtualMerchant(card, amount, creds, "ccsale")
|
11
11
|
vm_response = self.sendXMLtoVirtualMerchant(xml, creds)
|
12
12
|
response = self.generateResponse(vm_response)
|
13
13
|
self.printResponse(response)
|
14
14
|
response
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
17
|
+
def self.refund(card, amount, creds)
|
18
|
+
xml = self.generateXMLforVirtualMerchant(card, amount, creds, 'cccredit')
|
19
|
+
vm_response = self.sendXMLtoVirtualMerchant(xml, creds)
|
20
|
+
response = self.generateResponse(vm_response)
|
21
|
+
self.printResponse(response)
|
22
|
+
response
|
23
|
+
end
|
25
24
|
|
25
|
+
def self.generateXMLforVirtualMerchant(card, amount, creds, transaction_type)
|
26
26
|
xml = "xmldata=<txn>
|
27
27
|
<ssl_merchant_id>" + creds.account_id + "</ssl_merchant_id>
|
28
28
|
<ssl_user_id>" + creds.user_id + "</ssl_user_id>
|
29
29
|
<ssl_pin>" + creds.pin + "</ssl_pin>
|
30
|
-
<ssl_transaction_type>" +
|
30
|
+
<ssl_transaction_type>" + transaction_type + "</ssl_transaction_type>
|
31
31
|
<ssl_amount>" + amount.total + "</ssl_amount>
|
32
32
|
<ssl_salestax>" + amount.tax + "</ssl_salestax>
|
33
33
|
<ssl_customer_code>" + card.last_four + "</ssl_customer_code>
|