<?php //include_once constant("MP_POST_NOTIFICATION") . "StatusNotification.php"; $_POST[$STATUS_NOTIF_POST] = GetXml(); // $_POST[$STATUS_NOTIF_POST] = GetCreditCardXml(); // $_POST[$STATUS_NOTIF_POST] = GetBoletoXml(); // $_POST[$STATUS_NOTIF_POST] = GetOnlineDebitXml(); // $_POST[$STATUS_NOTIF_POST] = GetNoTransactionsXml(); $xmlString = $_POST[$STATUS_NOTIF_POST]; // Converte o Xml para um objeto do tipo StatusNotification $statusNotification = StatusNotification::ParseFromXml($xmlString); // Exibe o conteúdo var_dump($statusNotification); function GetXml() { return utf8_encode(utf8_encode('<StatusNotification xmlns="http://schemas.datacontract.org/2004/07/MundiPagg.NotificationService.DataContract" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:schemaLocation="http://schemas.datacontract.org/2004/07/MundiPagg.NotificationService.DataContract StatusNotificationXmlSchema.xsd"> <AmountInCents>500</AmountInCents> <AmountPaidInCents>0</AmountPaidInCents> <BoletoTransaction> <AmountInCents>500</AmountInCents> <AmountPaidInCents>0</AmountPaidInCents> <BoletoExpirationDate>2013-02-08T00:00:00</BoletoExpirationDate> <NossoNumero>0123456789</NossoNumero> <StatusChangedDate>2012-11-06T08:55:49.753</StatusChangedDate> <TransactionKey>4111D523-9A83-4BE3-94D2-160F1BC9C4BD</TransactionKey> <TransactionReference>B2E32108</TransactionReference> <PreviousBoletoTransactionStatus>Generated</PreviousBoletoTransactionStatus> <BoletoTransactionStatus>Paid</BoletoTransactionStatus> </BoletoTransaction>
/** * Automatically saves the post notification message. */ private static function AutoSaveRequestResponseData($postData) { if (constant("MP_ENABLE_AUTO_SAVE_MESSAGES")) { try { StatusNotification::SavePostNotificationData($postData, constant("MP_AUTO_SAVE_MESSAGES_PATH")); } catch (Exception $ex) { } } }