@@ -21,7 +21,7 @@ public function __construct()
21
21
$ this ->curlExtension = extension_loaded ('curl ' );
22
22
23
23
$ this ->ratehrkfixed = 7.53450 ;
24
- $ this ->tecajnaHnbApi = "https://api.hnb.hr/tecajn/v2 " ;
24
+ $ this ->tecajnaHnbApi = "https://api.hnb.hr/tecajn-eur/v3 " ;
25
25
26
26
$ this ->api_version = '2.0 ' ;
27
27
@@ -205,7 +205,7 @@ private function get_last_modified_hnb_file()
205
205
/**
206
206
* Retrieve by currency conversion rate
207
207
*
208
- * @return void
208
+ * @return array|string|string[]| void
209
209
*/
210
210
private function fetch_hnb_currency ($ currency ) {
211
211
@@ -216,7 +216,8 @@ private function fetch_hnb_currency($currency) {
216
216
217
217
foreach ($ jsonFile as $ val ) {
218
218
if ($ val ['valuta ' ] === $ currency ) {
219
- return $ val ['jedinica ' ] * $ val ['srednji_tecaj ' ];
219
+ /** @var float $val */
220
+ return str_replace (", " , ". " , $ val ['srednji_tecaj ' ]);
220
221
}
221
222
222
223
}
@@ -410,16 +411,16 @@ public function generate_ipg_form($order_id)
410
411
}
411
412
412
413
return '<p></p>
413
- <p>Total amount will be <b> ' . number_format (($ order_total )) . ' ' . $ curr_symbole . '</b></p>
414
- <form action=" ' . $ pgDomain . '" method="post" name="payway-authorize-form" id="payway-authorize-form" type="application/x-www-form-urlencoded">
415
- ' . implode ('' , $ form_args_array ) . '
416
- <input type="submit" class="button-alt" id="submit_ipg_payment_form" value=" ' . __ ('Pay via PayWay ' , 'tcom-payway-wc ' ) . '" />
417
- <a class="button cancel" href=" ' . $ order ->get_cancel_order_url () . '"> ' . __ ('Cancel order & restore cart ' , 'tcom-payway-wc ' ) . '</a>
418
- </form>
419
- <!-- autoform submit -->
420
- <script type="text/javascript">
421
- jQuery("#submit_ipg_payment_form").trigger("click");
422
- </script>
414
+ <p>Total amount will be <b> ' . number_format (($ order_total )) . ' ' . $ curr_symbole . '</b></p>
415
+ <form action=" ' . $ pgDomain . '" method="post" name="payway-authorize-form" id="payway-authorize-form" type="application/x-www-form-urlencoded">
416
+ ' . implode ('' , $ form_args_array ) . '
417
+ <input type="submit" class="button-alt" id="submit_ipg_payment_form" value=" ' . __ ('Pay via PayWay ' , 'tcom-payway-wc ' ) . '" />
418
+ <a class="button cancel" href=" ' . $ order ->get_cancel_order_url () . '"> ' . __ ('Cancel order & restore cart ' , 'tcom-payway-wc ' ) . '</a>
419
+ </form>
420
+ <!-- autoform submit -->
421
+ <script type="text/javascript">
422
+ jQuery("#submit_ipg_payment_form").trigger("click");
423
+ </script>
423
424
' ;
424
425
}
425
426
0 commit comments