runTransaction

Runs a transaction using the SOAP API.

Description

This method duplicates the functionality of the gateway API. It can be used to run a wide variety of transaction types, including sales, credits, auth-only, voids, and checks.

The TransactionRequestObject parameter contains any of the variable names supported by the transaction API (see the docs for a list of valid field names). Make sure to remove the UM from the front of the field names (i.e., UMamount should be passed as Amount).

Syntax

TransactionResponse runTransaction ( SecurityToken securityToken, tran )

Arguments

TypeNameDescription
SecurityTokensecurityTokenEBizCharge Connect security token. (required)
TransactionRequestObjecttranRequest transaction details from all fields of the transaction form, including reference number, transaction amount, customer ID, currency, authorization code, and any other information entered at the time of the transaction. (required)

Return Value

TransactionResponseReturns a TransactionResponse object containing the results of the transaction and all relevant data.

Examples

function runTransaction()
{
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '******-454757-4567457-********',
'UserId' => 'merchant1',
'Password' => 'merchant1'
);
$transactionRequest = array(
'CustReceipt' => '2',
'CustReceiptName' => '',
'Software' => 'Woocommerce',
'LineItems' => array(
'SKU' => 'sku-aca',
'ProductName' => 'AC',
'Description' => 'cool ac',
'UnitPrice' => 5000,
'Taxable' => 'N',
'TaxAmount' => 0,
'Qty' => 1
),
'IsRecurring' => false,
'IgnoreDuplicate' => false,
'Details' => array(
'OrderID' => 1,
'Invoice' => 'AND-0101',
'PONum' => '1009411',
'Description' => 'Testing',
'Amount' => 5000,
'Tax' => 0,
'Currency' => 'USD',
'Shipping' => '',
'ShipFromZip' => '54000',
'Discount' => 0,
'Subtotal' => 5000,
'AllowPartialAuth' => false,
'Tip' => 0,
'NonTax' => false,
'Duty' => 0,
),
'CustomerID' => 123,
'CreditCardData' => array(
'InternalCardAuth' => false,
'CardPresent' => true,
'CardNumber' => '4000100011112224',
'CardExpiration' => '1120',
'CardCode' => '123',
'AvsStreet' => 'St # 10',
'AvsZip' => '54000'
),
'Command' => 'Credit',
'ClientIP' => '110.28.113.34',
'AccountHolder' => 'Frank',
'RefNum' => '1009411',
'BillingAddress' => array(), // billing address object
'ShippingAddress' => array(), // shipping address object
);
$transaction = $client->runTransaction(
array(
'securityToken' => $securityToken,
'tran' => $transactionRequest
))
;
$transactionResult = $transaction->runTransactionResult;
}
Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:runTransaction>
         <ebiz:securityToken>
            <ebiz:SecurityId>*******-1906-4be3-b01d-********</ebiz:SecurityId>
            <ebiz:UserId>********</ebiz:UserId>
            <ebiz:Password>********</ebiz:Password>
         </ebiz:securityToken>
         <ebiz:tran>
            <ebiz:CustReceiptName/>
            <ebiz:LineItems>
               <ebiz:LineItem>
                  <ebiz:DiscountRate>0</ebiz:DiscountRate>
                  <ebiz:ProductRefNum>Ref001</ebiz:ProductRefNum>
                  <ebiz:SKU>ssu001</ebiz:SKU>
                  <ebiz:ProductName>Services</ebiz:ProductName>
                  <ebiz:Description>Services</ebiz:Description>
                  <ebiz:DiscountAmount>0</ebiz:DiscountAmount>
                  <ebiz:TaxRate>0</ebiz:TaxRate>
                  <ebiz:UnitOfMeasure>EA</ebiz:UnitOfMeasure>
                  <ebiz:UnitPrice>25.00</ebiz:UnitPrice>
                  <ebiz:Qty>1</ebiz:Qty>
                  <ebiz:Taxable>true</ebiz:Taxable>
                  <ebiz:TaxAmount>0</ebiz:TaxAmount>
               </ebiz:LineItem>
            </ebiz:LineItems>
            <ebiz:Details>
               <ebiz:NonTax>1</ebiz:NonTax>
               <ebiz:Tax>0</ebiz:Tax>
               <ebiz:Shipping>1.0</ebiz:Shipping>
               <ebiz:ShipFromZip>95678</ebiz:ShipFromZip>
               <ebiz:PONum>po2</ebiz:PONum>
               <ebiz:OrderID>o12</ebiz:OrderID>
               <ebiz:Invoice>inv008</ebiz:Invoice>
               <ebiz:Duty>0</ebiz:Duty>
               <ebiz:Discount>0</ebiz:Discount>
               <ebiz:Comments>New Transaction</ebiz:Comments>
               <ebiz:Description>Validation Authorization 2</ebiz:Description>
               <ebiz:Currency/>
               <ebiz:Clerk>Sam</ebiz:Clerk>
               <ebiz:Amount>3.13</ebiz:Amount>
               <ebiz:Terminal>pc-1</ebiz:Terminal>
               <ebiz:Tip>0</ebiz:Tip>
            </ebiz:Details>
            <ebiz:Software>NAV_EBC</ebiz:Software>
            <ebiz:CustReceipt>false</ebiz:CustReceipt>
            <ebiz:CustomerID>CS0001</ebiz:CustomerID>
            <ebiz:CreditCardData>
               <ebiz:CardNumber>4111111111111111</ebiz:CardNumber>
               <ebiz:CardExpiration>1222</ebiz:CardExpiration>
               <ebiz:CardCode>123</ebiz:CardCode>
               <ebiz:AvsZip>97890</ebiz:AvsZip>
               <ebiz:AvsStreet>20 Alton</ebiz:AvsStreet>
            </ebiz:CreditCardData>
            <ebiz:Command>sale</ebiz:Command>
            <ebiz:BillingAddress>
               <ebiz:City>antro luctantis ventos</ebiz:City>
               <ebiz:Company>sciret dare</ebiz:Company>
               <ebiz:Country>luctantis ventos</ebiz:Country>
               <ebiz:Email>ipsa iovis</ebiz:Email>
               <ebiz:Fax>aris imponet</ebiz:Fax>
               <ebiz:FirstName>imperio premit</ebiz:FirstName>
               <ebiz:LastName>arce sceptra tenens</ebiz:LastName>
               <ebiz:Phone>ni faciat</ebiz:Phone>
               <ebiz:State>circum claustra fremunt</ebiz:State>
               <ebiz:Street>corde volutans</ebiz:Street>
               <ebiz:Street2>insuper altos</ebiz:Street2>
               <ebiz:Zip>temperat iras</ebiz:Zip>
            </ebiz:BillingAddress>
            <ebiz:AccountHolder>CBS</ebiz:AccountHolder>
            <ebiz:ShippingAddress>
               <ebiz:City>premere et</ebiz:City>
               <ebiz:Company>iovisque et</ebiz:Company>
               <ebiz:Country>nubibus ignem disiecitque</ebiz:Country>
               <ebiz:Email>imposuit regemque</ebiz:Email>
               <ebiz:Fax>rates evertitque</ebiz:Fax>
               <ebiz:FirstName>supplex aris imponet</ebiz:FirstName>
               <ebiz:LastName>ipsa iovis</ebiz:LastName>
               <ebiz:Phone>volutans nimborum in</ebiz:Phone>
               <ebiz:State>maria ac</ebiz:State>
               <ebiz:Street>foedere certo</ebiz:Street>
               <ebiz:Street2>sciret dare iussus</ebiz:Street2>
               <ebiz:Zip>rapidi secum verrantque</ebiz:Zip>
            </ebiz:ShippingAddress>
         </ebiz:tran>
      </ebiz:runTransaction>
   </soapenv:Body>
</soapenv:Envelope>



Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <runTransactionResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <runTransactionResult>
            <CustNum>0</CustNum>
            <ResultCode>A</ResultCode>
            <Result>Approved</Result>
            <RemainingBalance>0</RemainingBalance>
            <RefNum>2529********</RefNum>
            <Payload/>
            <isDuplicate>false</isDuplicate>
            <ErrorCode>0</ErrorCode>
            <Error>Approved</Error>
            <VpasResultCode/>
            <ConvertedAmountCurrency>840</ConvertedAmountCurrency>
            <ConvertedAmount>0</ConvertedAmount>
            <ConversionRate>0</ConversionRate>
            <CardLevelResultCode>A</CardLevelResultCode>
            <CardLevelResult>Visa Traditional</CardLevelResult>
            <CardCodeResultCode>P</CardCodeResultCode>
            <CardCodeResult>Not Processed</CardCodeResult>
            <BatchRefNum>792********</BatchRefNum>
            <BatchNum>1********</BatchNum>
            <AvsResultCode>YYY</AvsResultCode>
            <AvsResult>Address: Match &amp; 5 Digit Zip: Match</AvsResult>
            <AuthCode>24********</AuthCode>
            <AuthAmount>3.13</AuthAmount>
            <AcsUrl/>
            <Status>Pending</Status>
            <StatusCode>P</StatusCode>
         </runTransactionResult>
      </runTransactionResponse>
   </s:Body>
</s:Envelope>