diff --git a/lib/Pear/LocalLoop/Controller/Api/Transactions.pm b/lib/Pear/LocalLoop/Controller/Api/Transactions.pm index 93d69f4..221eaf6 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Transactions.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Transactions.pm @@ -55,9 +55,16 @@ sub post_transaction_list_purchases { seller => $_->seller->name, value => $_->value / 100000, purchase_time => $c->format_iso_datetime($_->purchase_time), - net_value => $_->meta->net_value / 100000, - sales_tax_value => $_->meta->sales_tax_value / 100000, - gross_value => $_->meta->gross_value / 100000, + ( $_->meta ? ( + net_value => $_->meta->net_value / 100000, + sales_tax_value => $_->meta->sales_tax_value / 100000, + gross_value => $_->meta->gross_value / 100000, + ) : ( + net_value => undef, + sales_tax_value => undef, + gross_value => undef, + )), + }} $transactions->all );