File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -115,4 +115,40 @@ public function cancel( $id ) {
115115 }
116116 }
117117
118+ /**
119+ * Sends the receipt to the customer's email
120+ *
121+ * @param id : Unique ID for Receipt
122+ *
123+ * @return JSON object for requested Receipt
124+ *
125+ * @throws Facturapi_Exception
126+ **/
127+ public function send_by_email ( $ id , $ email = null ) {
128+ try {
129+ return json_decode ( $ this ->execute_JSON_post_request (
130+ $ this ->get_request_url ($ id ) . "/email " ,
131+ $ email == null ? array () : array ("email " => $ email )
132+ ));
133+ } catch ( Facturapi_Exception $ e ) {
134+ throw new Facturapi_Exception ( 'Unable to send Receipt: ' . $ e );
135+ }
136+ }
137+
138+ /**
139+ * Downloads the specified receipt in a PDF file
140+ *
141+ * @param id : Unique ID for Receipt
142+ *
143+ * @return PDF file in a stream
144+ *
145+ * @throws Facturapi_Exception
146+ **/
147+ public function download_pdf ( $ id ) {
148+ try {
149+ return $ this ->execute_get_request ( $ this ->get_request_url ( $ id ) . "/pdf " );
150+ } catch ( Facturapi_Exception $ e ) {
151+ throw new Facturapi_Exception ( 'Unable to download PDF file: ' . $ e );
152+ }
153+ }
118154}
You can’t perform that action at this time.
0 commit comments