getMandatoryField("Type"); if (strcasecmp($type, "Notification") != 0) { throw new OffAmazonPaymentsNotifications_InvalidMessageException( "Error with SNS Notification - unexpected message with Type of " . $type ); } } /** * Generate an sns metadata instance based on the values * in the sns message * * @param message $snsJsonMsg convertedJsonMsg to attach the metadata to * * @throws OffAmazonPaymentsNotifications_InvalidMessageException if not correct type * * @return void */ private static function _setMetadataForMessage(Message $snsMsg) { $notificationMetadata = new OffAmazonPaymentsNotifications_Model_SnsNotificationMetadata($snsMsg); $snsMsg->setNotificationMetadata($notificationMetadata); } }