Run a transaction using payment data stored in the customer database.
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. The customer does not need to have recurring billing enabled for this method to be used.
See also enableCustomer, disableCustomer, deleteCustomer, searchCustomerID, getCustomer, searchCustomers, getCustomerHistory, addCustomer, addCustomerPaymentMethod, deleteCustomerPaymentMethod, updateCustomer, quickUpdateCustomer
TransactionResponse runCustomerTransaction ( ueSecurityToken Token, integer CustNum, CustomerTransactionDetail Details, string Command, integer PaymentMethodID )
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and validate transaction. |
integer | CustNum | Customer Reference number assigned by the gateway |
CustomerTransactionDetail | Details | Transaction amount, invoice number, etc. |
string | Command | Command to run. Possible values: Sale, AuthOnly, Credit, Check and CheckCredit. If a blank is passed, the default value is Sale for credit card or Check for checks |
integer | PaymentMethodID | ID of payment method to use for transaction. Send 0 to use default method |
TransactionResponse | Returns all applicable transaction results including transaction reference number, batch number, transaction result (approved, declined, error), result code, authorization code, AVS result, CVV2 result, Verified by Visa or SecureCode Mastercard results, and converted currency amount and rate. |
For directions on how to set up the WSDL link, create “$token” and “$client”, go to PHP Soap How-to.
<?php try { $Details=array( 'Invoice' => rand(), 'PONum' => '', 'OrderID' => '', 'Description' => 'Sample Credit Card Sale', 'Amount'=>'1.50' ); $CustNum='1575'; $Command='Sale'; $PayMethod='0'; $res=$client->runCustomerTransaction($token, $CustNum, $Details, $Command, $PayMethod); print_r($res); } catch (SoapFault $e) { echo $client->__getLastRequest(); echo $client->__getLastResponse(); die("runCustomerTransaction failed :" .$e->getMessage()); } ?>
Dim custnum As String custnum = "115163" Dim paymentMethodID As String paymentMethodID = "70" Dim tran As usaepay.CustomerTransactionDetail = New usaepay.CustomerTransactionDetail tran.Invoice = "123456" tran.Description = "Sample Credit Card Sale" tran.Amount = 1.05 tran.AmountSpecified = True Dim response As usaepay.TransactionResponse response = New usaepay.TransactionResponse response = client.runCustomerTransaction(token, custnum, tran, "Sale", paymentMethodID) MessageBox.Show(String.Concat(response.Result))
string custNum = "105619"; string paymentMethodID = "42"; usaepay.CustomerTransactionDetail tran = new usaepay.CustomerTransactionDetail(); tran.Invoice = "123456"; tran.Description = "Sample Credit Card Sale"; tran.Amount = 1.05; tran.AmountSpecified = true; usaepay.TransactionResponse response = new usaepay.TransactionResponse(); try { response = client.runCustomerTransaction(token, custNum, tran, "Sale", paymentMethodID); MessageBox.Show(string.Concat(response.Result)); } catch (Exception err) { MessageBox.Show(err.Message); }
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:usaepay" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:runCustomerTransaction> <Token xsi:type="ns1:ueSecurityToken"> <ClientIP xsi:type="xsd:string">10.0.19.14</ClientIP> <PinHash xsi:type="ns1:ueHash"> <HashValue xsi:type="xsd:string">0b28da35036014cbea997c260974f4c50a6899b2</HashValue> <Seed xsi:type="xsd:string">126444824054945895</Seed> <Type xsi:type="xsd:string">sha1</Type> </PinHash> <SourceKey xsi:type="xsd:string">28tDcf1jdpWAvMEFbF6wYUdM5Gcxkt1l</SourceKey> </Token> <CustNum xsi:type="xsd:integer">51353</CustNum> <Details xsi:type="ns1:CustomerTransactionDetail"> <Amount xsi:type="xsd:double">1.5</Amount> <Description xsi:type="xsd:string">Sample Credit Card Sale</Description> <Invoice xsi:type="xsd:string">1694755200</Invoice> <OrderID xsi:type="xsd:string"></OrderID> <PONum xsi:type="xsd:string"></PONum> </Details> <Command xsi:type="xsd:string">Sale</Command> <PaymentMethodID xsi:type="xsd:integer">0</PaymentMethodID> </ns1:runCustomerTransaction> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Version | Change |
---|---|
1.2 | Modify Details property to use CustomerTransactionsDetails |
1.1 | Soap 1.1 Release (no changes) |