@@ -108,19 +108,19 @@ public function services(): array
108108 $ availablePaymentMethods = $ container ->get ('gateway.listAllMethodsAvailable ' );
109109 $ klarnaOneFlag = apply_filters ('inpsyde.feature-flags.mollie-woocommerce.klarna_one_enabled ' , true );
110110 if (!$ klarnaOneFlag ) {
111- return array_filter ($ availablePaymentMethods , static function ($ method ) {
111+ $ availablePaymentMethods = array_filter ($ availablePaymentMethods , static function ($ method ) {
112112 return $ method ['id ' ] !== Constants::KLARNA ;
113113 });
114114 }
115115 $ bancomatpayFlag = apply_filters ('inpsyde.feature-flags.mollie-woocommerce.bancomatpay_enabled ' , true );
116116 if (!$ bancomatpayFlag ) {
117- return array_filter ($ availablePaymentMethods , static function ($ method ) {
117+ $ availablePaymentMethods = array_filter ($ availablePaymentMethods , static function ($ method ) {
118118 return $ method ['id ' ] !== Constants::BANCOMATPAY ;
119119 });
120120 }
121- $ almaFlag = apply_filters ('inpsyde.feature-flags.mollie-woocommerce.alma_enabled ' , false );
121+ $ almaFlag = apply_filters ('inpsyde.feature-flags.mollie-woocommerce.alma_enabled ' , true );
122122 if (!$ almaFlag ) {
123- return array_filter ($ availablePaymentMethods , static function ($ method ) {
123+ $ availablePaymentMethods = array_filter ($ availablePaymentMethods , static function ($ method ) {
124124 return $ method ['id ' ] !== Constants::ALMA ;
125125 });
126126 }
@@ -808,8 +808,8 @@ public function addPhoneWhenRest($arrayContext)
808808 {
809809 $ context = $ arrayContext ;
810810 $ phoneMandatoryGateways = ['mollie_wc_gateway_in3 ' ];
811- $ paymentMethod = $ context ->payment_data ['payment_method ' ];
812- if (in_array ($ paymentMethod , $ phoneMandatoryGateways )) {
811+ $ paymentMethod = $ context ->payment_data ['payment_method ' ] ?? null ;
812+ if ($ paymentMethod && in_array ($ paymentMethod , $ phoneMandatoryGateways )) {
813813 $ billingPhone = $ context ->order ->get_billing_phone ();
814814 if (!empty ($ billingPhone ) && $ this ->isPhoneValid ($ billingPhone )) {
815815 return ;
@@ -819,7 +819,7 @@ public function addPhoneWhenRest($arrayContext)
819819 $ context ->order ->save ();
820820 return ;
821821 }
822- $ billingPhone = $ context ->payment_data ['billing_phone ' ];
822+ $ billingPhone = $ context ->payment_data ['billing_phone ' ] ?? null ;
823823 if ($ billingPhone && $ this ->isPhoneValid ($ billingPhone )) {
824824 $ context ->order ->set_billing_phone ($ billingPhone );
825825 $ context ->order ->save ();
@@ -831,9 +831,9 @@ public function addBirthdateWhenRest($arrayContext)
831831 {
832832 $ context = $ arrayContext ;
833833 $ birthMandatoryGateways = ['mollie_wc_gateway_in3 ' ];
834- $ paymentMethod = $ context ->payment_data ['payment_method ' ];
835- if (in_array ($ paymentMethod , $ birthMandatoryGateways )) {
836- $ billingBirthdate = $ context ->payment_data ['billing_birthdate ' ];
834+ $ paymentMethod = $ context ->payment_data ['payment_method ' ] ?? null ;
835+ if ($ paymentMethod && in_array ($ paymentMethod , $ birthMandatoryGateways )) {
836+ $ billingBirthdate = $ context ->payment_data ['billing_birthdate ' ] ?? null ;
837837 if ($ billingBirthdate && $ this ->isBirthValid ($ billingBirthdate )) {
838838 $ context ->order ->update_meta_data ('billing_birthdate ' , $ billingBirthdate );
839839 $ context ->order ->save ();
0 commit comments