% if ( defined $txn ) {

<% $expired ? 'Expired' : 'Valid' %> Transaction

% if ( $failed ) {

It appears that your download has failed: <% $failed %>

% }

% unless ( $expired ) { Download URL: <% $txn->item_name %>
% } Expiration Date: <% UnixDate( DateCalc( $txn->download_expiration,"+ 30 days",\$err), "%h %d, %Y" ) %> (Order Placed <% UnixDate( $txn->download_expiration, "%h %d, %Y" ) %>)
File Properties: <% $item->properties %>

Your download will be available for 30 days from the date of your purchase. If you have any problems successfully downloading the PDF, please contact us at support@tristream.com.

% } else {

This does not appear to be a valid order.

% } <%args> $txn_id => undef $failed => undef <%init> my $err; my $base = q{/download/}; my $file = $base . $txn_id; my $txn = $schema->txn->row_by_pk( pk => $txn_id ) if ( $txn_id ); my $date = UnixDate( ParseDate("today"), "%Y%m%d"); my ( $item, $expired ); if ( defined $txn ) { my $item_number = $txn->item_number; $item = $schema->item->row_by_pk( pk => $item_number ); my $expiration = UnixDate( DateCalc( $txn->download_expiration,"+ 30 days",\$err), "%Y%m%d" ); $expired = ( $date > $expiration ? 1 : 0 ); }