Jump to content

Recommended Posts

Posted

Has anyone else managed to get the GoCardless payment gateway working?

I'm seeing the below error but can't work out what's wrong. It occurs when a customer tries to make a payment using gocardless.

https://example.com/client/pay/method/72/

Undefined index: pay_type on line 256 in /var/www/vhosts/site/components/gateways/nonmerchant/gocardless/gocardless.php  

Printing Stack Trace:  
#0 [internal function]: UnknownException::setErrorHandler(8, 'Undefined index...', '/var/www/vhosts...', 256, Array)
#1 /var/www/vhosts/site/vendors/monolog/monolog/src/Monolog/ErrorHandler.php(173): call_user_func(Array, 8, 'Undefined index...', '/var/www/vhosts...', 256, Array)
#2 /var/www/vhosts/site/components/gateways/nonmerchant/gocardless/gocardless.php(256): Monolog\ErrorHandler->handleError(8, 'Undefined index...', '/var/www/vhosts...', 256, Array)
#3 /var/www/vhosts/site/components/gateway_payments/gateway_payments.php(157): Gocardless->buildProcess(Array, '12.50', Array, Array)
#4 /var/www/vhosts/site/app/models/payments.php(93): GatewayPayments->getBuildProcess(Array, 12.5, 'NZD', Array, Array, '3') > #5 /var/www/vhosts/site/app/controllers/client_pay.php(893): Payments->getBuildProcess(Array, 12.5, 'NZD', Array, Array, '3')
#6 /var/www/vhosts/site/vendors/minphp/bridge/src/Lib/Dispatcher.php(142): ClientPay->confirm()
#7 /var/www/vhosts/site/index.php(21): Dispatcher::dispatch('/client/pay/con...')
#8 {main}

Blesta v4.6.0 on PHP 7.3.9 on a Plesk server

Posted

Hmm, you can update line 256-260 of gocardless.php  from:

        if ($this->ifSet($_GET['pay_type'], $_POST['pay_type']) == 'subscribe') {
            $pay_type = 'subscribe';
        } elseif ($this->ifSet($_GET['pay_type'], $_POST['pay_type']) == 'onetime') {
            $pay_type = 'onetime';
        }

To:

        if ($this->ifSet($_GET['pay_type'], $this->ifSet($_POST['pay_type'])) == 'subscribe') {
            $pay_type = 'subscribe';
        } elseif ($this->ifSet($_GET['pay_type'], $this->ifSet($_POST['pay_type'])) == 'onetime') {
            $pay_type = 'onetime';
        }

I'll create an issue on the GitHub repository for this

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...