Run a sale based on the credit card details of a previous transaction.
This method allows you to run a new transaction using stored customer data. Simply pass the reference number ($RefNum) of a previous transaction and the gateway will automatically transfer the credit card information for use in the new transaction. Some credit card information, such as the card code and magnetic strip cannot be stored. This may cause the new transaction to come in at a higher rate than the original.
See also runTransaction, runSale, voidTransaction, runCredit
TransactionResponse runQuickSale ( ueSecurityToken Token, integer RefNum, TransactionDetail Details, boolean AuthOnly )
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and validate transaction. |
integer | RefNum | Unique transaction reference number assigned by the gateway. |
TransactionDetail | Details | Request transaction details, including transaction amount, invoice number, customer ID, PO number, and other transaction specific data. |
boolean | AuthOnly | If true, the transaction will be authorized, but not be submitted for settlement. |
TransactionResponse | Returns a TransactionResponse object containing the results of the transaction and all relevant data. |
For directions on how to set up the WSDL link, create “$token” and “$client”, go to SOAP PHP How-to.
<?php try { $refnum=1009411; $details=array( "Amount"=>4.00, "Invoice"=>1234, "Description"=>"Test Transaction", "PONum"=>"", "OrderID"=>1234, "Tax"=>0, "Tip"=>0, "NonTax"=>false, "Shipping"=>0, "Discount"=>0, "Subtotal"=>4.00 ); print_r($client->runQuickSale($token,$refnum, $details, true)); } catch(SoapFault $e) { echo $e->getMessage(); echo "\n\nRequest: " . $client->__getLastRequest(); echo "\n\nResponse: " . $client->__getLastResponse(); } ?>
Dim client As usaepay.usaepayService = New usaepay.usaepayService Dim token As usaepay.ueSecurityToken token = Me.CreateToken("982lz9VsLm87MA54Sv8E582h8OZMArL6", "443311") Dim refnum As Integer Dim details As usaepay.TransactionDetail = New usaepay.TransactionDetail Dim authonly As Boolean refnum = "46352757" details.Amount = "34.50" details.AmountSpecified = True details.Description = "Example QuickSale" details.Invoice = "123456" authonly = False Dim response As usaepay.TransactionResponse response = client.runQuickSale(token, refnum, details, authonly) If response.ResultCode = "A" Then MsgBox("Transaction Approved, Reference Number: " & response.RefNum) ElseIf response.ResultCode = "D" Then MsgBox("Transaction Declined, Reason: " & response.Error) Else MsgBox("Transaction Error, Reason: " & response.Error) End If
usaepay.TransactionDetail details = new usaepay.TransactionDetail(); string refnum; bool authonly; refnum = "46973415"; authonly = false; details.Amount = 34.50; details.AmountSpecified = true; details.Description = "Example QuickSale"; details.Invoice = "123456"; usaepay.TransactionResponse response = new usaepay.TransactionResponse(); try { response = client.runQuickSale(token, refnum, details, authonly); 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); }
<?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:runQuickSale> <Token xsi:type="ns1:ueSecurityToken"> <ClientIP xsi:type="xsd:string">192.168.0.1</ClientIP> <PinHash xsi:type="ns1:ueHash"> <HashValue xsi:type="xsd:string">fb8305331a09c4f1002971c5974987ddb0dbba0f</HashValue> <Seed xsi:type="xsd:string">1193442685704132440</Seed> <Type xsi:type="xsd:string">sha1</Type> </PinHash> <SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey> </Token> <RefNum xsi:type="xsd:integer">1118268</RefNum> <Details xsi:type="ns1:TransactionDetail"> <Amount xsi:type="xsd:double">29</Amount> <Clerk xsi:type="xsd:string">John Doe</Clerk> <Currency xsi:type="xsd:integer">0</Currency> <Description xsi:type="xsd:string">Example Transaction</Description> <Discount xsi:type="xsd:double">1</Discount> <Invoice xsi:type="xsd:string">44539</Invoice> <OrderID xsi:type="xsd:string">12345</OrderID> <PONum xsi:type="xsd:string">54321</PONum> <Shipping xsi:type="xsd:double">2</Shipping> <Subtotal xsi:type="xsd:double">16</Subtotal> <Table xsi:type="xsd:string">1</Table> <Tax xsi:type="xsd:double">4</Tax> <Terminal xsi:type="xsd:string">15</Terminal> <Tip xsi:type="xsd:double">8</Tip> </Details> <AuthOnly xsi:type="xsd:boolean">false</AuthOnly> </ns1:runQuickSale> </SOAP-ENV:Body> </SOAP-ENV:Envelope>