Jump to:

2088 Posts in 1007 Topics by 455 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Updating payment table

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, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 736 Views
  • mschiefmaker
    Avatar
    Community Member
    187 Posts

    Updating payment table Link to this post

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

  • mschiefmaker
    Avatar
    Community Member
    187 Posts

    Re: Updating payment table Link to this post

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

    Cheers

    Catherine

    736 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.