adamthedeveloper/wepay-rails — pull request #26 by lvxn0va (2012-09-24 00:18:37+00:00)
Title: Ft preapprovals

Hi I've gotten Wepay pre-approvals and delayed charge working on my end. I've also included sample code for the controllers which can be stripped if needed and put in the wiki to help people test. My understanding is the controllers aren't generated with the gem installation so are optional for people to copy if they want from the Github source.

Most of the code matches the master branch checkout methods except for the redirects to the "Success" actions which renders text confirmation. I've also adjusted code to the wepay-rails.rb and WepayCheckoutRecord.

The most difficult part of pre-approvals and delayed charging is that when adding a pre-approval to a checkout/create call, it's not necessary to send the user to Wepay, and the charge is made immediately. I redirected to the success action on the charge_controller to merge new checkout_id into the full record from the preapproval call.

Anyway, I'm a beginner at rails so none of the code is precious to me! If you see how to do something better please feel free to change it accordingly..Thanks mate