Retrieve list of custom receipt templates
This method allows you pull a list of the receipt templates based on the target receipt type. This type can be “Email”, “Print” or “Both”.
An array of Receipt objects is returned. For efficiency reasons, the actual templates (Receipt.TemplateHTML and Receipt.TemplateText) are not returned by this method. Use getReceipt to pull the full Receipt object including the templates.
If an error occurs, an exception will be thrown.
See also getReceipt
Receipts[] getReceipts ( ueSecurityToken, Target)
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and retrieve the custom fields. |
string | Target | Type of receipts to retreive (Print, Email or Both) |
The following exceptions (errors) are applicable to this method.
Code | Message | Advice |
---|---|---|
20034 | Error pulling receipt templates | 'Internal server error pulling list of receipts, wait and try again or contact support |
For directions on how to set up the WSDL link, create “$token” and “$client”, go to PHP Soap How-to.
<?php try { $templates = $client->getReceipts($token, "Email"); } catch(SoapFault $e) { echo $e->getMessage(); } ?>
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.
Dim target As String target = "email" Dim receipt() As usaepay.Receipt receipt = client.getReceipts(token, target) MsgBox(receipt.Length)
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.
string target = "email"; try { usaepay.Receipt[] receipt = client.getReceipts(token, target); MessageBox.Show(string.Concat(receipt.Length)); } 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:getReceipts> <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">0435eeb0fd2e419e6fdb136d16f5338fd61012c6</HashValue> <Seed xsi:type="xsd:string">11422802808-test</Seed> <Type xsi:type="xsd:string">sha1</Type> </PinHash> <SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey> </Token> <Target xsi:type="xsd:string">Both</Target> </ns1:getReceipts> </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:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:getReceiptsResponse> <getReceiptsReturn SOAP-ENC:arrayType="ns1:Receipt[3]" xsi:type="ns1:ReceiptArray"> <item xsi:type="ns1:Receipt"> <ReceiptRefNum xsi:type="xsd:integer">1</ReceiptRefNum> <Name xsi:type="xsd:string">addReceipt1909111717</Name> <Subject xsi:type="xsd:string">1561375697</Subject> <FromEmail xsi:type="xsd:string">test@test22.com</FromEmail> <Target xsi:type="xsd:string">email</Target> <ContentType xsi:type="xsd:string">both</ContentType> </item> <item xsi:type="ns1:Receipt"> <ReceiptRefNum xsi:type="xsd:integer">4</ReceiptRefNum> <Name xsi:type="xsd:string">tranapi</Name> <Subject xsi:type="xsd:string">Transaction[result.response]-Invoice#[post.UMinvoice] </Subject> <FromEmail xsi:type="xsd:string">test@tmcode.com</FromEmail> <Target xsi:type="xsd:string">email</Target> <ContentType xsi:type="xsd:string">text</ContentType> </item> <item xsi:type="ns1:Receipt"> <ReceiptRefNum xsi:type="xsd:integer">7</ReceiptRefNum> <Name xsi:type="xsd:string">tranapi_customer</Name> <Subject xsi:type="xsd:string">Customer Receipt</Subject> <FromEmail xsi:type="xsd:string">support@usaepay.com</FromEmail> <Target xsi:type="xsd:string">email</Target> <ContentType xsi:type="xsd:string">text</ContentType> </item> </getReceiptsReturn> </ns1:getReceiptsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Version | Change |
---|---|
1.3 | Method added in this release |