<?php //get invoice details $invoice = invoice::select('1'); //echo json_encode($invoice); //header('Content-type: application/xml'); echo encode::xml($invoice); //print_r($invoice);
<?php ini_set('max_execution_time', 600); //600 seconds = 10 minutes $cron = new cron(); $cron->domain_id=1; $message = $cron->run(); try { //json //header('Content-type: application/json'); //echo encode::json( $message, 'pretty' ); //xml ob_end_clean(); header('Content-type: application/xml'); echo encode::xml( $message ); } catch (Exception $e) { echo $e->getMessage(); }
$payment->ac_payment_type = $payment_type->select_or_insert_where(); $logger->log('Paypal - payment_type=' . $payment->ac_payment_type, Zend_Log::INFO); $payment->insert(); $invoice = invoice::select($p->ipn_data['invoice']); #$invoice = invoice::select($_POST['invoice']); $biller = getBiller($invoice['biller_id']); //send email $body = "A Paypal instant payment notification was successfully recieved into Simple Invoices\n"; $body .= "from " . $p->ipn_data['payer_email'] . " on " . date('m/d/Y'); $body .= " at " . date('g:i A') . "\n\nDetails:\n"; $body .= $paypal_data; $email = new email(); $email->notes = $body; $email->to = $biller['email']; $email->from = "*****@*****.**"; $email->subject = 'Instant Payment Notification - Recieved Payment'; $email->send(); $xml_message['data'] .= $body; } } else { $xml_message .= "Paypal validate failed"; $logger->log('Paypal validate failed', Zend_Log::INFO); } header('Content-type: application/xml'); try { $xml = new encode(); $xml->xml($xml_message); echo $xml; } catch (Exception $e) { echo $e->getMessage(); }