Jump to content

Payment module help


jamiedevine

Recommended Posts

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

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.

  • Like 1
Link to comment
Share on other sites

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

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
×
×
  • Create New...