Jump to content

Success URL and Fail URL (payments)


NKV

Recommended Posts

Hello everyone,

 

we are using another payment gateway (UnitPay) and they require success URL and fail URL for payments.

Since we want to track correctly Google Analytics goals I did put /cart.php?a=complete for success url, but anyway after payment users are getting back to cart page.

Does WHMCS have any success URL for payment? Because redirect to carts, does not seems like a good idea.

Before this thread, we used to redirect users to /clientarea.php?action=invoices, since its better and users don't get lost, but then we cannot track correctly goals for success payments.

 

And what about Fail URL? Thanks.

Link to comment
Share on other sites

you may use "View Invoice" URL for both options, it will be more logical, this is how WHMCS did with their gateway modules

Thanks. So, if you pay with WHMCS official gateways like PayPal and Stripe you are going to get redirected to "viewinvoice.php?id=123" in the end?

How will I track my Google Analytics goals then? What link i should use instead of "/cart.php?a=complete"?

Also does it redirect to view invoice, if you cancel payment, right? This way its going to mess goals and give wrong information.

Is it going to redirect automatically by default for all payment gateways? Because I don't know how to generate properly link with unique ID.

Edited by NKV
Link to comment
Share on other sites

track code should placed inside /templates/orderforms/{Template-Name}/complete.tpl file

 

success URL is:

http://yourwebsite/viewinvoice.php?id=xx&paymentsuccess=true

 

fail URL is:

http://yourwebsite/viewinvoice.php?id=xx&paymentfailed=true

Thanks again, but it just redirects to page without generating any id, so i am getting error invoice.

I am going to contact who made this payment gateway and ask him.

Link to comment
Share on other sites

the URL is for example, you need to replace "xx" with Invoice ID, the valid URL is available as parameter in your gateway module's _link() function,

 

function gateway_link($params){
   $successurl = $params['returnurl']."&paymentsuccess=true";
   $failurl = $params['returnurl']."&paymentfailed=true";
}

 

this is how it looks like

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated