Skip to main content

Sending a Receipt

Basics

The complete example for sending a receipt notification is illustrated in the following file: ./examples/document/receipt/send_receipt.php

To send a receipt notification, the following steps are necessary:

// 1. Create a receipt (setting the receipt number)
$receipt = new Receipt('NYGTA-2021-001');

// 2. Initialize the buyer
$buyer = new Buyer();

// 3. Set the buyer's email address (where the notification will be sent)
$buyer->setEmail('vevo@example.com');

// 4. Add buyer data to the receipt
$receipt->setBuyer($buyer);

// 5. Create the seller
$seller = new Seller();

// 6. Set the seller's email notification details
$seller->setEmailReplyTo('elado@example.com');
$seller->setEmailSubject('Email tárgya');
$seller->setEmailContent('Ez az email szövege...');

// 7. Add seller data to the receipt
$receipt->setSeller($seller);

// 8. Send the receipt
$result = $agent->sendReceipt($receipt);

Expected and Optional Inputs

Receipt Header Data

DescriptionFieldTypeRequiredDefault
receipt numberreceiptNumberstringyes

Email Sending Data

DescriptionFieldTypeRequiredDefault
emailemailstring
email reply-toemailReplyTostring
email subjectemailSubjectstring
email contentemailContentstring