dmitrovskiy/velocityservice

silex service for velocity payment system

dev-master 2015-10-06 21:34 UTC

This package is not auto-updated.

Last update: 2024-12-21 17:43:27 UTC


README

Using

Single velocity processor

To use it in your project you should add the package "dmitrovskiy/velocityservice": "dev-master" into your composer.json file.

Before using velocity service provider you need to inject values:

$app = new Application();

$app->register(new VelocityServiceProvider(), array(
    'velocity.identityToken' => 'yourToken',
    'velocity.applicationProfileId' => 1234,
    'velocity.merchantProfileId' => 'yourMerchantProfileID',
    'velocity.workflowId' => 1234565,
    'velocity.isTestAccount' => true
));

The value velocity.isTestAccount is optional and false by default.

After registering the service you be able to use $app['velocity.processor'] to communicate with velocity service.

Velocity processor factory

That to use several instances of velocity processor you need $app['velocity.processor.factory'].

$applicationProfileId = 14644;
$merchantProfileId = "Test Merchant HC";
$workflowId = 2317000001;
$identityToken = 'yourToken';
$isTestAccount = true;

$velocityProcessorFactory = $app['velocity.processor.factory'];

$processor = $velocityProcessorFactory->getProcessor(
    $applicationProfileId,
    $merchantProfileId,
    $workflowId,
    $identityToken,
    $isTestAccount
);