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
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
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
tdphong Posted October 9, 2015 Author Report Posted October 9, 2015 Thanks Tyson, I will see my function again
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now