Closed samanmohamadi closed 8 years ago
Can you try to run payum:gateway-debug
cli command and see what is there.
Why did you added Payment and PaymentDetails, Are you sure you need both?
]$ php bin/console payum:gateway:debug
Order of actions, apis, extensions matters
Found 1 gateways
zarinpal (Payum\Core\Gateway):
Actions:
Payum\Core\Bridge\PlainPhp\Action\GetHttpRequestAction
Payum\Core\Action\CapturePaymentAction
Payum\Core\Action\AuthorizePaymentAction
Payum\Core\Action\PayoutPayoutAction
Payum\Core\Action\ExecuteSameRequestWithModelDetailsAction
Payum\Core\Bridge\Twig\Action\RenderTemplateAction
Payum\Core\Action\GetCurrencyAction
AppBundle\Payum\Zarinpal\Action\CaptureAction
AppBundle\Payum\Zarinpal\Action\AuthorizeAction
AppBundle\Payum\Zarinpal\Action\RefundAction
AppBundle\Payum\Zarinpal\Action\CancelAction
AppBundle\Payum\Zarinpal\Action\NotifyAction
AppBundle\Payum\Zarinpal\Action\StatusAction
AppBundle\Payum\Zarinpal\Action\ConvertPaymentAction
Extensions:
Payum\Core\Extension\EndlessCycleDetectorExtension
Apis:
Payum\Core\Bridge\Httplug\HttplugClient
AppBundle\Payum\Zarinpal\Api
PaymentDetails
was for testing.
I didn't use it anywhere in the code.
for some reason the storage extension was not registered.
You are using the old version, could you try to upgrade to the latest one. I am completely sure the bug was fixed there.
I'm using the latest version (v 2.1.0).
]$ composer show | grep payum
payum/core 1.3.6 Payum offers everything you need to work with payments. From simplest use cases to very a...
payum/iso4217 1.0.0 ISO 4217 PHP Library
payum/payum-bundle 2.1.0 Rich payment solutions for symfony2. Paypal, payex, authorize.net, be2bill, omnipay, recu...
I have the same problem.
I've run a few tests in the sandbox on the latest version of payum/core payum/payum-bundle. Everything works just fine. So the problem could be related to a custom gateway use. Could you post your factory: foo
foo factory here?
and the way you register it to payum?
namespace AppBundle\Payum\Zarinpal;
use AppBundle\Payum\Zarinpal\Action\AuthorizeAction;
use AppBundle\Payum\Zarinpal\Action\CancelAction;
use AppBundle\Payum\Zarinpal\Action\CaptureAction;
use AppBundle\Payum\Zarinpal\Action\ConvertPaymentAction;
use AppBundle\Payum\Zarinpal\Action\NotifyAction;
use AppBundle\Payum\Zarinpal\Action\RefundAction;
use AppBundle\Payum\Zarinpal\Action\StatusAction;
use Payum\Core\Bridge\Spl\ArrayObject;
use Payum\Core\GatewayFactory;
class ZarinpalGatewayFactory extends GatewayFactory
{
/**
* {@inheritDoc}
*/
protected function populateConfig(ArrayObject $config)
{
$config->defaults([
'payum.factory_name' => 'zarinpal',
'payum.factory_title' => 'zarinpal',
'payum.action.capture' => new CaptureAction(),
'payum.action.authorize' => new AuthorizeAction(),
'payum.action.refund' => new RefundAction(),
'payum.action.cancel' => new CancelAction(),
'payum.action.notify' => new NotifyAction(),
'payum.action.status' => new StatusAction(),
'payum.action.convert_payment' => new ConvertPaymentAction(),
]);
if (false == $config['payum.api']) {
$config->defaults($config['payum.default_options']);
$config['payum.required_options'] = array('merchant_id');
$config['payum.api'] = function (ArrayObject $config) {
$config->validateNotEmpty($config['payum.required_options']);
return new Api((array) $config, $config['payum.http_client'], $config['httplug.message_factory']);
};
}
}
}
services:
payum.zarinpal_gateway_factory:
class: AppBundle\Payum\Zarinpal\ZarinpalGatewayFactory
tags:
- { name: payum.gateway_factory, factory: zarinpal }
you are not using the core factory from the bundle but create your own, hence it knows nothing about storages and so on. So please use a builder:
services:
payum.zarinpal_gateway_factory:
class: Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder
arguments: [AppBundle\Payum\Zarinpal\ZarinpalGatewayFactory]
tags:
- { name: payum.gateway_factory_builder, factory: zarinpal }
I know this is old but just wanted to let you know I had the same problem and found the solution in this last post. Maybe it would be a good idea to add this to the documentation as I couldn't figured it out by reading it.
you are not using the core factory from the bundle but create your own, hence it knows nothing about storages and so on. So please use a builder:
services: payum.zarinpal_gateway_factory: class: Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder arguments: [AppBundle\Payum\Zarinpal\ZarinpalGatewayFactory] tags: - { name: payum.gateway_factory_builder, factory: zarinpal }
I know this is old but just wanted to let you know I had the same problem and found the solution in this last post. Maybe it would be a good idea to add this to the documentation as I couldn't figured it out by reading it.
I'am getting this error when redirecting to capture.
Do I have to add storage extension explicitly as mentioned here ?
According to doc it must add the storage extension automatically, Am I right?
My Payum Config :