views:

82

answers:

2

I need to give an external payment site a return url to my site after a customer pays. It will be to my create action in a RESTful subscription controller.

Ive tried giving the payment site this

blah.com/users/7/subscription/?_method=POST

but on return my app keeps trying to call my show action presumably because it thinks its a get request and not a post. So somethings wrong with how i pass the method in the url but i cant figure out what.

Users are plural and they can only have one subscription which is defined in my routes as singular i.e. map.resource

Can anyone help?

+4  A: 

You can't POST from a GET request.

If the calling application is simply executing a URL this is a GET request. If the payment site does not support POSTing back to you then you can't do it.

I would ask the payment site if they offer the ability to POST to you. Many do.

Greg B
doh! of course! thanks for your help!
adam
+2  A: 

If the external service isn't calling your url with a POST, then it is an issue with that service, not your application. Also, keep in mind that CSRF will protect your POST, PUT, DELETE without a token, so you'll need to disable it for this method, and hopefully you have some other way of authenticating that request.

danivovich