sslcommerz / SSLCommerz-Laravel

SSLCOMMERZ is a bangladeshi payment gateway provider. This is Laravel Library for SSLCOMMERZ.
123 stars 98 forks source link

ErrorException Required parameter $post_data follows optional parameter $trx_id #25

Closed theprantadutta closed 3 years ago

theprantadutta commented 3 years ago

This problem is generated from the SslCommerzNotification.php file. You need to pass the required parameter (here $post_data) before passing the optional parameters like $trx_id, $amount etc. It should be something like this....

public function orderValidate($post_data, $trx_id = '', $amount = 0, $currency = "BDT") {
    // 
}

OR

public function orderValidate($trx_id, $amount, $currency, $post_data) {
    // 
}

This problem only occurs in PHP 8, it worked fine in PHP 7.

rkbi commented 3 years ago

Are you trying alpha build of php 8? cause on stable 8.0, it's only deprecated. A deprecation notice would be there in dev environment, but it should work fine.

Also are you going to use php 8 in production server also?

theprantadutta commented 3 years ago

My PHP version is 8.0.1. It's showing me this error.

    ErrorException Required parameter $post_data follows optional parameter $trx_id

I am not on production yet. But checkout this link

theprantadutta commented 3 years ago

Are you trying alpha build of php 8? cause on stable 8.0, it's only deprecated. A deprecation notice would be there in dev environment, but it should work fine.

Actually, it's not working anymore. Instead of a deprecation notice, it's showing an error exception. I had to use this and then it's started working.

    public function orderValidate($trx_id, $amount, $currency, $post_data) {
        // 
    }
rkbi commented 3 years ago

I have already seen the link. As I have said, it's not forced yet, just been deprecated. I was just curious, are you going to run php 8 on the production server right now?

However, the parameter order has already been updated.

theprantadutta commented 3 years ago

I was just curious, are you going to run PHP 8 on the production server right now? No