NKV Posted February 16, 2017 Share Posted February 16, 2017 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. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 16, 2017 Share Posted February 16, 2017 you may use "View Invoice" URL for both options, it will be more logical, this is how WHMCS did with their gateway modules 0 Quote Link to comment Share on other sites More sharing options...
NKV Posted February 16, 2017 Author Share Posted February 16, 2017 (edited) 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 February 16, 2017 by NKV 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 16, 2017 Share Posted February 16, 2017 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 0 Quote Link to comment Share on other sites More sharing options...
NKV Posted February 16, 2017 Author Share Posted February 16, 2017 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. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 16, 2017 Share Posted February 16, 2017 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 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.