2032 Posts in 562 Topics by 442 members
|Go to End|
29 November 2009 at 5:32pm Last edited: 29 November 2009 5:40pm
I am writing a new payment class for Paymate and I just need to check how I should be handling the records in the payment table. I have some code written by someone else for Paymate. I cannot get this to work but I have used bits of it. In it, a new row is created in the payment table
$payment = new Payment();
for every attempted transaction i.e. the original record create when the order is placed is not updated, rather a new record is created. I can see some benefit in this when customers have declined payments you can see each occurrence of it but it does not appear to be the way the other payments which come with Silverstripe work.
So my question is should my payment class update the original row in the payment table i.e. status will change from Incomplete to Success/Failure/Pending. Since there is no option partial payment there would be a one to one relationship between the order and payment table.
PS As I write this I think I already know the answer as you would still be able to track failures as a new order would be placed but can someone just confirm for me ...
29 November 2009 at 5:42pm
OK - see it most definitely should be updating the record not creating a new one.
|Go to Top|