Retrieve a receipt template identified by Name.
This method allows you to retrieve the receipt template identified by Name. This method will return the merchant's receipt template if it exists. Otherwise, if a system default template exists for “Name” it will be returned. If a system default is returned, the ReceiptRefNum in the resulting object will be “0”.
If successful this method will return a Receipt object. If receipt is not found and exception will be thrown.
See also addReceipt, updateReceipt and getReceipt
Receipt getReceiptByName ( ueSecurityToken, Name)
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and retrieve the custom fields. |
string | Name | Name of receipt |
Receipt | Returns a Receipt object for the requested receipt. |
The following exceptions (errors) are applicable to this method.
Code | Message | Advice |
---|---|---|
20030 | Requested receipt not found | No receipts were matched using Name. |
For directions on how to set up the WSDL link, create “$token” and “$client”, go to PHP Soap How-to.
<?php try { $Name = 'vterm'; $res = $client->getReceiptByName($token, $Name); echo base64_decode($res->TemplateText); } catch(SoapFault $e) { echo $e->getMessage(); } ?>
For directions on how to set up the web reference and create “token” and “client” variables, go to the VB Soap How-to.
Dim receipt As usaepay.Receipt receipt = client.getReceiptByName(token, "vterm")
string name = "recurring"; try { usaepay.Receipt receipt = client.getReceiptByName(token, name); MessageBox.Show(string.Concat(receipt.ReceiptRefNum)); } catch (Exception err) { MessageBox.Show(err.Message); }
Request:
<?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:getReceiptByName> <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">8f63a3359735a07580f240b9eb31f776492e7793</HashValue> <Seed xsi:type="xsd:string">12517578291984318268</Seed> <Type xsi:type="xsd:string">sha1</Type> </PinHash> <SourceKey xsi:type="xsd:string">1B93L5cpXV5hbx557d183q96EZ2jpqEf</SourceKey> </Token> <Name xsi:type="xsd:string">vterm</Name> </ns1:getReceiptByName> </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: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:getReceiptByNameResponse> <getReceiptByNameReturn xsi:type="ns1:Receipt"> <ReceiptRefNum xsi:type="xsd:integer">25</ReceiptRefNum> <Name xsi:type="xsd:string">test1</Name> <Subject xsi:type="xsd:string">test2</Subject> <FromEmail xsi:type="xsd:string">test@testing3.com</FromEmail> <Target xsi:type="xsd:string">email</Target> <ContentType xsi:type="xsd:string">both</ContentType> <TemplateHTML xsi:type="xsd:string">dGVzdDM=</TemplateHTML> <TemplateText xsi:type="xsd:string">dGVzdDQ=</TemplateText> </getReceiptReturn> </ns1:getReceiptByNameResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Version | Change |
---|---|
1.3 | Method added in this release |