sergeym/pay-receipt-bundle

Pay receipt generator

Installs: 72

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:HTML

Type:symfony-bundle

dev-master 2015-07-15 15:13 UTC

This package is auto-updated.

Last update: 2024-11-29 04:39:05 UTC


README

Receipt Bundle

This bundle creates printable form of pay receipt PD-14 usualy used in banks of Russia.

Step 1: Download SergeymReceiptBundle using composer

composer require sergeym/pay-receipt-bundle:dev-master

or add to your composer json

{
    "require": {
        "sergeym/pay-receipt-bundle": "dev-master"
    }
}

Step 2: Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Sergeym\ReceiptBundle\SergeymReceiptBundle()
    );
}

Step 3: Update app/config.yml

sergeym_receipt:
    template:
        pd4: SergeymReceiptBundle:Default:pd4.html.twig # ../recipe/pd4 or just ../recipe because it default value
        # add more pay receipt form templates here
    merchant:
        1: # merchant_id
            extra:
                payee: ~
                okato: ~
                inn: ~
                kpp: ~
                account: ~
                bank: ~
                correspondent_account: ~
                bik: ~
                #add more extra field for template injection using {{ receipt.extra('extra-name') }}
        # you can add more merchants

Step 3: Routing

# app/config/routing.yml
sergeym_receipt:
    resource: "@SergeymReceiptBundle/Resources/config/routing.yml"
    prefix:   /

How it works?

Post request to /receipt or /receipt/{receipt_form_name}, where {receipt_form_name} is template name in sergeym_receipt.template section in config.yml

POST data:

post_code
post_address
payer_name
name
merchant_id
currency_code
currency_digits_after_decimal_point
total_amount
return_url