boshurik/payum-yandex-money

The Payum Yandex Money gateway

1.0.0 2016-03-09 16:10 UTC

This package is auto-updated.

Last update: 2024-11-12 04:32:31 UTC


README

Installation

$ composer require boshurik/payum-yandex-money

Yandex configuration

In your profile

  • Enable http-notification
  • Set http-address for notifications. For PayumBundle users it would be https://example.com/payment/notify/unsafe/yandex_money

Configuration

<?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)
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)
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
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

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

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

2.x

payum:
    gateways:
        yandex_money:
            factory: yandex_money
            account: %yandex_account%
            secret: %yandex_secret%

Resources