<%once> my %NAMES = ( 'MerchantBlock' => 'Authorized', 'MerchantPay' => 'Charged', 'MerchantRefund' => 'Refunded', ); <%args> $SessionId => undef $OrderId => undef $Notification => undef $Success => undef $Amount => undef $CardNumber => undef $MerchantContract => undef <%init> warn Dumper \%ARGS; my $provider = payments::Provider::PayTure->new; my (@operations, $transaction); if ( $OrderId ) { @operations = $keeper->get_documents( class => 'payments::Operation', order_id => $OrderId, order_by => 'ctime', ); ($transaction) = $keeper->get_documents ( class => 'payments::Transaction', provider => $provider->payment_system, order_id => $OrderId, order_by => 'ctime desc', limit => 1, ); } if ( ref $transaction ) { $transaction->name( $NAMES{$Notification} ); $transaction->success( $Success eq 'True' ? 1 : 0 ); $transaction->store; if ( $transaction->success && $keeper->can('_payture_handler') ) { $keeper->_payture_handler( $transaction ); } }