Is it possible to use EE-standard database queries in a custom payment gateway written using Omnipay format to manipulate data in the database?
$query = ee()->db->select('title, url_title, field_id_14') within the PurchaseRequest class?
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.Sign up to join this community
I assume you are using Store > 2. If that is the case you would be making your own extension. Store has a default layout for these extensions available on github here.
If you notice in the ext.store_check.php file, there are these lines.
// tell PHP where to find the gateway classes // Store will automatically include your files when they are needed $composer = require(PATH_THIRD.'store/autoload.php'); $composer->add('Omnipay', __DIR__);
This would get all the files in your omipay folder and include them into this source. Working off of that assumption, you should (in theory) be able to call any ExpressionEngine api functions that are regularly available in an extension in your omnipay files.
One precautionary note I'm going to mention is be careful of namespaces (if you are using any). Because those could throw off the function calls.