Jump to content
  • 0

Client Side not showing errors returned from gateway buildProcess()


Blesta Addons

Question

we have a gateway that set a error if returned from the gateway and set it to the returned data, but blesta is not showing the returned error .

i have made a simple test and made the buildprocess return a error, but blesta client side is not showing it when the client want to pay with that gateway.

            $this->Input->setErrors($this->getCommonError('invalid'));
            return;

is blesta not showing the returned errors in process view, or we have missed something ?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

after some look at blesta code, i find that the GatewayPayments->getBuildProcess() is not setting the errors, it only return the html returned data, in this case is a empty value . we have made a simple fix, in two files .

components/gateway_payments/gateway_payments.php  line 162

change from

        return $html;

to

        if (($errors = $gateway_obj->errors())) {
            // If no response given and errors set, pass those errors along
            $this->Input->setErrors($errors);
            return;
        }

        return $html;

 

file controllers/client_pay.php line 868

change from

            $this->set(
                'gateway_buttons',
                $this->Payments->getBuildProcess(
                    $contact_info,
                    $total,
                    $payment['currency'],
                    $apply_amounts,
                    $options,
                    $payment['method']['pay_with']
                )
            );

to

            $gateway_buttons = $this->Payments->getBuildProcess(
				$contact_info,
				$total,
				$payment['currency'],
				$apply_amounts,
				$options,
				$payment['method']['pay_with']
			);
            if ($errors = $this->Payments->errors()) {
				$this->setMessage('error', $errors);
            }

            $this->set('gateway_buttons', $gateway_buttons);

 

with this way, any error returned the the buildproccess will shown to the client . like invalid zip code,  empty state ...ect

Link to comment
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
Answer this question...

×   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...
×
×
  • Create New...