2071 Posts in 814 Topics by 448 members
|Go to End|
22 October 2009 at 7:34pm
A client that I am working for at the moment wants to be able to accept Credit Card numbers (temporarily save them to the database) and process them offline with their merchant terminal. There are a number of reasons not to do this, but oh well what can you do... Anyway I decided that rather than go down the path of trying to hack in this functionality to the ecommerce module and save this data in the SilverStripe database that I would follow the paypal style method of doing this.
Basically the checkout redirects the user to a new (completely separate page) on a subdomain (something like payments.domain.com) this subdomain collects the Credit Card details and saves to the separate database that the company can access to get the Credit Card number and then delete when processed.
Now I have set this up by basically duplicating the PaystationHostedPayment.php which is working just fine. The problem is that when I try to redirect it back to the SilverStripe page to update the Payments table with "Failed" if they cancelled the transaction or "Paid" if they paid have paid.
I have taken a look at the PayPalPayments class and tested on PayPal. If I click the CANCEL button I get the following URL which automatically redirects through SilverStripe updating the Payments table to "Failed" and then redirects to the order page in the individuals account which the payment status of "Failed"
URL = http://domain.com/paypal/complete?custom=1- The "1-" at then end is the ID for the Payment row in the Payment table.
Now with my class I have set the $URLSegment variable to be "manualprocessing" but if I use the URL
http://domain.com/manualprocessing/complete?custom=1- (where "1-" is the correct Payment ID then I just get a 404 error page
"Sorry, it seems you were trying to access a page that doesn't exist.
Please check the spelling of the URL you were trying to access and try again."
Any suggestions how I can make "manualprocessing" be an actual URL that will redirect. Is there something I have missed in the class? This is the last hurdle I have to jump to complete this site.
Hopefully I haven't been tooooooooo long winded for you to help.
23 October 2009 at 3:20pm
Has anyone got any suggestions where I might look to work this out myself. Any tips would be really welcomed.
24 October 2009 at 6:40am
manualprocessing needs to be a valid url. And the valid url of the class / page type that you are going to be running the function (complete) on.
|Go to Top|