Jump to content
Sign in to follow this  
kilakewe

GoCardless Payment Error

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...