deleteReceipt

Delete receipt template

Description

This method allows you to delete an existing custom receipt template.

If the receipt is successfully deleted "true" will be returned. If an error occurs, an exception will be thrown.

See also addReceipt

Syntax

deleteReceipt token ueSecurityToken, string ReceiptRefNum

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and retrieve the custom fields.
string ReceiptRefNum Gateway assigned receipt ID

Return Value

Name Description
boolean Returns true if receipt is deleted

Exceptions

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

Code Message Advice
20030 Requested receipt not found ReceiptRefNum must match an existing receipt.

Examples

PHP

For directions on how to set up the WSDL link, create "$token" and "$client", go to PHP Soap How-to.

    try {
      $ReceiptRefNum = 2;
      $res = $client->deleteReceipt($token, $ReceiptRefNum);
    }

    catch(SoapFault $e) {

      echo $e->getMessage();

    }

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

                string receiptRefNum = "5";
                Boolean response;

                try
                {
                    response = client.deleteReceipt(token, receiptRefNum);
                    MessageBox.Show(string.Concat(response));

                }
                catch (Exception err)
                {
                    MessageBox.Show(err.Message);
                }

XML

Request:

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="urn:newtek"
    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:deleteReceipt>
    <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">e4b00f3f04b7671059cda8568d339f4d8d1f7dcd</HashValue>
    <Seed xsi:type="xsd:string">11104024317-test</Seed>
    <Type xsi:type="xsd:string">sha1</Type>
    </PinHash>
    <SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
    </Token>
    <ReceiptRefNum xsi:type="xsd:string">16</ReceiptRefNum>
    </ns1:deleteReceipt>
    </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:newtek"
    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:deleteReceiptResponse>
    <deleteReceiptReturn xsi:type="xsd:boolean">true</deleteReceiptReturn>
    </ns1:deleteReceiptResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

Change Log

Version Change
1.7 Changed ReceiptRefNum to type string