11<?php
22
33/**
4- * © 2026 - Bluem Plugin Support <pluginsupport@ bluem.nl>
4+ * © 2026 - Bluem Payment & Identity: https:// bluem.nl
55 *
66 * This source file is subject to the license that is bundled
77 * with this source code in the file LICENSE.
@@ -177,8 +177,8 @@ public function CreateMandateRequest(
177177 $ order_id ,
178178 $ mandate_id ,
179179 ($ this ->configuration ->environment === "test " &&
180- $ this ->configuration ->expectedReturnStatus !== null ?
181- $ this ->configuration ->expectedReturnStatus : "" )
180+ $ this ->configuration ->expectedReturnStatus !== null ?
181+ $ this ->configuration ->expectedReturnStatus : "" )
182182 );
183183 }
184184
@@ -220,10 +220,10 @@ public function PerformRequest(
220220 ) {
221221 return new ErrorBluemResponse (
222222 "Error: Request is not formed correctly. More details: " .
223- implode (
224- ';<BR> ' . PHP_EOL ,
225- $ validator ->errorDetails
226- )
223+ implode (
224+ ';<BR> ' . PHP_EOL ,
225+ $ validator ->errorDetails
226+ )
227227 );
228228 }
229229
@@ -283,7 +283,7 @@ public function PerformRequest(
283283 } catch (Throwable $ th ) {
284284 return new ErrorBluemResponse (
285285 "Error: Could not create Bluem Response object. More details: " .
286- $ th ->getMessage ()
286+ $ th ->getMessage ()
287287 );
288288 }
289289
@@ -331,7 +331,7 @@ private function extractErrorMessage(SimpleXMLElement $xml, string $transactionC
331331 return '' ;
332332 }
333333
334- return (string ) $ xml ->{$ errorNodeName }->Error ->ErrorMessage ;
334+ return (string ) $ xml ->{$ errorNodeName }->Error ->ErrorMessage ;
335335 }
336336
337337 /**
@@ -372,8 +372,8 @@ public function MandateStatus($mandateID, $entranceCode): BluemResponseInterface
372372 $ this ->configuration ,
373373 $ mandateID ,
374374 $ entranceCode ,
375- ($ this ->configuration ->environment === BLUEM_ENVIRONMENT_TESTING &&
376- $ this ->configuration ->expectedReturnStatus !== null ?
375+ ($ this ->configuration ->environment === Constants:: TESTING_ENVIRONMENT &&
376+ $ this ->configuration ->expectedReturnStatus !== null ?
377377 $ this ->configuration ->expectedReturnStatus : "" )
378378 );
379379
@@ -476,9 +476,9 @@ public function CreatePaymentRequest(
476476 $ currency ,
477477 $ this ->CreatePaymentTransactionID ($ debtorReference ),
478478 $ entranceCode ,
479- ($ this ->configuration ->environment === BLUEM_ENVIRONMENT_TESTING &&
480- $ this ->configuration ->expectedReturnStatus !== null ?
481- $ this ->configuration ->expectedReturnStatus : "" ),
479+ ($ this ->configuration ->environment === Constants:: TESTING_ENVIRONMENT &&
480+ $ this ->configuration ->expectedReturnStatus !== null ?
481+ $ this ->configuration ->expectedReturnStatus : "" ),
482482 $ debtorReturnURL ,
483483 $ paymentReference
484484 );
@@ -512,7 +512,7 @@ public function PaymentStatus(
512512 $ r = new PaymentStatusBluemRequest (
513513 $ this ->configuration ,
514514 $ transactionID ,
515- $ this ->configuration ->environment === BLUEM_ENVIRONMENT_TESTING &&
515+ $ this ->configuration ->environment === Constants:: TESTING_ENVIRONMENT &&
516516 $ this ->configuration ->expectedReturnStatus !== null ?
517517 $ this ->configuration ->expectedReturnStatus : "" ,
518518 $ entranceCode
@@ -544,7 +544,7 @@ public function CreateIdentityRequest(
544544 return new IdentityBluemRequest (
545545 $ this ->configuration ,
546546 $ entranceCode ,
547- $ this ->configuration ->environment === BLUEM_ENVIRONMENT_TESTING &&
547+ $ this ->configuration ->environment === Constants:: TESTING_ENVIRONMENT &&
548548 $ this ->configuration ->expectedReturnStatus !== null ?
549549 $ this ->configuration ->expectedReturnStatus : "" ,
550550 $ requestCategory ,
@@ -567,7 +567,7 @@ public function IdentityStatus($transactionID, $entranceCode): ErrorBluemRespons
567567 $ r = new IdentityStatusBluemRequest (
568568 $ this ->configuration ,
569569 $ entranceCode ,
570- ($ this ->configuration ->environment === BLUEM_ENVIRONMENT_TESTING &&
570+ ($ this ->configuration ->environment === Constants:: TESTING_ENVIRONMENT &&
571571 $ this ->configuration ->expectedReturnStatus !== null ?
572572 $ this ->configuration ->expectedReturnStatus : "" ),
573573 $ transactionID
@@ -703,21 +703,20 @@ public function _retrieveContext($context): BluemContextInterface
703703 {
704704 $ localInstrumentCode = $ this ->configuration ->localInstrumentCode ;
705705 switch ($ context ) {
706- case ' Mandates ' :
706+ case Constants:: MANDATES_CONTEXT :
707707 $ context = new MandatesContext ($ localInstrumentCode );
708708 break ;
709- case ' Payments ' :
709+ case Constants:: PAYMENTS_CONTEXT :
710710 $ context = new PaymentsContext ();
711711 break ;
712- case ' Identity ' :
712+ case Constants:: IDENTITY_CONTEXT :
713713 $ context = new IdentityContext ();
714714 break ;
715715 default :
716- $ contexts = ["Mandates " , "Payments " , "Identity " ];
717716 throw new RuntimeException (
718717 "Invalid Context requested, should be
719718 one of the following: " .
720- implode (", " , $ contexts )
719+ implode (", " , Constants:: AVAILABLE_CONTEXTS )
721720 );
722721 }
723722
0 commit comments