Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Updating payment table


Go to End


2 Posts   1266 Views

Avatar
mschiefmaker

Community Member, 187 Posts

29 November 2009 at 5:32pm

Edited: 29/11/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.

Thanks

Catherine

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 ...

Avatar
mschiefmaker

Community Member, 187 Posts

29 November 2009 at 5:42pm

OK - see it most definitely should be updating the record not creating a new one.

Cheers

Catherine