Storages
Doctrine ORM
Add token and payment details classes:
<?php
namespace Acme\PaymentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Payum\Core\Model\Token;
/**
* @ORM\Table
* @ORM\Entity
*/
class PaymentToken extends Token
{
}<?php
namespace Acme\PaymentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Payum\Core\Model\ArrayObject;
/**
* @ORM\Table
* @ORM\Entity
*/
class PaymentDetails extends ArrayObject
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*
* @var integer $id
*/
protected $id;
}next, you have to add mapping of the basic entities you are extended, and configure payum's storages:
Doctrine MongoODM.
Token use custom mongo type called ObjectType, so you have to add it to the kernel boot method:
Now, add token and payment details classes:
next, you have to add mapping of the basic entities you are extended, and configure payum's storages:
Note: You should use commented path if you install payum/payum package.
Custom.
We have several built in storages which cover all your needs. Sometimes you need completely custom storage. To have a custom storage you have to implement StorageInterface from core:
Register it as a service:
When you are done you can use it like this:
Filesystem.
Attention: Use filesystem storage only for testing and never in production.
Add token and payment details classes:
next, you have to configure payum's storages:
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