developer:soap:methods:runcustomertransaction

Soap API v1.2

runCustomerTransaction

Run a transaction using payment data stored in the customer database.

Description

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

Syntax

TransactionResponse runCustomerTransaction ( ueSecurityToken Token, integer CustNum, CustomerTransactionDetail Details, string Command, integer PaymentMethodID )

Arguments

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

Return Value

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.

Examples

PHP

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()); 
 
} 
 
?> 

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

Change History

Version Change
1.2 Modify Details property to use CustomerTransactionsDetails
1.1 Soap 1.1 Release (no changes)
developer/soap/methods/runcustomertransaction.txt · Last modified: 2010/01/25 11:45 by vladg

Page Tools