Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mkurc1/payubundle

Symfony PayuBundle
https://github.com/mkurc1/payubundle

Last synced: 8 days ago
JSON representation

Symfony PayuBundle

Awesome Lists containing this project

README

        

# PayUBundle

The bundle integrate [PayU](http://www.payu.pl/) into [Symfony](http://symfony.com/) Framework.

## Configure

Require the bundle with composer:

$ composer require mkurc1/payu-bundle

Enable the bundle in the kernel:

getId();
}

public function getTotalPrice()
{
return 111; // your price
}

/**
* @return int
*/
public function getId()
{
return $this->id;
}
}

Create your PayuOrderRequest class:

order;
}

/**
* @param Order $order
*/
public function setOrder($order)
{
$this->order = $order;
}
}

Configure your application:

# app/config/config.yml
monolog:
handlers:
payu:
type: stream
path: "%kernel.logs_dir%/payu.log"
channels: [payu]

payu:
class:
request: AppBundle\Entity\PayuOrderRequest # your PayuOrderRequest class
redirect: app_profile_edit # redirect to route after payment
environment: secure
pos_id: 145227
signature_key: 13a980d4f851f3d9a1cfc792fb1f5e50

Configure your routing:

# app/config/routing.yml
payu:
resource: "@PayuBundle/Controller/"
type: annotation

Create your Controller:

get('payu.client')->createRequest($order);

return $this->redirect($payRequest->getResponse()->redirectUri);
}
}

Update your database schema:

$ php app/console doctrine:schema:update --force

You now can use your payment system!

## License

The bundle is released under the [MIT License](LICENSE).