Jump to content
  • 0

Client Side not showing errors returned from gateway buildProcess()


Question

Posted

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 ?

5 answers to this question

Recommended Posts

  • 0
Posted

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

  • 0
Posted

Are you sure there was an error? It will set errors if there exist errors. The integration is very similar to your suggested source updates.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...