runCustomerTransaction
Run a transaction using payment data stored in the customer database.
Description
This method processes a new transaction using 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 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
function runCustomerTransaction()
{
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '******-454757-4567457-********',
'UserId' => 'merchant1',
'Password' => 'merchant1'
);
$customerTransactionRequest = array(
'isRecurring' => false,
'IgnoreDuplicate' => true,
'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,
),
'Software' => 'woocommerce',
'MerchReceipt' => true,
'CustReceiptName' => '',
'CustReceiptEmail' => '[email protected]',
'CustReceipt' => '2',
'ClientIP' => '110.28.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' => '89147',
'paymentMethodID' => '19',
'tran' => $customerTransactionRequest
))
;
$transaction = $transactionResult->runCustomerTransactionResult;
}
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>********-1906-4be3-b01d-********</ebiz:SecurityId>
<ebiz:UserId>********</ebiz:UserId>
<ebiz:Password>********</ebiz:Password>
</ebiz:securityToken>
<ebiz:custNum>796********</ebiz:custNum>
<ebiz:paymentMethodID>1********7</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>796********</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>0</ConvertedAmountCurrency>
<ConvertedAmount>0</ConvertedAmount>
<ConversionRate>0</ConversionRate>
<CardCodeResultCode>P</CardCodeResultCode>
<CardCodeResult>Not Processed</CardCodeResult>
<BatchRefNum>792********</BatchRefNum>
<BatchNum>1982</BatchNum>
<AvsResultCode>YYY</AvsResultCode>
<AvsResult>Address: Match & 5 Digit Zip: Match</AvsResult>
<AuthCode>24********</AuthCode>
<AuthAmount>200.45</AuthAmount>
<AcsUrl/>
<Status>Pending</Status>
<StatusCode>P</StatusCode>
</runCustomerTransactionResult>
</runCustomerTransactionResponse>
</s:Body>
</s:Envelope>
Updated over 2 years ago