Jump to content

Photo

Can a Plugin create DB tables?


  • Please log in to reply
2 replies to this topic

#1 Amr

Amr

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 29 August 2019 - 10:51

Hey again,

 

 

I am in the final step of making my payment gateway plugin and I need to store some id's given by the gateway to be cross referenced

when checking the gateway for the payment status

 

Is there is way to do this in the plugin it self or do i need to modify the core project?

 



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3823 posts

Posted 29 August 2019 - 13:38

Yes, you can create database tables. But in most cases it's easier and faster to use built-in capabilities like SyncMapping, GenericAttibute etc. for it.

Data in checkout is volatile, it's better to use a session object for it, not the database. Payment IDs from your payment provider can also be stored in Order.AuthorizationTransactionId, Order.AuthorizationTransactionCode, and Order.CaptureTransactionId to later interact with the payment API.

  • Lighthouse likes this

Marcus Gesing

Smartstore AG


#3 Amr

Amr

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 30 August 2019 - 12:17

thank you 

 

this was really helpful