Revision 352

Date:
2013/05/23 23:13:24
Author:
ahitrov
Revision Log:
Проверка таблицы операций
Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/plugins/monetaru/comps/www/monetaru/check.xml

     
    42 42 <%init>
    43 43
    44 44 warn Dumper \%ARGS if $DEBUG;
    45 unless ( $MNT_ID && $MNT_TRANSACTION_ID && $MNT_OPERATION_ID && $MNT_AMOUNT && $MNT_CURRENCY_CODE ) {
    45 unless ( $MNT_ID && $MNT_TRANSACTION_ID && $MNT_CURRENCY_CODE ) {
    46 46 $m->out('FAIL');
    47 47 return;
    48 48 }
    49 49
    50 50 my $str = $MNT_COMMAND . $MNT_ID . $MNT_TRANSACTION_ID . $MNT_OPERATION_ID . $MNT_AMOUNT . $MNT_CURRENCY_CODE . $MNT_TEST_MODE . $state->{monetaru}->{moneta_sig_code};
    51 51 my $md5 = Digest::MD5::md5_hex ( $str );
    52 warn "MD5 Check: $md5\n" if $DEBUG;
    52 53 unless ( $MNT_SIGNATURE eq $md5 ) {
    53 54 $m->out('FAIL');
    54 55 return;
     
    76 77 unless ( $reply_code ) {
    77 78 my ($obj) = $keeper->get_documents(
    78 79 class => 'monetaru::Transaction',
    79 operation_id => $MNT_OPERATION_ID,
    80 80 order_id => $MNT_TRANSACTION_ID,
    81 81 limit => 1,
    82 82 );
     
    90 90
    91 91 $str = $reply_code . $MNT_ID . $MNT_TRANSACTION_ID . $state->{monetaru}->{moneta_sig_code};
    92 92 my $reply_md5 = Digest::MD5::md5_hex ( $str );
    93 warn "Reply MD5: $reply_md5\n" if $DEBUG;
    93 94
    94 95 </%init>
  • utf8/plugins/monetaru/lib/monetaru/Keeper.pm

     
    64 64 my $self = shift;
    65 65 my (%opts) = @_;
    66 66
    67 return undef unless $opts{type} && ( $opts{order} && ref $opts{order} eq 'webshop::Order' || $opts{uid} && $opts{order} && $opts{sum});
    67 return undef unless $opts{type} && ( $opts{order} && ref $opts{order} || $opts{uid} && $opts{order} && $opts{sum});
    68 68 return undef unless $opts{type} =~ /^(create|suspend|cancel|reform)$/;
    69 69
    70 70 my $op = monetaru::Operation->new( $keeper );