runCustomerTransaction

Run a transaction using payment data stored in the customer database.

Description

Processes a new transaction using the payment details stored for the customer. This is a one-time charge and does not use or affect the recurring billing values (such as amount and description) that have been stored for the customer. The transaction result will be tied to the customer and will be visible in the customer's billing history.

Syntax

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

Arguments

Type

Name

Description

SecurityToken

securityToken

EBizCharge Connect security token. (required)

string

custNum

Customer reference number (assigned by the gateway). (required)

string

paymentMethodID

ID of payment method to use for transaction. Send 0 to use default method. (required)

CustomerTransactionRequest

tran

Transaction amount, invoice number, etc. (required)

Return Value

Type

Description

TransactionResponse

Returns all applicable transaction results, including transaction reference number, batch number, transaction result (approved, declined, or error), result code, authorization code, AVS result, CVV2 result, Verified by Visa or SecureCode Mastercard results, and converted currency amount and rate.

Examples

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>c3d6105a-1906-4be3-b01d-e5d6cd68120c</ebiz:SecurityId>
            <ebiz:UserId>A001</ebiz:UserId>
            <ebiz:Password>P01!</ebiz:Password>
         </ebiz:securityToken>
         <ebiz:custNum>79645921</ebiz:custNum>
         <ebiz:paymentMethodID>107</ebiz:paymentMethodID>
         <ebiz:tran>
            <ebiz:Details>
               <ebiz:NonTax>false</ebiz:NonTax>
               <ebiz:Tax>0</ebiz:Tax>
               <ebiz:Shipping>15.00</ebiz:Shipping>
               <ebiz:ShipFromZip>92618</ebiz:ShipFromZip>
               <ebiz:PONum>po001</ebiz:PONum>
               <ebiz:OrderID>s001</ebiz:OrderID>
               <ebiz:Invoice>Inv001</ebiz:Invoice>
               <ebiz:Duty>0</ebiz:Duty>
               <ebiz:Discount>0</ebiz:Discount>
               <ebiz:Comments>Test</ebiz:Comments>
               <ebiz:Description>Test</ebiz:Description>
               <ebiz:Clerk>John Sam</ebiz:Clerk>
               <ebiz:Amount>200.45</ebiz:Amount>
               <ebiz:Terminal>pc-001</ebiz:Terminal>
               <ebiz:Tip>0</ebiz:Tip>
            </ebiz:Details>
            <ebiz:Software>QB</ebiz:Software>
            <ebiz:CardCode>123</ebiz:CardCode>
            <ebiz:Command>sale</ebiz:Command>
            <ebiz:LineItems>
               <ebiz:LineItem>
                  <ebiz:DiscountRate>0</ebiz:DiscountRate>
                  <ebiz:ProductRefNum>r001</ebiz:ProductRefNum>
                  <ebiz:SKU>sk001</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>200.00</ebiz:UnitPrice>
                  <ebiz:Qty>1</ebiz:Qty>
                  <ebiz:Taxable>true</ebiz:Taxable>
                  <ebiz:TaxAmount>5.25</ebiz:TaxAmount>
               </ebiz:LineItem>
            </ebiz:LineItems>
         </ebiz:tran>
      </ebiz:runCustomerTransaction>
   </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">
      <runCustomerTransactionResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <runCustomerTransactionResult>
            <CustNum>79645921</CustNum>
            <ResultCode>A</ResultCode>
            <Result>Approved</Result>
            <RemainingBalance>0</RemainingBalance>
            <RefNum>2529121623</RefNum>
            <Payload/>
            <isDuplicate>false</isDuplicate>
            <ErrorCode>0</ErrorCode>
            <Error>Approved</Error>
            <VpasResultCode/>
            <ConvertedAmountCurrency>0</ConvertedAmountCurrency>
            <ConvertedAmount>0</ConvertedAmount>
            <ConversionRate>0</ConversionRate>
            <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>241968</AuthCode>
            <AuthAmount>200.45</AuthAmount>
            <AcsUrl/>
            <Status>Pending</Status>
            <StatusCode>P</StatusCode>
         </runCustomerTransactionResult>
      </runCustomerTransactionResponse>
   </s:Body>
</s:Envelope>
string custNum = "89147";
           string paymentMethodID = "19";
           eBizCharge.CustomerTransactionRequest tran = new eBizCharge.CustomerTransactionRequest();
           tran.Details = new eBizCharge.TransactionDetail();
           tran.Details.Invoice = "123456";
           tran.Details.Description = "Sample Credit Card Sale";
           tran.Details.Amount = 1.05;
           tran.Details.AmountSpecified = true;
           eBizCharge.TransactionResponse response = new eBizCharge.TransactionResponse();
           try
           {
               response = client.runCustomerTransaction(securityToken, custNum, paymentMethodID, tran);
               MessageBox.Show(string.Concat(response.Result));
           }
           catch (Exception err)
           {
               MessageBox.Show(err.Message);
           }