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

Type

Name

Description

SecurityToken

securityToken

EBizCharge Connect security token. (required)

TransactionRequestObject

tran

Request 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

TransactionResponse

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

Examples

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>c4d6105a-1906-4be3-b01d-e5d6cd68120c</ebiz:SecurityId>
            <ebiz:UserId>n001</ebiz:UserId>
            <ebiz:Password>p001x</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>92618</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>92618</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>2529105146</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>79207941</BatchRefNum>
            <BatchNum>1982</BatchNum>
            <AvsResultCode>YYY</AvsResultCode>
            <AvsResult>Address: Match &amp; 5 Digit Zip: Match</AvsResult>
            <AuthCode>241896</AuthCode>
            <AuthAmount>3.13</AuthAmount>
            <AcsUrl/>
            <Status>Pending</Status>
            <StatusCode>P</StatusCode>
         </runTransactionResult>
      </runTransactionResponse>
   </s:Body>
</s:Envelope>
eBizCharge.TransactionRequestObject tran = new eBizCharge.TransactionRequestObject();
tran.Command = "cc:sale";
tran.Details =  new eBizCharge.TransactionDetail();
tran.Details.Amount = 1.00;
tran.Details.AmountSpecified = true;
tran.Details.Invoice = "1234";
tran.Details.Description = "Example Transaction";
tran.CreditCardData = new eBizCharge.CreditCardData();
tran.CreditCardData.CardNumber = "4444555566667779";
tran.CreditCardData.CardExpiration = "0909";
eBizCharge.TransactionResponse response = new eBizCharge.TransactionResponse();
try
{
   response = client.runTransaction(securityToken, tran);
   if (response.ResultCode == "A")
   {
       MessageBox.Show(string.Concat("Transaction Approved, RefNum: ",
               response.RefNum));
   }
   else
   {
       MessageBox.Show(string.Concat("Transaction Failed: ",
               response.Error));
   }
}
catch (Exception err)
{
   MessageBox.Show(err.Message);
}