runQuickCredit
Run a credit based on the credit card details of a previous transaction.
Description
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, runAuthOnly
Syntax
TransactionResponse runQuickCredit ( ueSecurityToken Token, string RefNum, TransactionDetail Details )
Arguments
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and validate transaction. |
string | RefNum | Unique transaction reference number assigned by the gateway. You can also use TransKey in the RefNum field. |
TransactionDetail | Details | Request transaction details, including transaction amount, invoice number, customer ID, PO number, and other transaction specific data. |
Return Value
Type | Description |
---|---|
TransactionResponse | Returns a TransactionResponse object containing the results of the transaction and all relevant data. |
Examples
PHP
For directions on how to set up the WSDL link, create "$token" and "$client", go to SOAP PHP How-to.
<?php
try {
$refnum="1nfmkr4rsmtxhm5";
$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->runQuickCredit($token,$refnum, $details));
}
catch(SoapFault $e) {
echo $e->getMessage();
echo "\n\nRequest: " . $client->__getLastRequest();
echo "\n\nResponse: " . $client->__getLastResponse();
}
?>
Java
This example uses the Newtek Gateway Java library. For directions on how to install the library and create the token/client objects, go to the Java JAX-WS Howto.
try {
//Set RefNum to the transaction refference number
//you want to run a quick credit on
BigInteger RefNum = new BigInteger("123456789");
//populate transaction details
TransactionDetail details = new TransactionDetail();
details.setAmount(22.34);
details.setDescription("QuickCredit");
details.setInvoice("119891");
// Create response object
TransactionResponse response;
response = client.runQuickCredit(token, RefNum, details, false);
System.out.println("Response: " + response.getResult());
System.out.println("RefNum: " + response.getRefNum());
} catch (Exception e) {
System.out.println("Soap Exception: " + e.getMessage());
}
```
### VB
For directions on how to set up the WSDL link and create the "token" and "client" variables, go to the [Visual Basic .Net Soap How-to](http://help.newtekgateway.com/developer/soap-api/howto/vb/).
```vb
Dim client As newtek.newtekService = New newtek.newtekService
Dim token As newtek.ueSecurityToken
token = Me.CreateToken("714SSUxv1uohng2XkMJ7kLpETsu58G66", "1234")
Dim refnum As Integer
Dim details As newtek.TransactionDetail = New newtek.TransactionDetail
refnum = "46990787"
details.Amount = "1.00"
details.AmountSpecified = True
details.Description = "Example QuickCredit"
details.Invoice = "123456"
Dim response As newtek.TransactionResponse
response = client.runQuickCredit(token, refnum, details)
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
.NET C
For directions on how to set up the WSDL link and create the "token" and "client" variables, go to the C Sharp .Net Soap How-to.
newtek.TransactionDetail details = new newtek.TransactionDetail();
string refnum;
refnum = "46973415";
details.Amount = 34.50;
details.AmountSpecified = true;
details.Description = "Example QuickCredit";
details.Invoice = "123456";
newtek.TransactionResponse response = new newtek.TransactionResponse();
try
{
response = client.runQuickCredit(token, refnum, details);
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
Request:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:newtek"
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:runQuickCredit>
<Token xsi:type="ns1:ueSecurityToken">
<ClientIP xsi:type="xsd:string">123.123.123.123</ClientIP>
<PinHash xsi:type="ns1:ueHash">
<HashValue xsi:type="xsd:string">91524b471de4baf26cc6abec7e81e16108354d61</HashValue>
<Seed xsi:type="xsd:string">12115174123-test</Seed>
<Type xsi:type="xsd:string">sha1</Type>
</PinHash>
<SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
</Token>
<RefNum xsi:type="xsd:string">102164125</RefNum>
<Details xsi:type="ns1:TransactionDetail">
<Amount xsi:type="xsd:double">22</Amount>
<Clerk xsi:type="xsd:string">John Doe</Clerk>
<Currency xsi:type="xsd:string">0</Currency>
<Description xsi:type="xsd:string">Example Transaction</Description>
<Discount xsi:type="xsd:double">10</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">12</Subtotal>
<Table xsi:type="xsd:string">1</Table>
<Tax xsi:type="xsd:double">10</Tax>
<Terminal xsi:type="xsd:string">15</Terminal>
<Tip xsi:type="xsd:double">8</Tip>
</Details>
<param3 xsi:type="xsd:boolean">false</param3>
</ns1:runQuickCredit>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Response:
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:newtek"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:runQuickCreditResponse>
<runQuickCreditReturn xsi:type="ns1:TransactionResponse">
<AcsUrl xsi:nil="true" />
<AuthAmount xsi:type="xsd:double">0</AuthAmount>
<AuthCode xsi:type="xsd:string">102174451</AuthCode>
<AvsResult xsi:type="xsd:string">Unmapped AVS response ( )</AvsResult>
<AvsResultCode xsi:type="xsd:string"></AvsResultCode>
<BatchNum xsi:type="xsd:string">198205</BatchNum>
<BatchRefNum xsi:type="xsd:string">198205</BatchRefNum>
<CardCodeResult xsi:type="xsd:string">No CVV2/CVC data available for transaction.</CardCodeResult>
<CardCodeResultCode xsi:type="xsd:string"></CardCodeResultCode>
<CardLevelResult xsi:type="xsd:string">Unknown Code</CardLevelResult>
<CardLevelResultCode xsi:type="xsd:string"></CardLevelResultCode>
<ConversionRate xsi:type="xsd:double">0</ConversionRate>
<ConvertedAmount xsi:type="xsd:double">0</ConvertedAmount>
<ConvertedAmountCurrency xsi:nil="true" />
<CustNum xsi:type="xsd:string">0</CustNum>
<Error xsi:type="xsd:string"></Error>
<ErrorCode xsi:nil="true" />
<isDuplicate xsi:type="xsd:boolean">false</isDuplicate>
<Payload xsi:nil="true" />
<RefNum xsi:type="xsd:string">102164428</RefNum>
<Result xsi:type="xsd:string">Approved</Result>
<ResultCode xsi:type="xsd:string">A</ResultCode>
<Status xsi:type="xsd:string">Pending</Status>
<StatusCode xsi:type="xsd:string">P</StatusCode>
<VpasResultCode xsi:type="xsd:string"></VpasResultCode>
</runQuickCreditReturn>
</ns1:runQuickCreditResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Change Log
Version | Change |
---|---|
1.7 | TransKey can be used in RefNum field. |