#!/usr/bin/perl -w
use strict;
use Google::Checkout::General::Util qw/is_gco_error/;
use Google::Checkout::Notification::Factory qw/get_notification_object/;
#--
#-- Test for all notification
#--
my @notification_xml =
("xml/charge_amount_notification.xml",
"xml/chargeback_amount_notification.xml",
"xml/merchant_calculation_callback.xml",
"xml/new_order_notification.xml",
"xml/order_state_change_notification.xml",
"xml/refund_amount_notification.xml",
"xml/risk_information_notification.xml");
my $xml_header = '';
#--
#-- Memory test cases. This is normal usage as the
#-- XML normally comes from Checkout as post param
#--
push(@notification_xml, $xml_header .
'' .
'');
push(@notification_xml, $xml_header .
'' .
'');
push(@notification_xml, $xml_header .
'' .
'');
push(@notification_xml, $xml_header .
'' .
'');
push(@notification_xml, $xml_header .
'' .
'');
push(@notification_xml, $xml_header .
'' .
'');
push(@notification_xml, $xml_header .
'' .
'');
for my $xml (@notification_xml)
{
my $object = get_notification_object(xml => $xml);
die $object if is_gco_error $object;
print "$xml => " . $object->type . "\n";
}