File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,9 @@ private function klarnaOrderData()
233
233
/** @var RouterInterface $router */
234
234
$ router = System::getContainer ()->get ('router ' );
235
235
236
+ $ billingFieldsConfig = $ this ->config ->getBillingFieldsConfig ();
237
+ $ companyConfig = array_filter ($ billingFieldsConfig , static function (array $ c ) {return 'company ' === $ c ['value ' ]; })[0 ] ?? [];
238
+
236
239
return [
237
240
'purchase_country ' => $ this ->config ->country ,
238
241
'purchase_currency ' => $ this ->config ->currency ,
@@ -312,6 +315,8 @@ private function klarnaOrderData()
312
315
'color_link ' => $ this ->klarna_color_link
313
316
? '# ' .$ this ->klarna_color_link
314
317
: null ,
318
+ 'allowed_customer_types ' => $ companyConfig && $ companyConfig ['mandatory ' ] ? ['organization ' ] :
319
+ ($ companyConfig && $ companyConfig ['enabled ' ] ? ['organization ' , 'person ' ] : ['person ' ]),
315
320
'require_validate_callback_success ' => true ,
316
321
'show_subtotal_detail ' => (bool ) $ this ->klarna_show_subtotal_detail ,
317
322
],
You can’t perform that action at this time.
0 commit comments