Jump to content

[Gateway] Return_Url , Cancel_Url , Notify_Url


activa

Recommended Posts

i'm  working for a new Gateway , but i have some confusion about this urls , when used and what they are ?

 

 

return_url , $options['return_url'] ?

cancel_url , ??

notify_url , callback_url ?

 

and which url should be called in a successful operation , and wish for denied operation , and wish one for canceled operation by client click ? 

Link to comment
Share on other sites

This is not only for blesta context:

 

return_url , $options['return_url'] ?

after checkout customer are redirected to gateway website, and after they pay there, they are redirected back to the merchant website at the given return url.

as blesta can be multi-company, multi-domain, that why the return url is passed in the parameter you send to the gateway when asking gateway to create the transaction

 

cancel_url , ??

not certain, I suppose, at gateway website, when customer was coming from the checkout, and if customer do not want to pay but want to cancel, so it's will be pointing to this url to back at merchant website

 

notify_url , callback_url ?

This is the url for the payment gateway post transaction update like paid, on hold, cancelled,...

 

--------------------

 

so it's depend of each gateway, but in general, from checkout, if customer pay quick, :

 

- from the gateway, the transaction status update will be sent to the notify url

and just after

- customer is redirected to the return url

 

if customer pay later, there is only a notification send to merchant website, and there is no redirection/return to the merchant website

 

------------------

Link to comment
Share on other sites

  • 1 month later...

If your gateway supports a 'cancel URL', determine the cases where the gateway would redirect the customer to it. You can set errors on your gateway's success() method in those cases.

 

The only page that is currently used for customers returning from making a payment is the /client/pay/received/ page. So if you redirect there and set an error message and an empty return array on your success() method, then the client will see an error message. It may not be ideal in some cases, but it is an alternative to the normal success page.

Link to comment
Share on other sites

If your gateway supports a 'cancel URL', determine the cases where the gateway would redirect the customer to it. You can set errors on your gateway's success() method in those cases.

 

The only page that is currently used for customers returning from making a payment is the /client/pay/received/ page. So if you redirect there and set an error message and an empty return array on your success() method, then the client will see an error message. It may not be ideal in some cases, but it is an alternative to the normal success page.

 

 

how to set a error message in the gateway in success function ?

Link to comment
Share on other sites

how to set a error message in the gateway in success function ?

 

I think something like this would work (untested):

public function success(...) {
...
    $this->Input->setErrors(array(
        'error' => array(
            'type' => 'Error!'
        )
    ));
...
}
Link to comment
Share on other sites

 

I think something like this would work (untested):

public function success(...) {
...
    $this->Input->setErrors(array(
        'error' => array(
            'type' => 'Error!'
        )
    ));
...
}

 

i will bookmark this to test later .

 

but if i remember , in a old thread , gateways is not able to set messages (error - success)  in the view ?!

Link to comment
Share on other sites

i will bookmark this to test later .

 

but if i remember , in a old thread , gateways is not able to set messages (error - success)  in the view ?!

 

That's correct. The gateway doesn't set errors to the view. It can set errors, but it is the caller that sets the view and determines whether to set any of the gateway's errors to it, which would be the case here.

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