// // finalized // '; // $endpoint = "https://orangebird.app.invoicexpress.com/invoice_receipts/$invoice_id/change-state.xml?api_key=".$api_key; // watchdog('invoicexpress', 'change-state. input: !input', array('!input' => $input), WATCHDOG_INFO); // // Initialize handle and set options // $ch = curl_init(); // curl_setopt($ch, CURLOPT_URL, $endpoint); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_TIMEOUT, 20); // curl_setopt($ch, CURLOPT_POSTFIELDS, $input); // curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml')); // // Execute the request // $return = curl_exec($ch); // ob_end_clean(); // // Close the handle // curl_close($ch); // watchdog('invoicexpress', 'return: !return', array('!return' => print_r($return, true)), WATCHDOG_INFO); // } function ppl_invoicexpress_generate_pdf($invoice_id) { $api_key = variable_get('ppl_invoicexpress_api_key'); $input = ''; $endpoint = "https://orangebird.app.invoicexpress.com/api/pdf/$invoice_id.xml?api_key=".$api_key; watchdog('invoicexpress', 'generate_pdf. input: !input', array('!input' => $input), WATCHDOG_INFO); // Initialize handle and set options $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $endpoint); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 20); curl_setopt($ch, CURLOPT_POSTFIELDS, $input); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml')); // Execute the request do { $return = curl_exec($ch); $ch_error = curl_error($ch); sleep(2); } while (curl_getinfo($ch,CURLINFO_HTTP_CODE) == 202); // Close the handle curl_close($ch); watchdog('invoicexpress', 'return: !return', array('!return' => print_r($return, true)), WATCHDOG_INFO); $xml = simplexml_load_string($return); return (string)$xml->pdfUrl; } function ppl_payout_download_invoice_access($project) { if (user_access('administer nodes')) return true; global $user; if (($project->uid != $user->uid) || ($project->type != 'project') ) return false; $payout = db_query('SELECT * FROM {ppl_payout} WHERE pid = :pid', array(':pid' => $project->nid))->fetchAssoc(); if (empty($payout) || $payout['status'] == 0) return false; return true; } function ppl_payout_download_invoice($project) { $payout = db_query('SELECT * FROM {ppl_payout} WHERE pid = :pid', array(':pid' => $project->nid))->fetchAssoc(); $filename = $payout['filename']; $filename = str_replace("\"", '', $filename); $uri = 'private://invoices/'.$payout['filename']; $headers = array( 'Content-Type' => 'application/pdf', 'Content-Disposition' => 'inline; filename="'.$filename.'"', ); file_transfer($uri, $headers); } Covid19 | PPL

Covid19

Tempos excepcionais exigem medidas excepcionais. É este o momento em que nos encontramos devido à pandemia do novo coronavírus.
A PPL criou este canal exclusivo para campanhas de angariação de fundos cujo objectivo seja apoiar directamente a luta contra o vírus, nomeadamente com material hospitalar, alimentação ou outra logística para os profissionais de saúde.
As campanhas deste canal estão isentas da comissão da plataforma (5% +IVA). Permanecem apenas as comissões de pagamentos e mesmo estas foram reduzidas (2% +IVA).

Criar campanha