welford-media / craft3-barclays-epdq

Other
0 stars 1 forks source link

Error after payment is authorised #6

Closed jamiematrix closed 8 months ago

jamiematrix commented 1 year ago

I'm making some test payments to make sure all is well and I'm getting an error after the payment is authorised on Barclaycards side.

The error is

 PHP Compile Error – yii\base\ErrorException
Declaration of welfordmedia\barclaysepdqgateway\omni\Message\CompletePurchaseRequest::sendData($data): welfordmedia\barclaysepdqgateway\omni\Message\CompletePurchaseResponse must be compatible with welfordmedia\barclaysepdqgateway\omni\Message\PurchaseRequest::sendData($data): welfordmedia\barclaysepdqgateway\omni\Message\PurchaseResponse

Here is the stacktrace: image ... that is all there is.

As far as I can tell everything is setup for the gateway and Barclaycard account.

phillmorgan28 commented 1 year ago

Hi

Can you tell me what PHP version you're using?

Thanks

jamiematrix commented 1 year ago

Hi, The above error was using PHP 8.1

Thanks

jamiematrix commented 1 year ago

We've had a go troubleshooting ourselves and got a little further (at least past the error above).

Changing the following in PurchasRequest.php got a little further:

    public function sendData($data): CompletePurchaseResponse
    {
        $this->response = new CompletePurchaseResponse($this, $data);
        return $this->response->getData();
    }
jamiematrix commented 1 year ago

Is there any update to this issue @phillmorgan28 ?

phillmorgan28 commented 8 months ago

Return types have been removed from 2.0.1 which solves the error you've been experiencing.