Storage allow you save,fetch payment related information. They could be used explicitly, it means you have to call save or fetch methods when it is required. Or you can integrate a storage to a gateway using StorageExtension. In this case every time gateway finish to execute a request it stores the information. StorageExtension could also load a model by it is Identificator so you do not have to care about that.
Explicitly used example:
<?php
use Payum\Core\Storage\FilesystemStorage;
$storage=newFilesystemStorage('/path/to/storage','Payum\Core\Model\Payment','number');
$order=$storage->create();
$order->setTotalAmount(123);
$order->setCurrency('EUR');
$storage->update($order);
$foundOrder=$storage->find($order->getNumber());Implicitly used example:
<?php
use Payum\Core\Extension\StorageExtension;
use Payum\Core\Gateway;
use Payum\Core\Storage\FilesystemStorage;
$gateway->addExtension(newStorageExtension(
newFilesystemStorage('/path/to/storage','Payum\Core\Model\Payment','number')
));Usage of a model identity with the extension:
Doctrine ORM
Add token and order classes:
next, you have to create an entity manager and Payum's storage:
Doctrine MongoODM.
next, you have to create an entity manager and Payum's storage:
Filesystem.
Custom.
You can create your own custom storage. To do so just implement StorageInterface.
TODO
Pdo Storage - https://github.com/Payum/Payum/issues/205
Yii ActiveRecord Storage - https://github.com/Payum/PayumYiiExtension/pull/4
Supporting Payum
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:
Last updated
