Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.14 KB

README.md

File metadata and controls

48 lines (35 loc) · 1.14 KB

SamanPaymentBundle

A symfony wrapper bundle for Saman Electeronic Payment.

Install

Via Composer

composer require ericomgroup/saman-payment-bundle

Edit your app/AppKernel.php to register the bundle in the registerBundles() method as above if you haven't symfony flex:

class AppKernel extends Kernel
{

    public function registerBundles()
    {
        $bundles = array(
            // ...
            // register the bundle here
            new EricomGroup\SamanPaymentBundle\SamanPaymentBundle()
        );
    }
}

Usage

Wherever you have access to the service container :

<?php
    // get the saman_payment as a service
    $samanPayment = $this->container->get('saman_payment');

    // set merchantID and password
    $samanPayment->setMerchantId('your-merchantId')->setPassword('your-password');
    
    //receive param from bank gateway; (verify payed amount and return true or false)
    $result = $samanPayment->receiverParams($refNum, $state, $amountMustBePayed);

License

The MIT License (MIT). Please see License File for more information.