LaravelPackages.net
Acme Inc.
Toggle sidebar
inkvizytor/dotpay

Package for Dotpay payments via api instead of form

3.559
0
2.1.15
About inkvizytor/dotpay

inkvizytor/dotpay is a Laravel package for package for dotpay payments via api instead of form. It currently has 0 GitHub stars and 3.559 downloads on Packagist (latest version 2.1.15). Install it with composer require inkvizytor/dotpay. Discover more Laravel packages by inkvizytor or browse all Laravel packages to compare alternatives.

Last updated

laravel-dotpay

Paczka Dotpay do Laravela 5.x. Pozwala przesyłać dane poprzez API zamiast formularza.

Scrutinizer Code Quality Build Status Latest Unstable Version License Total Downloads

Struktura

src/
tests/

Instalacja

Przez composera

$ composer require evilnet/dotpay

lub dodaj do pliku composera

 "require": {
         "evilnet/dotpay": "dev-master"
     },

Potem zarejestruj usługę i ewentualnie alias w config/app.php

'providers' => [

     Evilnet\Dotpay\DotpayServiceProvider::class,
 
 
 'aliases' => [
     'Dotpay' => Evilnet\Dotpay\Facades\Dotpay::class

Opublikuj konfguracje i wprowadź w niej potrzebne dane

php artisan vendor:publish --provider="Evilnet\Dotpay\DotpayServiceProvider"

Dodaj wartości do pliku .env

DOTPAY_USERNAME=
DOTPAY_PASSWORD=
DOTPAY_SHOP_ID=
DOTPAY_PIN=
DOTPAY_BASE_URL=https://ssl.dotpay.pl/test_seller/ 

I dodaj swoją metodę do obsługi callbacku jako wyjątek w VerifyCsrfToken

Przykład użycia

namespace App\Http\Controllers;

use Evilnet\Dotpay\DotpayManager;
use Illuminate\Http\Request;
use Illuminate\Http\Response;

class DotpayController extends Controller
{

    private $dotpayManager;

    public function __construct(DotpayManager $dotpayManager)
    {
        $this->dotpayManager = $dotpayManager;
    }

    public function callback(Request $request)
    {
        $response = $this->dotpayManager->callback($request->all());
        
        //Do whatever you want with this
        
        return new Response('OK');
    }

    public function pay()
    {
        $data = [
            'amount' => '100',
            'currency' => 'PLN',
            'description' => 'Payment for internal_id order',
            'control' => '12345', //ID that dotpay will pong you in the answer
            'language' => 'pl',
            'ch_lock' => '1',
            'url' => config('dotpay.options.url'),
            'urlc' => config('dotpay.options.curl'),
            'expiration_datetime' => '2017-12-01T16:48:00',
            'payer' => [
                'first_name' => 'John',
                'last_name' => 'Smith',
                'email' => '[email protected]',
                'phone' => '+48123123123'
            ],
            'recipient' => config('dotpay.options.recipient')

        ];

        return redirect()->to($this->dotpayManager->createPayment($data));
    }
}

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ phpunit vendor/evilnet/dotpay/tests

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

Star History Chart