runCustomerTransaction

Description

The runCustomerTransaction method processes a new transaction using payment details stored for the Customer.

Syntax

TransactionResponse runCustomerTransaction(SecurityToken securityToken, string custNum, string paymentMethodID, CustomerTransactionRequest tran)

Arguments

Type

Name

Req.

Description

SecurityToken

securityToken

R

A unique token that is used to identify a merchant and authenticate the API request.

string

custNum

R

Identifies the Customer.

Note: This value is the CustomerToken.

string

paymentMethodID

R

Identifies the PaymentMethodProfile.

Note: Send 0 to use the default payment method for the customer if applicable.

CustomerTransactionRequest

tran

R

Contains transaction details being sent by the customer.

Required Fields
  • isRecurring
  • InventoryLocation
  • IgnoreDuplicate
  • Details:
    • NonTax
    • Tax
    • Subtotal
    • Shipping
    • SessionID
    • Duty
    • Discount
    • Amount
    • AllowPartialAuth
    • Tip
  • LineItem:
    • Taxable

Return Value

TypeDescription
TransactionResponseReturns whether the transaction was approved, along with the associated batch and transaction details.

Example Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:runCustomerTransaction>
         <ebiz:securityToken>
            <ebiz:SecurityId>************446d-3djf3************</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:securityToken>
         <ebiz:custNum>196*****</ebiz:custNum>
         <ebiz:paymentMethodID>0</ebiz:paymentMethodID>
         <ebiz:tran>
            <ebiz:isRecurring>false</ebiz:isRecurring>
            <ebiz:InventoryLocation/>
            <ebiz:IgnoreDuplicate>false</ebiz:IgnoreDuplicate>
            <ebiz:Details>
               <ebiz:NonTax>false</ebiz:NonTax>
               <ebiz:Tax>0.00</ebiz:Tax>
               <ebiz:Table/>
               <ebiz:Subtotal>10.00</ebiz:Subtotal>
               <ebiz:Shipping>0.00</ebiz:Shipping>
               <ebiz:ShipFromZip/>
               <ebiz:SessionID>1</ebiz:SessionID>
               <ebiz:PONum/>
               <ebiz:OrderID/>
               <ebiz:Invoice/>
               <ebiz:Duty>1</ebiz:Duty>
               <ebiz:Discount>0.00</ebiz:Discount>
               <ebiz:Comments/>
               <ebiz:Description/>
               <ebiz:Currency/>
               <ebiz:Clerk/>
               <ebiz:Amount>10.00</ebiz:Amount>
               <ebiz:AllowPartialAuth>false</ebiz:AllowPartialAuth>
               <ebiz:Terminal/>
               <ebiz:Tip>0.00</ebiz:Tip>
            </ebiz:Details>
            <ebiz:MerchReceiptName/>
            <ebiz:MerchReceiptEmail/>
            <ebiz:Software/>
            <ebiz:MerchReceipt>false</ebiz:MerchReceipt>
            <ebiz:CustReceiptName/>
            <ebiz:CustReceiptEmail/>
            <ebiz:CustReceipt>false</ebiz:CustReceipt>
            <ebiz:CustomFields>
               <!--Zero or more repetitions:-->
               <ebiz:FieldValue>
                  <ebiz:Field/>
                  <ebiz:Value/>
               </ebiz:FieldValue>
            </ebiz:CustomFields>
            <ebiz:ClientIP/>
            <ebiz:CardCode/>
            <ebiz:Command/>
            <ebiz:LineItems>
               <!--Zero or more repetitions:-->
               <ebiz:LineItem>
                  <ebiz:DiscountRate/>
                  <ebiz:ProductRefNum/>
                  <ebiz:SKU/>
                  <ebiz:CommodityCode/>
                  <ebiz:ProductName/>
                  <ebiz:Description/>
                  <ebiz:DiscountAmount/>
                  <ebiz:TaxRate/>
                  <ebiz:UnitOfMeasure/>
                  <ebiz:UnitPrice/>
                  <ebiz:Qty/>
                  <ebiz:Taxable>false</ebiz:Taxable>
                  <ebiz:TaxAmount/>
               </ebiz:LineItem>
            </ebiz:LineItems>
         </ebiz:tran>
      </ebiz:runCustomerTransaction>
   </soapenv:Body>
</soapenv:Envelope>
var client = new IeBizServiceClient();

SecurityToken securityToken = new SecurityToken
{
    SecurityId = "***********34f0-91cd***********",
    UserId = "",
    Password = ""
};

string customerToken = "****1803";
string paymentMethodId = "12118";

CustomerTransactionRequest transactionRequest = new CustomerTransactionRequest();
transactionRequest.Command = "Sale";
transactionRequest.Details = new TransactionDetail()
{
    Discount = 0,
    Duty = 0,
    Tax = 0,
    NonTax = true,
    Tip = 0,
    Shipping = 0,
    Amount = 100,
    ShipFromZip = "92618",
    Invoice = "INV-01",
    PONum = "PO-01",
    OrderID = "ORD-01",
    Description = "Invoice Payment for Landscaping Services"
};
transactionRequest.LineItems = new LineItem[]
{
    new LineItem()
    {
        SKU = "BWLNG-123456",
        ProductName = "Bowling Ball Large",
        Description = "Large Bowling Ball",
        UnitPrice = "100",
        UnitOfMeasure = "EA",
        Qty = "1",
        DiscountAmount = "0",
        TaxAmount = "0",
        Taxable = false
    }
};
transactionRequest.CardCode = "123";
transactionRequest.Software = "Visual Studio";

var result = client.runCustomerTransaction(securityToken, customerToken, paymentMethodId, transactionRequest);
Console.WriteLine($"Result=[{result.Result}] TransactionRefNum=[{result.RefNum}]");
function runCustomerTransaction()
{
  $client = new SoapClient('End point URL');
  $securityToken = array(
    'SecurityId' => '*********4533-45s2**********',
    'UserId' => 'merchant1',
    'Password' => 'merchant1'
  );
  $customerTransactionRequest = array(
    'isRecurring' => false,
    'IgnoreDuplicate' => true,
    'Details' => array(
      'OrderID' => 1,
      'Invoice' => 'AND-0101',
      'PONum' => '****1411',
      'Description' => 'Testing',
      'Amount' => 5000,
      'Tax' => 0,
      'Currency' => 'USD',
      'Shipping' => '',
      'ShipFromZip' => '54000',
      'Discount' => 0,
      'Subtotal' => 5000,
      'AllowPartialAuth' => false,
      'Tip' => 0,
      'NonTax' => false,
      'Duty' => 0,
    ),
    'Software' => 'woocommerce',
    'MerchReceipt' => true,
    'CustReceiptName' => '',
    'CustReceiptEmail' => '[email protected]',
    'CustReceipt' => '2',
    'ClientIP' => '*****.113.34',
    'CardCode' => '123',
    'Command' => 'Credit',
    'LineItems' => array(
      'SKU' => 'Test',
      'ProductName' => 'AC',
      'Description' => 'cool ac',
      'UnitPrice' => 5000,
      'Taxable' => 'N',
      'TaxAmount' => 0,
      'Qty' => 1
    ))
    ;
  $transactionResult = $client->runCustomerTransaction(
    array(
      'securityToken' => $securityToken,
      'custNum' => '****9147',
      'paymentMethodID' => '19',
      'tran' => $customerTransactionRequest
    ))
    ;
  $transaction = $transactionResult->runCustomerTransactionResult;
}

Example 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">
      <runCustomerTransactionResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <runCustomerTransactionResult>
            <CustNum>196*****</CustNum>
            <ResultCode>A</ResultCode>
            <Result>Approved</Result>
            <RemainingBalance>0</RemainingBalance>
            <RefNum>3221********</RefNum>
            <Payload/>
            <isDuplicate>false</isDuplicate>
            <ErrorCode>0</ErrorCode>
            <Error>Approved</Error>
            <VpasResultCode/>
            <ConvertedAmountCurrency>0</ConvertedAmountCurrency>
            <ConvertedAmount>0</ConvertedAmount>
            <ConversionRate>0</ConversionRate>
            <CardCodeResultCode>M</CardCodeResultCode>
            <CardCodeResult>Match</CardCodeResult>
            <BatchRefNum>52****</BatchRefNum>
            <BatchNum>4</BatchNum>
            <AvsResultCode>YYY</AvsResultCode>
            <AvsResult>Address: Match &amp; 5 Digit Zip: Match</AvsResult>
            <AuthCode>123*******</AuthCode>
            <AuthAmount>10</AuthAmount>
            <AcsUrl/>
            <Status>Pending</Status>
            <StatusCode>P</StatusCode>
         </runCustomerTransactionResult>
      </runCustomerTransactionResponse>
   </s:Body>
</s:Envelope>
<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">
      <runCustomerTransactionResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <runCustomerTransactionResult>
            <CustNum>196*****</CustNum>
            <ResultCode>E</ResultCode>
            <Result>Error</Result>
            <RemainingBalance>0</RemainingBalance>
            <RefNum>322********</RefNum>
            <Payload/>
            <isDuplicate>false</isDuplicate>
            <ErrorCode>363</ErrorCode>
            <Error>Transaction amount is required</Error>
            <VpasResultCode/>
            <ConvertedAmountCurrency>0</ConvertedAmountCurrency>
            <ConvertedAmount>0</ConvertedAmount>
            <ConversionRate>0</ConversionRate>
            <CardCodeResultCode/>
            <CardCodeResult>No CVV2/CVC data available for transaction.</CardCodeResult>
            <BatchRefNum>49*****</BatchRefNum>
            <BatchNum>1</BatchNum>
            <AvsResult>No AVS response (Typically no AVS data sent or swiped transaction)</AvsResult>
            <AuthAmount>0</AuthAmount>
            <AcsUrl/>
            <Status>Pending</Status>
            <StatusCode>P</StatusCode>
         </runCustomerTransactionResult>
      </runCustomerTransactionResponse>
   </s:Body>
</s:Envelope>