@@ -2939,23 +2939,26 @@ public function checkPendingStatus($id_order)
2939
2939
$ currencyIso = '' ;
2940
2940
$ k = $ this ->initKlarnaAPI ($ eid , $ shared_secret , $ countryIso , $ languageIso , $ currencyIso , $ id_shop );
2941
2941
$ status = $ k ->checkOrderStatus ($ reservation_number );
2942
- if ($ status == KlarnaFlags::ACCEPTED ) {
2942
+ if ($ status == KlarnaFlags::ACCEPTED ) {
2943
2943
$ order = new Order ($ id_order );
2944
- if (Validate::isLoadedObject ($ order ))
2945
- {
2944
+ if (Validate::isLoadedObject ($ order )) {
2946
2945
$ new_status = Configuration::get ('KPM_ACCEPTED_INVOICE ' , null , null , $ order ->id_shop );
2947
2946
$ history = new OrderHistory ();
2948
2947
$ history ->id_order = $ id_order ;
2949
- $ history ->changeIdOrderState (intval ( $ new_status) , $ id_order , true );
2948
+ $ history ->changeIdOrderState (( int ) $ new_status , $ id_order , true );
2950
2949
$ history ->addWithemail (true , null );
2951
2950
}
2952
2951
} elseif ($ status == KlarnaFlags::DENIED ) {
2953
2952
$ order = new Order ($ id_order );
2954
2953
if (Validate::isLoadedObject ($ order )) {
2955
- $ cancel_status = ((int )(Configuration::get ('PS_OS_CANCELED ' ))>0 ? Configuration::get ('PS_OS_CANCELED ' ) : _PS_OS_CANCELED_ );
2954
+ if ((int )(Configuration::get ('PS_OS_CANCELED ' ))>0 ) {
2955
+ $ cancel_status = Configuration::get ('PS_OS_CANCELED ' );
2956
+ } else {
2957
+ $ cancel_status = _PS_OS_CANCELED_ ;
2958
+ }
2956
2959
$ history = new OrderHistory ();
2957
2960
$ history ->id_order = $ id_order ;
2958
- $ history ->changeIdOrderState (intval ( $ new_status ) , $ id_order , true );
2961
+ $ history ->changeIdOrderState (( int ) $ cancel_status , $ id_order , true );
2959
2962
$ history ->addWithemail (true , null );
2960
2963
}
2961
2964
}
0 commit comments