In get it started we showed you how to configure gateways in the code. Sometimes you may asked to store gateways (mostly gateway credentials) to a database for example. So the admin can edit them in the backend. Here's the basic example how to do it in plain php.
Configure
First we have to create an entity where we store information about a gateway. The model must implement Payum\Core\Model\GatewayConfigInterface.
Now, we have to create a storage for it and build payum with gateway config storage.
<?php//config.phpusePayum\Core\Bridge\Doctrine\Storage\DoctrineStorage;usePayum\Core\PayumBuilder;usePayum\Core\Payum;usePayum\Core\Registry\DynamicRegistry;// $objectManager is an instance of doctrine object manager.$gatewayConfigStorage =newDoctrineStorage($objectManager,'Acme\Payment\Entity\GatewayConfig');/** @varPayum $payum */$payum = (newPayumBuilder())->addDefaultStorages()->setGatewayConfigStorage($gatewayConfigStorage)->getPayum();
Payum is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and our customers. If you'd like to join them, please consider: