<commit_before># Payum Yandex Money gateway

## Installation

```bash
$ composer require boshurik/payum-yandex-money
```

## Yandex configuration

In your [**profile**][1]
* Enable http-notification
* Set http-address for notifications. For `PayumBundle` users it would be `https://example.com/payment/notify/unsafe/yandex_money`

## Configuration

```php
<?php
//config.php

use Payum\Core\PayumBuilder;
use Payum\Core\Payum;

/** @var Payum $payum */
$payum = (new PayumBuilder())
    ->addDefaultStorages()
    ->addGateway('gatewayName', [
        'factory' => 'yandex_money',
        'account'  => 'change it',
        'secret'  => 'change it',
    ])
    ->getPayum()
;
```

## Payment

### Additional parameters

* Payment type (YandexMoney `paymentType` option)
```php
use BoShurik\Payum\YandexMoney\Api;

/** @var Payment $payment */
$payment->setDetails(array(
    Api::FIELD_PAYMENT_TYPE => Api::PAYMENT_AC, // Default
));
```
* Form type (YandexMoney `quickpay-form` option)
```php
use BoShurik\Payum\YandexMoney\Api;

/** @var Payment $payment */
$payment->setDetails(array(
    Api::FIELD_QUICKPAY_FORM => Api::QUICKPAY_FORM_SHOP, // Default
));
```

## Symfony

### Installation

```php
<?php
namespace AppBundle;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use BoShurik\Payum\YandexMoney\Bridge\Symfony\YandexMoneyGatewayFactory;
use Payum\Bundle\PayumBundle\DependencyInjection\PayumExtension;

class AppBundle extends Bundle
{
    /**
     * @inheritDoc
     */
    public function build(ContainerBuilder $container)
    {
        parent::build($container);

        /** @var $extension PayumExtension */
        $extension = $container->getExtension('payum');

        $extension->addGatewayFactory(new YandexMoneyGatewayFactory());
    }
}
```

### Configuration
```yaml
payum:
    gateways:
        yandex_money:
            yandex_money:
                account: %yandex_account%
                secret: %yandex_secret%
```

## Resources
* [Payum](http://payum.org)
* [Yandex](https://money.yandex.ru/doc.xml?id=526991)

[1]: https://money.yandex.ru/myservices/online.xml<commit_msg>Add documentation for payum-bundle 2.x<commit_after># Payum Yandex Money gateway

## Installation

```bash
$ composer require boshurik/payum-yandex-money
```

## Yandex configuration

In your [**profile**][1]
* Enable http-notification
* Set http-address for notifications. For `PayumBundle` users it would be `https://example.com/payment/notify/unsafe/yandex_money`

## Configuration

```php
<?php
//config.php

use Payum\Core\PayumBuilder;
use Payum\Core\Payum;

/** @var Payum $payum */
$payum = (new PayumBuilder())
    ->addDefaultStorages()
    ->addGateway('gatewayName', [
        'factory' => 'yandex_money',
        'account'  => 'change it',
        'secret'  => 'change it',
    ])
    ->getPayum()
;
```

## Payment

### Additional parameters

* Payment type (YandexMoney `paymentType` option)
```php
use BoShurik\Payum\YandexMoney\Api;

/** @var Payment $payment */
$payment->setDetails(array(
    Api::FIELD_PAYMENT_TYPE => Api::PAYMENT_AC, // Default
));
```
* Form type (YandexMoney `quickpay-form` option)
```php
use BoShurik\Payum\YandexMoney\Api;

/** @var Payment $payment */
$payment->setDetails(array(
    Api::FIELD_QUICKPAY_FORM => Api::QUICKPAY_FORM_SHOP, // Default
));
```

## Symfony

### Installation

#### 1.x

```php
<?php
namespace AppBundle;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use BoShurik\Payum\YandexMoney\Bridge\Symfony\YandexMoneyGatewayFactory;
use Payum\Bundle\PayumBundle\DependencyInjection\PayumExtension;

class AppBundle extends Bundle
{
    /**
     * @inheritDoc
     */
    public function build(ContainerBuilder $container)
    {
        parent::build($container);

        /** @var $extension PayumExtension */
        $extension = $container->getExtension('payum');

        $extension->addGatewayFactory(new YandexMoneyGatewayFactory());
    }
}
```

#### 2.x

```yaml
services:
    app.yandex_money.gateway_factory_builder:
        class: Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder
        arguments:
            - BoShurik\Payum\YandexMoney\YandexMoneyGatewayFactory
        tags:
            - { name: payum.gateway_factory_builder, factory: yandex_money }
```

### Configuration

#### 1.x

```yaml
payum:
    gateways:
        yandex_money:
            yandex_money:
                account: %yandex_account%
                secret: %yandex_secret%
```

#### 2.x

```yaml
payum:
    gateways:
        yandex_money:
            factory: yandex_money
            account: %yandex_account%
            secret: %yandex_secret%
```
## Resources
* [Payum](http://payum.org)
* [Yandex](https://money.yandex.ru/doc.xml?id=526991)

[1]: https://money.yandex.ru/myservices/online.xml
{'fraction_non_alphanumeric': 0.14961113385182154, 'fraction_numerical': 0.004297994269340974, 'mean_word_length': 3.593045112781955, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 27, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2690629', 'n_tokens_mistral': 1721, 'n_tokens_neox': 1640, 'n_words': 293}