emailTransactionReceipt

Parent Previous Next

emailTransactionReceipt

Emails a new receipt for an existing customer. Requires a custom receipt to be selected by id

 

Description

This method allows you to email a new receipt for a existing transaction. This requires a receipt reference number, a transaction reference number and a valid email address. Receipt reference numbers are returned by addReceipt, getReceipts and can be found in the merchant console on the receipts edit page. Transaction reference numbers can be found in the transactionResponse or retrieved with searchTransactionsCustom.

Default receipts cannot be sent with this method. To send a default receipt please use emailTransactionReceiptByName.

 

Syntax

boolean emailTransactionReceipt ( ueSecurityToken, TransactionRefNum, ReceiptRefNum, EmailAddress)

 

Arguments

 

Type

Name

Description

ueSecurityToken

Token

Merchant security token: used to identify merchant and retrieve the custom fields.

 

Return Value

 

boolean

Indicates if the receipt sent successfully

 

Exceptions

 

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

 

Code

Message

Advice

20001

Specified transactions was not found.

TransactionRefNum did not match a Transaction in the merchants account.

20030

Requested receipt not found

ReceiptRefNum did not match any of the merchants receipts

 

Examples

 

PHP

 

<?php

try {

 $TransactionRefNum=123456789;

 $ReceiptRefNum=12;

 $sent = $this->client->emailTransactionReceipt($this->token, $TransactionRefNum, $ReceiptRefNum,'email@address.com');

}

catch(SoapFault $e) {

 echo $e->getMessage();

}

?>

 

 

.NET VB

 

Dim refnum As String

       refnum = "46973419"

       Dim receipt As String

       receipt = "2"

       Dim result As Boolean

       result = client.emailTransactionReceipt(token, refnum, receipt, "email@mycompany.com")

       MsgBox(result)

 

 

.NET C#

 

string refnum;

           refnum = "46973419";

           string receipt = "2";

           Boolean result;

           try

           {

               result = client.emailTransactionReceipt(token, refnum, receipt, "email@mycompany.com");

               if (result)

               {

                   MessageBox.Show(string.Concat("Email is sent"));

               }

               else MessageBox.Show("Error");

           }

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

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

<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">11ac55b0a0b59f8f028dbf85bc32266fa973dd0e</HashValue>

<Seed xsi:type="xsd:string">12678150211876663375</Seed>

<Type xsi:type="xsd:string">sha1</Type>

</PinHash>

<SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>

</Token>

<RefNum xsi:type="xsd:integer">123456789</RefNum>

<ReceiptRefNum xsi:type="xsd:integer">12</ReceiptRefNum>

<Email xsi:type="xsd:string">email@address.com</Email>

</ns1:emailTransactionReceipt>

</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:eBizCharge"

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

 <emailTransactionReceiptReturn xsi:type="xsd:boolean">true</emailTransactionReceiptReturn>

</ns1:emailTransactionReceiptResponse>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

: