Class: ActiveMerchant::Billing::CyberSourceGateway

Class | ActiveMerchant::Billing::CyberSourceGateway
In: | lib/active_merchant/billing/gateways/cyber_source.rb
Parent: | Gateway

See the remote and mocked unit test files for example usage. Pay special attention to the contents of the options hash.

Initial setup instructions can be found in cybersource.com/support_center/implementation/downloads/soap_api/SOAP_toolkits.pdf

Debugging If you experience an issue with this gateway be sure to examine the transaction information from a general transaction search inside the CyberSource Business Center for the full error messages including field names.

Important Notes

- AVS and CVV only work against the production server. You will always get back X for AVS and no response for CVV against the test server.
- Nexus is the list of states or provinces where you have a physical presence. Nexus is used to calculate tax. Leave blank to tax everyone.
- If you want to calculate VAT for overseas customers you must supply a registration number in the options hash as vat_reg_number.
- productCode is a value in the line_items hash that is used to tell CyberSource what kind of item you are selling. It is used when calculating tax/VAT.
- All transactions use dollar values.

### Methods

authorize calculate_tax capture credit new purchase test? void

### Constants

TEST_URL | = | 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor'
LIVE_URL | = | 'https://ics2ws.ic3.com/commerce/1.x/transactionProcessor'

### Public Class methods

new(options = {})

These are the options that can be used when creating a new CyberSource Gateway object.

:login => your username

:password => the transaction key you generated in the Business Center

:test => true sets the gateway to test mode

:vat_reg_number => your VAT registration number

:nexus => "WI CA QC" sets the states/provinces where you have a physical presense for tax purposes

:ignore_avs => true don‘t want to use AVS so continue processing even if AVS would have failed

:ignore_cvv => true don‘t want to use CVV so continue processing even if CVV would have failed

### Public Instance methods

authorize(money, creditcard, options = {})

Request an authorization for an amount from CyberSource

You must supply an :order_id in the options hash

calculate_tax(creditcard, options)

CyberSource requires that you provide line item information for tax calculations If you do not have prices for each item or want to simplify the situation then pass in one fake line item that costs the subtotal of the order

The line_item hash goes in the options hash and should look like

            :line_items => [
              {
                :declared_value => '1',
                :quantity => '2',
                :code => 'default',
                :description => 'Giant Walrus',
                :sku => 'WA323232323232323'
              },
              {
                :declared_value => '6',
                :quantity => '1',
                :code => 'default',
                :description => 'Marble Snowcone',
                :sku => 'FAKE1232132113123'
              }
            ]

This functionality is only supported by this particular gateway may be changed at any time

capture(money, authorization, options = {})

Capture an authorization that has previously been requested

credit(money, identification, options = {})
purchase(money, creditcard, options = {})

Purchase is an auth followed by a capture You must supply an order_id in the options hash

test?()

Should run against the test servers or not?

void(identification, options = {})

[Validate]