jamiedevine Posted June 19, 2013 Share Posted June 19, 2013 Hi, i'm developing a payment module for one of our clients as there currently is no module for the provider they want to use. I've got the module set up and working up until the payment page. The payment provider we're using works in a similar way to PayPal, we need to send the customer off the the provider's site who then takes the payment before sending the customer back to our site. This is where I need some help! I'm not sure where I should send the customer back once payment has been completed, or where to send them if the payment fails. We also need to update the order status, this again is done in a similar way to PayPal. We supply a notify URL that the payment processor calls once the payment has been taken. I'm not sure where this URL should point to either. If anyone could help me figure this out that would be amazing! If you need any more information just ask Thanks, Jamie Link to comment Share on other sites More sharing options...
bellini13 Posted June 20, 2013 Share Posted June 20, 2013 you typically just create another file in the module folder called validation.php This file would be responsible for interpreting the transaction results from the payment gateway and either ... 1) If payment was successful, create the order using validateOrder and then redirect to order confirmation page 2) If payment declined, you could redirect back to checkout with an error message to try again or another payment method. Or you can create the order with payment error status. You can use bankwire validation.php as a guide for some of the basic steps, and then just add your custom validations and logic where needed. 1 Link to comment Share on other sites More sharing options...
jamiedevine Posted June 20, 2013 Author Share Posted June 20, 2013 Thank you! I was trying to redirect the customer directly to the confirmation page, which is why I was having trouble. I've added the validation script now to handle the order before the customer is sent to the confirmation page. Link to comment Share on other sites More sharing options...
jamiedevine Posted June 24, 2013 Author Share Posted June 24, 2013 Hi, If a payment fails, how do I pass that message back to the customer from validation.php? I've set up validation.php to redirect the customer back to the payment page. I've also added the 'DisplayPaymentTop' hook to my payment module which will allow me to show the error message at the top of the payment page. Should I just pass the error message in a cookie or session variable? Or is there a built-in way to pass errors to modules? Cheers, Jamie Link to comment Share on other sites More sharing options...
jamiedevine Posted June 24, 2013 Author Share Posted June 24, 2013 I've sorted this out now. I'm just passing an error code as a URL parameter when I redirect. My module then converts this code into a message which is displayed on the payment page. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now