tdphong Posted October 8, 2015 Report Posted October 8, 2015 Hi all, Currently, I am develop a payment method (a non-merchant). Here is the scenario: 1. In the checkout step, I send the data to the payment gateway using "buildProcess()" function. 2. After the payment processed, it will redirect to URL as below to run the "validate()" function:http://localhost/blesta/callback/gw/1/mygateway/?client_id=1&invoice=121=600.0000¤t_currency=USD&default_currency=AUD 3. The "validate()" function will validate the gateway response to see the transaction is successful or failed. Now I want in the case of successful payment it will redirect to the success page, otherwise it will redirect to the error page. I see in the "validate()" function, it will return an array to log the transaction in DB. So how can I handle the redirect here? Thanks, Phong Quote
activa Posted October 8, 2015 Report Posted October 8, 2015 not sur , but in the end of the file add another condtions like this to use header or blesta function redirect() // Capture the IPN status, or reject it if invalid switch (strtolower($this->ifSet($response['status']))) { case "successful ": header('Location: http://www.example.com/'); break; case "error": header('Location: http://www.example.com/'); break; } tdphong 1 Quote
Tyson Posted October 8, 2015 Report Posted October 8, 2015 Blesta automatically performs redirects to the payment received page whether there is an error or not--you may just want to update the payment received page to display transaction information differently. tdphong 1 Quote
tdphong Posted October 9, 2015 Author Report Posted October 9, 2015 Thanks Tyson, I will see my function again Quote
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.