Revision 710

Date:
2018/08/17 18:17:35
Author:
ahitrov
Revision Log:
create_operation check. Now storing correct sum in transaction and operation

Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/plugins/payments/lib/payments/Provider/Base.pm

     
    99 99 }
    100 100 } elsif ( $opts->{name} eq 'create' ) {
    101 101 $new = 1;
    102 } else {
    103 $self->{result}{error} = 'Попытка создать операцию ['.$opts->{name}.'] без регистрации типа [create]';
    104 return undef;
    102 105 }
    103 106 if ( $new ) {
    104 107 $operation = payments::Operation->new( $keeper );
  • utf8/plugins/payments/lib/payments/Provider/Sber.pm

     
    157 157 order_id => $opts->{orderNumber},
    158 158 name => 'create',
    159 159 uid => $uid,
    160 sum => $opts->{amount},
    160 sum => sprintf("%.2f", $opts->{amount} / 100),
    161 161 });
    162 162 return $self unless ref $operation;
    163 163
     
    192 192 $transaction->order_id( $opts->{orderNumber} );
    193 193 $transaction->operation_id( $operation->id );
    194 194 $transaction->currency_code( 'RUR' );
    195 $transaction->sum( $opts->{amount} );
    195 $transaction->sum( sprintf("%.2f", $opts->{amount} / 100) );
    196 196 $transaction->form_url( $content->{formUrl} );
    197 197 $transaction->name( 'Init' );
    198 198 $transaction->success( 0 );
     
    371 371 order_id => $opts->{orderNumber},
    372 372 name => 'refund',
    373 373 uid => $uid,
    374 sum => $opts->{amount},
    374 sum => sprintf("%.2f", $opts->{amount} / 100),
    375 375 });
    376 376 return $self unless ref $operation;
    377 377
     
    398 398 $transaction->order_id( $order_id );
    399 399 $transaction->operation_id( $operation->id );
    400 400 $transaction->currency_code( 'RUR' );
    401 $transaction->sum( $opts->{amount} );
    401 $transaction->sum( sprintf("%.2f", $opts->{amount} / 100) );
    402 402 $transaction->name( 'Refunded' );
    403 403 $transaction->success( 0 );
    404 404 $transaction->store;