Jump to content
NKV

Success URL and Fail URL (payments)

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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines