This is my code:
if (Secure3Dv2Notification::isRequest($_POST)) {
$secure3Dv2Notification = new Secure3Dv2Notification::fromData($_POST);
// If you need the sent session data, it can be found here:
$encThreeDSSessionData = $secure3Dv2Notification->getThreeDSSessionData();
$threeDSSessionData = base64_decode($encThreeDSSessionData);
$request = new CreateSecure3Dv2Challenge(
$endpoint, $auth, $notification, $transactionId
);
$response = $client->sendRequest($request);
$transaction = ResponseFactory::fromHttpResponse($response);
}
I am receiving this error:
Syntax error, unexpected T-STRING, expecting T_VARIABLE
It is this line:
$secure3Dv2Notification = new Secure3Dv2Notification::fromData($_POST);
What is wrong with it?
1
If fromData
method is static method you should use like this
$secure3Dv2Notification = Secure3Dv2Notification::fromData($_POST);
If fromData
is non-static method you should use
$secure3Dv2Notification = (new Secure3Dv2Notification())->fromData($_POST);