--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: 
- !ruby/object:RI::MethodSummary 
  name: new
- !ruby/object:RI::MethodSummary 
  name: tclink?
comment: 
- !ruby/struct:SM::Flow::P 
  body: "TO USE: First, make sure you have everything setup correctly and all of your dependencies in place with:"
- !ruby/struct:SM::Flow::VERB 
  body: "  require 'rubygems'\n  require 'active_merchant'\n"
- !ruby/struct:SM::Flow::P 
  body: ActiveMerchant expects amounts to be Integer values in cents
- !ruby/struct:SM::Flow::VERB 
  body: "  tendollar = 1000\n"
- !ruby/struct:SM::Flow::P 
  body: Next, create a credit card object using a TC approved test card.
- !ruby/struct:SM::Flow::VERB 
  body: "  creditcard = ActiveMerchant::Billing::CreditCard.new(\n      :number =&gt; '4111111111111111',\n      :month =&gt; 8,\n      :year =&gt; 2006,\n      :first_name =&gt; 'Longbob',\n    :last_name =&gt; 'Longsen'\n  )\n"
- !ruby/struct:SM::Flow::P 
  body: To finish setting up, create the active_merchant object you will be using, with the TrustCommerce gateway. If you have a functional TrustCommerce account, replace login and password with your account info. Otherwise the defaults will work for testing.
- !ruby/struct:SM::Flow::VERB 
  body: "  gateway = ActiveMerchant::Billing::Base.gateway(:trust_commerce).new(:login =&gt; &quot;TestMerchant&quot;, :password =&gt; &quot;password&quot;)\n"
- !ruby/struct:SM::Flow::P 
  body: Now we are ready to process our transaction
- !ruby/struct:SM::Flow::VERB 
  body: "  response = gateway.purchase(tendollar, creditcard)\n"
- !ruby/struct:SM::Flow::P 
  body: "Sending a transaction to TrustCommerce with active_merchant returns a Response object, which consistently allows you to:"
- !ruby/struct:SM::Flow::P 
  body: 1) Check whether the transaction was successful
- !ruby/struct:SM::Flow::VERB 
  body: "  response.success?\n"
- !ruby/struct:SM::Flow::P 
  body: 2) Retrieve any message returned by TrustCommerce, either a &quot;transaction was successful&quot; note or an explanation of why the transaction was rejected.
- !ruby/struct:SM::Flow::VERB 
  body: "  response.message\n"
- !ruby/struct:SM::Flow::P 
  body: 3) Retrieve and store the unique transaction ID returned by Trust Commerece, for use in referencing the transaction in the future.
- !ruby/struct:SM::Flow::VERB 
  body: "  response.params[&quot;transid&quot;]\n"
- !ruby/struct:SM::Flow::P 
  body: For higher performance and failover with the TrustCommerceGateway you can install the TCLink library from http://www.trustcommerce.com/tclink.html. Follow the instructions available there to get it working on your system. ActiveMerchant will automatically use tclink if available.
- !ruby/struct:SM::Flow::P 
  body: "The TCLink library has the following added benefits:"
- !ruby/struct:SM::Flow::VERB 
  body: " * Good transaction times. Transaction duration under 1.2 seconds are common.\n * Fail-over to geographically distributed servers for extreme reliability\n"
- !ruby/struct:SM::Flow::P 
  body: Once it is installed, you should be able to make sure that it is visible to your ruby install by opening irb and typing &quot;require 'tclink'&quot;, which should return &quot;true&quot;.
- !ruby/struct:SM::Flow::P 
  body: This should be enough to get you started with Trust Commerce and active_merchant. For further information, review the methods below and the rest of active_merchant's documentation, as well as Trust Commerce's user and developer documentation.
constants: 
- !ruby/object:RI::Constant 
  comment: 
  name: URL
  value: "'https://vault.trustcommerce.com/trans/'"
- !ruby/object:RI::Constant 
  comment: 
  name: SUCCESS_TYPES
  value: "[\"approved\", \"accepted\"]"
- !ruby/object:RI::Constant 
  comment: 
  name: DECLINE_CODES
  value: "{         \"decline\"       => \"The credit card was declined\",         \"avs\"           => \"AVS failed; the address entered does not match the billing address on file at the bank\",         \"cvv\"           => \"CVV failed; the number provided is not the correct verification number for the card\",         \"call\"          => \"The card must be authorized manually over the phone\",         \"expiredcard\"   => \"Issuer was not certified for card verification\",         \"carderror\"     => \"Card number is invalid\",         \"authexpired\"   => \"Attempt to postauth an expired (more than 14 days old) preauth\",         \"fraud\"         => \"CrediGuard fraud score was below requested threshold\",         \"blacklist\"     => \"CrediGuard blacklist value was triggered\",          \"velocity\"      => \"CrediGuard velocity control value was triggered\",         \"dailylimit\"    => \"Daily limit in transaction count or amount as been reached\",         \"weeklylimit\"   => \"Weekly limit in transaction count or amount as been reached\",         \"monthlylimit\"  => \"Monthly limit in transaction count or amount as been reached\""
- !ruby/object:RI::Constant 
  comment: 
  name: BADDATA_CODES
  value: "{         \"missingfields\"       => \"One or more parameters required for this transaction type were not sent\",         \"extrafields\"         => \"Parameters not allowed for this transaction type were sent\",         \"badformat\"           => \"A field was improperly formatted, such as non-digit characters in a number field\",         \"badlength\"           => \"A field was longer or shorter than the server allows\",         \"merchantcantaccept\"  => \"The merchant can't accept data passed in this field\",         \"mismatch\"            => \"Data in one of the offending fields did not cross-check with the other offending field\""
- !ruby/object:RI::Constant 
  comment: 
  name: ERROR_CODES
  value: "{         \"cantconnect\"   => \"Couldn't connect to the TrustCommerce gateway\",         \"dnsfailure\"    => \"The TCLink software was unable to resolve DNS hostnames\",         \"linkfailure\"   => \"The connection was established, but was severed before the transaction could complete\",         \"failtoprocess\" => \"The bank servers are offline and unable to authorize transactions\""
- !ruby/object:RI::Constant 
  comment: 
  name: TEST_LOGIN
  value: "'TestMerchant'"
- !ruby/object:RI::Constant 
  comment: 
  name: TEST_PASSWORD
  value: "'password'"
full_name: ActiveMerchant::Billing::TrustCommerceGateway
includes: []

instance_methods: 
- !ruby/object:RI::MethodSummary 
  name: authorize
- !ruby/object:RI::MethodSummary 
  name: capture
- !ruby/object:RI::MethodSummary 
  name: credit
- !ruby/object:RI::MethodSummary 
  name: purchase
- !ruby/object:RI::MethodSummary 
  name: recurring
- !ruby/object:RI::MethodSummary 
  name: store
- !ruby/object:RI::MethodSummary 
  name: tclink?
- !ruby/object:RI::MethodSummary 
  name: test?
- !ruby/object:RI::MethodSummary 
  name: unstore
- !ruby/object:RI::MethodSummary 
  name: void
name: TrustCommerceGateway
superclass: Gateway
