Transaction.fetchByVid
Web Session Object
Transaction Object
Token Object
Season Set Object
Refund Object
RatePlan Object
Product Object
Payment Provider Object
Payment Method Object
NameValuePair Object
GiftCard Object
Entitlement Object
Chargeback Object
Campaign Object
BillingPlan Object
AutoBill Object
Address Object
Activity Object
Account Object
Transaction.fetchByVid
The fetchByVid method returns a Transaction object whose VID matches the input.
VID is Vindicia’s unique identifier for an object. While saving a Transaction object in its database for the first time after you’ve made a call (such as migrate(), auth(), or authCapture()), Vindicia Subscribe generates and assigns a unique identifier for the object. Some calls return the newly created and updated Transaction object to you in their output response with the VID populated in the output Transaction object. Once you know a Transaction object’s VID, you may refer to that object by its VID in future calls.
Never assign a VID to a new Transaction object; Vindicia Subscribe will generate the VID.
Input
srd: sparse response description, a SOAP string (which must be a JSON object), in which you specify the elements you want returned.This parameter enables the calling system to constrain a method call to return only components you specify. This gives you greater control over returned content, and improves response time within the Vindicia platform by reducing the processing needed for the call.
Some fields are required, either practically or in the WSDL, and will be returned regardless of the srd. A null srd returns the complete response.
vid: the Transaction object’s Vindicia unique identifier, which serves as the search criterion.
Output
return: an object of type Return that indicates the success or failure of the call.
transaction: the Transaction object whose VID matches the input.
Returns
In addition to those listed in Standard Return Codes, this call returns:
Return Code |
Return String |
400 |
No VID specified to load transaction by. |
404 |
One of the following:
|
Example
// Known VID
$vid = "29ed2ea9753896f980095911972d6695b049f54c";
// create a transaction object to make the call
$soap_tx= new Transaction();
// fetch the record(s)
$response = $tx->fetchByVid($vid);
if($response['returnCode'] == 200) {
$fetchedTx = $response['data']->transaction;
// process fetched transactions here
if ($fetchedTx != null) {
// process a fetched transaction here
print "Transaction VID " . $fetchedTx->getVID();
print "Transaction amount ". $fetchedTx->getAmount();
print "Transaction status ";
print $fetchedTx->statusLog[0]->status . "\n";
}
}
else if($response['returnCode'] == 404) {
print "No transaction found: ";
print $response['returnString'] . "\n";
}
For Users
Learn More