@@ -49,20 +49,20 @@ public function execute()
4949
5050 $ history = json_decode ($ metaData ['cryptapi_history ' ], true );
5151
52- $ calc = $ this ->payment ::calcOrder ($ history , $ metaData[ ' cryptapi_total ' ], $ metaData [ ' cryptapi_total_fiat ' ] );
52+ $ calc = $ this ->payment ::calcOrder ($ history , $ metaData );
5353
5454 $ already_paid = $ calc ['already_paid ' ];
5555 $ already_paid_fiat = $ calc ['already_paid_fiat ' ] <= 0 ? 0 : $ calc ['already_paid_fiat ' ];
5656
5757 $ min_tx = floatval ($ metaData ['cryptapi_min ' ]);
5858
59- $ remaining = $ calc ['remaining ' ];
59+ // $remaining = $calc['remaining'];
6060 $ remaining_pending = $ calc ['remaining_pending ' ];
6161 $ remaining_fiat = $ calc ['remaining_fiat ' ];
6262
6363 $ cryptapi_pending = '0 ' ;
6464 if ($ remaining_pending <= 0 && !$ this ->payment ->hasBeenPaid ($ order )) {
65- $ cryptapi_pending = 1 ;
65+ $ cryptapi_pending = ' 1 ' ;
6666 }
6767
6868 $ counter_calc = (int )$ metaData ['cryptapi_last_price_update ' ] + (int )$ this ->scopeConfig ->getValue ('payment/cryptapi/refresh_value_interval ' , \Magento \Store \Model \ScopeInterface::SCOPE_STORE ) - time ();
@@ -77,17 +77,17 @@ public function execute()
7777
7878 $ data = [
7979 'is_paid ' => $ this ->payment ->hasBeenPaid ($ order ),
80- 'is_pending ' => (int )$ cryptapi_pending ,
80+ 'is_pending ' => (int )( $ cryptapi_pending) ,
8181 'crypto_total ' => floatval ($ metaData ['cryptapi_total ' ]),
8282 'qr_code_value ' => $ metaData ['cryptapi_qr_code_value ' ],
8383 'cancelled ' => $ metaData ['cryptapi_cancelled ' ],
84- 'remaining ' => $ remaining_pending < 0 ? 0 : $ remaining_pending ,
84+ 'remaining ' => $ remaining_pending <= 0 ? 0 : $ remaining_pending ,
8585 'fiat_remaining ' => $ this ->priceHelper ->currency ($ remaining_fiat , true , false ),
8686 'coin ' => strtoupper ($ metaData ['cryptapi_currency ' ]),
87- 'show_min_fee ' => ( int ) $ showMinFee ,
87+ 'show_min_fee ' => $ showMinFee ,
8888 'order_history ' => $ history ,
8989 'already_paid ' => $ already_paid ,
90- 'already_paid_fiat ' => $ this ->priceHelper ->currency (floatval ( $ already_paid_fiat ) <= 0 ? 0 : floatval ($ already_paid_fiat ), true , false ),
90+ 'already_paid_fiat ' => $ this ->priceHelper ->currency ($ remaining_pending <= 0 ? 0 : floatval ($ already_paid_fiat ), true , false ),
9191 'counter ' => (string )$ counter_calc ,
9292 'fiat_symbol ' => $ order ->getOrderCurrencyCode ()
9393 ];
0 commit comments