Download the PHP package sakshram/pangalinks without Composer

On this page you can find all versions of the php package sakshram/pangalinks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pangalinks

PangalinkBundle

Adds a functionality for making payments in Estonia using Banklink (Pangalink) transfer.
At this moment only payment logic is implemented.

Banks available:

Installation


"require": {
  ...
  "sakshram/pangalink-bundle": "2.*@dev"
  ...

Configuration

PangalinkBundle configuration is stored in app/config/config.yml file. An example is provided below:


t_fox_pangalink:
    accounts:
        #First bank
        #ID of the first bank. This ID will be used in system. Feel free to write any ID you wish
        swedbank:
            #Type of bank. Possible arguments: swedbank, seb, krediidipank, sampo, nordea, lhv
            bank: swedbank
            #Service URL. Remove in production mode if real bank's URL is necessary
            service_url: "https://pangalink.net/banklink/swedbank"
            #Vendor's bank account number
            account_number: 123456
            #Vendor's name
            account_owner: "Test"
            #Path to file with user's private key. Relative to "app" directory
            private_key: "data/pangalink/swed_user_key.pem"
            #Path to file with certificate of the bank. Relative to "app" directory
            bank_certificate: "data/pangalink/swed_bank_cert.pem"
            #Vendor's ID given by bank
            vendor_id: "222222"
            #Route of the page displayed if payment was successful
            route_return: "acme_demo_pangalink_swedbank_process"
            #Route of the page displayed if payment was cancelled
            route_cancel: "acme_demo_pangalink_swedbank_index"
            #Alternatives to route_return and route_cancel are:
            #url_return: "http://example.com"
            #url_cancel:  "http://example.com"
        #Second bank
        #ID of the second bank. This ID will be used in system. Feel free to write any ID you wish
        seb:
            bank: seb
            account_number: 1234567
            account_owner: "Test2"
            private_key: "data/pangalink/seb_user_key.pem"
            bank_certificate: "data/pangalink/seb_bank_cert.pem"
            vendor_id: "33333333"
            route_return: "acme_demo_pangalink_sebbank_process"
            route_cancel: "acme_demo_pangalink_sebbank_index"
        #Third bank. Yes, you might have multiple accounts for each bank
        seb_second:
            bank: seb
            account_number: 9876545
            account_owner: "Test3"
            private_key: "data/pangalink/seb_user_key2.pem"
            bank_certificate: "data/pangalink/seb_bank_cert2.pem"
            vendor_id: "33333334"
            route_return: "acme_demo_pangalink_sebbanksecond_process"
            route_cancel: "acme_demo_pangalink_sebbanksecond_index"
        #Nordea uses secret instead of key pair based encryption.
        nordea:
            bank: nordea
            account_owner: "Test4"
            secret: "SomeSecretString"
            vendor_id: "33333334"
            route_return: "acme_demo_pangalink_nordea_process"
            route_reject: "acme_demo_pangalink_nordea_index"
            route_cancel: "acme_demo_pangalink_nordea_index"

Usage


//YourBundle/Controller/SomeController.php

use Sensio\Bundle\FrameworkExtraBundle\Configuration as Sensio;

class SomeController extends BaseController
{

    /**
     * @Sensio\Route
     * @Sensio\Template
     */
    public function indexAction()
    {
        //Amount, payment description and some transaction ID
        $amount = 10.0;
        $description = 'Symfony2 pangalink bundle test';
        $transactionId = mt_rand(0, 999999);
        $transactionId = str_pad($transactionId, 6, '0');

        /* @var $service \TFox\PangalinkBundle\Service\PangalinkService */
        $service = $this->get('tfox.pangalink.service');
         // 'swedbank' is ID of the bank from config.yml
        /* @var $connector \TFox\PangalinkBundle\Connector\SwedbankConnector */     
        $connector = $service->getConnector('swedbank');
        $request = $connector->createPaymentRequest();
        $request
            ->setAmount($amount)
            ->setComment($description)
            ->setTransactionId($transactionId)
            ->setLanguage('EST') //Possible values: EST, ENG, RUS
            // Warning: RUS is not applicable for Nordea
        ;

        // Warning: date is not applicable for Solo protocol (Nordea)
        $request->setDateTime(new \DateTime());

        //Optional. Warning: don't forget to make a 7 + 3 + 1 check of reference number,
        //otherwise bank might not accept sended data
        //Further info: http://www.pangaliit.ee/et/arveldused/7-3-1meetod
        //->setReferenceNumber('123456')
        ;

        return array('payment_request' => $request);

    }
}


//YourBundle/Resources/views/Some/index.html.twig

{# 'swedbank' is bank ID which was defined in config.yml  #}
<form method="post" action="{{ pangalink_action_url(payment_request) }}">
{{ pangalink_form_data(payment_request) }}

{# Just an argument from controller  #}

<input type="submit" value="Begin payment">
</form>



//YourBundle/Resources/views/Some/index.html.twig

{# The first argument is a payment request received from controller. The second argument is a button code. Watch the table below.  #}

{{ pangalink_button(payment_request, '88x31') }}

In the table below are provided codes for images which are available in PangalinkBundle.
WARNING! All images are the property of their respective owners (banks). It is usually forbidden to modify provided images.

Bank Available image codes
Swedbank 88x31
120x60_1
120x60_2
217x31_est
217x31_rus
217x31_eng
SEB 88x31
120x60_1
120x60_2
Krediidipank 88x19
88x31
137x30
Sampobank 88x31
88x31_anim
120x60_1
120x60_2
180x70
Nordea 88x31
177x56
LHV 88x31
120x60

//YourBundle/Controller/SomeController.php

use Sensio\Bundle\FrameworkExtraBundle\Configuration as Sensio;

class SomeController extends BaseController
{

    /**
     * @Sensio\Route("/process")
     * @Sensio\Template
     */
    public function processAction(Request $request)
    {
            /* @var $service \TFox\PangalinkBundle\Service\PangalinkService */
            $service = $this->get('tfox.pangalink.service');
            // Get a response from bank. 
            // The bundle automatically determines an appropriate connector
            $paymentResponse = $service->getPaymentResponse($request);

            // If no appropriate connector found, the function "getPaymentResponse" returns null
            if(true == is_null($paymentResponse))
                throw new \Exception('Could not determine a bank operator');

            // Check if payment was successful
            if(true == $paymentResponse->isSuccessful()) {
                // Get some properties 
                $paymentResponse->getBankId();
                $paymentResponse->getOrderNumber();
                $paymentResponse->getTransactionId();
                $paymentResponse->getDateTime();
            }

            // Get ID of the connector defined in the Symfony confiruration
            $accountId = $paymentResponse ? $paymentResponse->getConnector()->getAccountId() : 'NONE';
            // Format status
            $status = $paymentResponse && $paymentResponse->isSuccessful() ? 'YES' : 'NO';

            return array(
                'response' => $paymentResponse,
                'account_id' => $accountId,
                'status' => $status
            );
    }
}

All versions of pangalinks with dependencies

PHP Build Version
Package Version
Requires symfony/symfony Version 3.4.*
symfony/assetic-bundle Version 2.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sakshram/pangalinks contains the following files

Loading the files please wait ....