developer:soap-1.4:methods:runtransactionapi

Soap API v1.4

runTransactionAPI

This method provides a Soap based interface to the Transaction API.

Description

The parameters argument is an array containing any of the variable names supported by the Transaction API.

This method requires more work to implement than the runTransaction method, and typically should not be your first choice for processing transactions. The one benefit of using this method is that it provides a direct interface to the transaction processing engine of the gateway. As new fields are added to the system they can be used immediately via this method without having to wait for the next Soap release or generate a new WSDL link. The runTransaction method on the other hand has its TransactionRequestObject tied to the Soap release (and wsdl url). To access new fields you would have to generate a new WSDL link.

NOTE: In previous releases this method was called runOldApi.

See also: runTransaction

Syntax

TransactionResponse runTransactionAPI ( ueSecurityToken Token, FieldValue Parameters )

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
FieldValue Parameters List of variables to pass to Transaction API.

Return Value

TransactionResponse Returns a TransactionResponse object containing the results of the transaction and all relevant data.

Exceptions

The following exceptions (errors) are applicable to this method.

Code Message Advice

Examples

PHP

For directions on how to set up the WSDL link, create “$token” and “$client,” see the PHP SOAP How-to.

 <?php
 
  $Request=array(
    array('Field'=>'UMname', 'Value'=>'Tester Jones'),
    array('Field'=>'UMdescription', 'Value'=>'runTrasactionAPI sale'),
    array('Field'=>'UMamount', 'Value'=>'3.51'),
    array('Field'=>'UMinvoice', 'Value'=>'12345'),
    array('Field'=>'UMcard', 'Value'=>'4444555566667779'),
    array('Field'=>'UMexpir', 'Value'=>'0909'),
    array('Field'=>'UMstreet', 'Value'=>'1234 Main Street'),
    array('Field'=>'UMzip', 'Value'=>'99281'),
    array('Field'=>'UMcvv2', 'Value'=>'444')
 
   );
 
  $res=$client->runTransactionAPI($token, $Request);
 
  print_r($res);

.NET VB

For directions on how to set up the WSDL link, create “token” and “client”, go to Visual Basic .Net Soap How-to.

Dim client As usaepay.usaepayService = New usaepay.usaepayService
        Dim token As usaepay.ueSecurityToken
 
        token = Me.CreateToken("714SSUxv1uohng2XkMJ7kLpETsu58G66", "1234")
 
        Dim Fields(0 To 9) As usaepay.FieldValue
        Dim i As Integer
 
        For i = 0 To 9
            Fields(i) = New usaepay.FieldValue
        Next i
 
        Fields(0).Field = "UMname"
        Fields(0).Value = "Tester Jones"
        Fields(1).Field = "UMdescription"
        Fields(1).Value = "Visual Basic For Dummies"
        Fields(2).Field = "UMamount"
        Fields(2).Value = "1.00"
        Fields(3).Field = "UMinvoice"
        Fields(3).Value = "12345"
        Fields(4).Field = "UMcard"
        Fields(4).Value = "4444555566667779"
        Fields(5).Field = "UMexpir"
        Fields(5).Value = "1212"
        Fields(6).Field = "UMstreet"
        Fields(6).Value = "1234 Main Street"
        Fields(7).Field = "UMzip"
        Fields(7).Value = "90210"
        Fields(8).Field = "UMcvv2"
        Fields(8).Value = "999"
 
        Dim response As usaepay.TransactionResponse
 
        response = client.runTransactionAPI(token, Fields)
 
        MsgBox("Reference Number: " & response.RefNum)

.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.

usaepay.FieldValue[] tran = new usaepay.FieldValue[9];
 
for (int i = 0; i < 9; i++)
{
   tran[i] = new usaepay.FieldValue();
}
 
tran[0].Field = "UMname";           tran[0].Value = "Tester Jones";
tran[1].Field = "UMdescription";    tran[1].Value = "runTransactionAPI sale";
tran[2].Field = "UMamount";         tran[2].Value = "1.00";
tran[3].Field = "UMinvoice";        tran[3].Value = "12345";
tran[4].Field = "UMcard";           tran[4].Value = "4444555566667779";
tran[5].Field = "UMexpir";          tran[5].Value = "1212";
tran[6].Field = "UMstreet";         tran[6].Value = "123 Main Street";
tran[7].Field = "UMzip";            tran[7].Value = "90046";
tran[8].Field = "UMcvv2";           tran[8].Value = "999";
 
usaepay.TransactionResponse response = new usaepay.TransactionResponse();
 
try
{
   response = client.runTransactionAPI(token, tran);
 
   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

<?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:runTransactionAPI>
<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">11ac55b0a0b59f8f028dbf85bc32266fa973dd0e</HashValue>
<Seed xsi:type="xsd:string">12678150211876663375</Seed>
<Type xsi:type="xsd:string">sha1</Type>
</PinHash>
<SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
</Token>
<Parameters SOAP-ENC:arrayType="ns1:FieldValue[9]" xsi:type="ns1:FieldValueArray">
<item xsi:type="ns1:FieldValue">
<Field xsi:type="xsd:string">UMname</Field>
<Value xsi:type="xsd:string">Tester Jones</Value>
</item>
<item xsi:type="ns1:FieldValue">
<Field xsi:type="xsd:string">UMdescription</Field>
<Value xsi:type="xsd:string">runTrasactionAPI sale</Value>
</item>
<item xsi:type="ns1:FieldValue">
<Field xsi:type="xsd:string">UMamount</Field>
<Value xsi:type="xsd:string">3.51</Value>
</item>
<item xsi:type="ns1:FieldValue">
<Field xsi:type="xsd:string">UMinvoice</Field>
<Value xsi:type="xsd:string">12345</Value>
</item>
<item xsi:type="ns1:FieldValue">
<Field xsi:type="xsd:string">UMcard</Field>
<Value xsi:type="xsd:string">4444555566667779</Value>
</item>
<item xsi:type="ns1:FieldValue">
<Field xsi:type="xsd:string">UMexpir</Field>
<Value xsi:type="xsd:string">1212</Value>
</item>
<item xsi:type="ns1:FieldValue">
<Field xsi:type="xsd:string">UMstreet</Field>
<Value xsi:type="xsd:string">1234 Main Street</Value>
</item>
<item xsi:type="ns1:FieldValue">
<Field xsi:type="xsd:string">UMzip</Field>
<Value xsi:type="xsd:string">99281</Value>
</item>
<item xsi:type="ns1:FieldValue">
<Field xsi:type="xsd:string">UMcvv2</Field>
<Value xsi:type="xsd:string">444</Value>
</item>
</Parameters>
</ns1:runTransactionAPI>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Change History

Version Change
1.1 Method added prior to soap-1.1
developer/soap-1.4/methods/runtransactionapi.txt · Last modified: 2011/05/20 11:49 by tem

Page Tools