Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 595 Bytes

use-storages.md

File metadata and controls

22 lines (16 loc) · 595 Bytes

How to use storages?

<?php
//Source: Payum\Examples\ReadmeTest::persistPaymentDetails()
use Payum\Payment;
use Payum\Storage\FilesystemStorage;
use Payum\Extension\StorageExtension;

$storage = new FilesystemStorage('path_to_storage_dir', 'YourModelClass');

$payment = new Payment;
$payment->addExtension(new StorageExtension($storage));

//do capture for example.

What's inside?

  • The extension will try to find model on onPreExecute if an id given.
  • Second, It saves the model after execute, on onInteractiveRequest and postRequestExecute.

Back to index.