Class | ActiveMerchant::Billing::UsaEpayAdvancedGateway |
In: |
lib/active_merchant/billing/gateways/usa_epay_advanced.rb
|
Parent: | Gateway |
This class encapuslates USA ePay‘s Advanced SOAP Interface. The Advanced Soap Interface allows standard transactions, storing customer information, and recurring billing. Storing sensitive information on USA ePay‘s servers can help with PCI DSS compliance, since customer and card data do not need to be stored locally.
Make sure you have enabled this functionality for your account with USA ePay.
Information about the Advanced SOAP interface is available on the USA ePay wiki.
Please follow all of USA ePay‘s directions for acquiring all accounts and settings.
The value used for :login is the Key value found in the Merchant Console under Settings > Source Key. You will have to add this key in the USA ePay Merchant Console.
The value used for :password is the pin value also found and assigned in the Merchant Console under Settings > Source Key. The pin is required to use all but basic transactions in the SOAP interface. You will have to add the pin to your source key, as it defaults to none.
The value used for the :software_id is found in the Developer‘s Login under the Developers Center in your WSDL. It is the 8 character value in <soap:address> tag. A masked example: <soap:address location="www.usaepay.com/soap/gate/XXXXXXXX"/> It is also found in the link to your WSDL. This is required as every account has a different path SOAP requests are submitted to. Optionally, you can provide the entire urls via :live_url and :test_url, if your prefer.
API_VERSION | = | "1.4" |
CUSTOMER_OPTIONS | = | { :id => [:string, 'CustomerID'], # merchant assigned number :notes => [:string, 'Notes'], :data => [:string, 'CustomData'], :url => [:string, 'URL'], # Recurring Billing :enabled => [:boolean, 'Enabled'], :schedule => [:string, 'Schedule'], :number_left => [:integer, 'NumLeft'], :currency => [:string, 'Currency'], :description => [:string, 'Description'], :order_id => [:string, 'OrderID'], :user => [:string, 'User'], :source => [:string, 'Source'], :send_receipt => [:boolean, 'SendReceipt'], :receipt_note => [:string, 'ReceiptNote'], # Point of Sale :price_tier => [:string, 'PriceTier'], :tax_class => [:string, 'TaxClass'], :lookup_code => [:string, 'LookupCode'] |
ADDRESS_OPTIONS | = | { :first_name => [:string, 'FirstName'], :last_name => [:string, 'LastName'], :address1 => [:string, 'Street'], :address2 => [:string, 'Street2'], :city => [:string, 'City'], :state => [:string, 'State'], :zip => [:string, 'Zip'], :country => [:string, 'Country'], :phone => [:string, 'Phone'], :email => [:string, 'Email'], :fax => [:string, 'Fax'], :company => [:string, 'Company'] |
CUSTOMER_TRANSACTION_REQUEST_OPTIONS | = | { :command => [:string, 'Command'], :ignore_duplicate => [:boolean, 'IgnoreDuplicate'], :client_ip => [:string, 'ClientIP'], :customer_receipt => [:boolean, 'CustReceipt'], :customer_email => [:boolean, 'CustReceiptEmail'], :customer_template => [:boolean, 'CustReceiptName'], :merchant_receipt => [:boolean, 'MerchReceipt'], :merchant_email => [:boolean, 'MerchReceiptEmail'], :merchant_template => [:boolean, 'MerchReceiptName'], :verification_value => [:boolean, 'isRecurring'], :software => [:string, 'Software'] |
TRANSACTION_REQUEST_OBJECT_OPTIONS | = | { :command => [:string, 'Command'], :ignore_duplicate => [:boolean, 'IgnoreDuplicate'], :authorization_code => [:string, 'AuthCode'], :reference_number => [:string, 'RefNum'], :account_holder => [:string, 'AccountHolder'], :client_ip => [:string, 'ClientIP'], :customer_id => [:string, 'CustomerID'], :customer_receipt => [:boolean, 'CustReceipt'], :customer_template => [:boolean, 'CustReceiptName'], :software => [:string, 'Software'] |
TRANSACTION_DETAIL_MONEY_OPTIONS | = | { :amount => [:double, 'Amount'], :tax => [:double, 'Tax'], :tip => [:double, 'Tip'], :non_tax => [:boolean, 'NonTax'], :shipping => [:double, 'Shipping'], :discount => [:double, 'Discount'], :subtotal => [:double, 'Subtotal'] |
CREDIT_CARD_DATA_OPTIONS | = | { :magnetic_stripe => [:string, 'MagStripe'], :dukpt => [:string, 'DUKPT'], :signature => [:string, 'Signature'], :terminal_type => [:string, 'TermType'], :magnetic_support => [:string, 'MagSupport'], :xid => [:string, 'XID'], :cavv => [:string, 'CAVV'], :eci => [:integer, 'ECI'], :internal_card_authorization => [:boolean, 'InternalCardAduth'], :pares => [:string, 'Pares'] |
CHECK_DATA_OPTIONS | = | { :check_number => [:integer, 'CheckNumber'], :drivers_license => [:string, 'DriversLicense'], :drivers_license_state => [:string, 'DriversLicenseState'], :record_type => [:string, 'RecordType'], :aux_on_us => [:string, 'AuxOnUS'], :epc_code => [:string, 'EpcCode'], :front_image => [:string, 'FrontImage'], :back_image => [:string, 'BackImage'] |
RECURRING_BILLING_OPTIONS | = | { :schedule => [:string, 'Schedule'], :number_left => [:integer, 'NumLeft'], :enabled => [:boolean, 'Enabled'] |
AVS_RESULTS | = | { 'Y' => %w( YYY Y YYA YYD ), 'Z' => %w( NYZ Z ), 'A' => %w( YNA A YNY ), 'N' => %w( NNN N NN ), 'X' => %w( YYX X ), 'W' => %w( NYW W ), 'XXW' => %w( XXW ), 'XXU' => %w( XXU ), 'R' => %w( XXR R U E ), 'S' => %w( XXS S ), 'XXE' => %w( XXE ), 'G' => %w( XXG G C I ), 'B' => %w( YYG B M ), 'D' => %w( GGG D ), 'P' => %w( YGG P ) |
AVS_CUSTOM_MESSAGES | = | { 'XXW' => 'Card number not on file.', 'XXU' => 'Address information not verified for domestic transaction.', 'XXE' => 'Address verification not allowed for card type.' |
TRANSACTION_METHODS | = | [ :run_sale, :run_auth_only, :run_credit, :run_check_sale, :run_check_credit |
Create a new gateway.
OR
Add a customer.
Add a payment method to a customer.
Authorize an amount on a credit card or account.
Note: See run_transaction for additional options.
Capture an authorized transaction.
Note: See run_transaction for additional options.
Capture an authorized transaction and move it into the current batch for settlement.
Note: Check with merchant bank for details/restrictions on differing amounts than the original authorization.
Credit a previous transaction.
Note: See run_transaction for additional options.
Enable a customer for recurring billing.
Note: Customer does not need to have all recurring paramerters to succeed.
Retrive one of the payment methods belonging to a customer
Retrive all of the payment methods belonging to a customer
Retrieve details of a specified transaction.
Check status of a transaction (custom).
Override transaction flagged for mananager approval.
Note: Checks only!
Post an authorization code obtained offline.
Make a purchase with a credit card. (Authorize and capture for settlement.)
Note: See run_transaction for additional options.
Run a transaction for an existing customer in the database.
Run a credit based off of a past transaction.
Transfers referenced transaction‘s payment method to this transaction. As of 6/2011, USA ePay blocks credit card numbers at 3 years.
Run a sale transaction based off of a past transaction.
Transfers referenced transaction‘s payment method to this transaction. As of 6/2011, USA ePay blocks credit card numbers at 3 years.
Run a transaction.
Note: run_sale, run_auth_only, run_credit, run_check_sale, run_check_credit methods are also available. Each takes the same options as run_transaction, but the :command option is not required.
Recurring Note: If recurring options are included USA ePay will create a new customer record with the supplied information. The customer number will be returned in the response.
Update a customer by replacing all of the customer details..
Use quickUpdateCustomer to just update a few attributes.
* Same as add_customer
Update a customer payment method.
Void a previous transaction that has not been settled.
Note: See run_transaction for additional options.
Void a transaction.
Note: Can only be voided before being settled.