2017 © Pedro Peláez
 

library dotpay

Package for Dotpay payments via api instead of form

image

evilnet/dotpay

Package for Dotpay payments via api instead of form

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 10 Versions
  • 146 % Grown

The README.md

laravel-dotpay

Paczka Dotpay do Laravela 5.x. Pozwala przesyłać dane bezpośrednio przez API zamiast formularza., (*1)

Scrutinizer Code Quality Build Status Latest Unstable Version License Total Downloads, (*2)

Struktura

src/
tests/

Instalacja

Przez composera, (*3)

``` bash $ composer require evilnet/dotpay, (*4)


lub w przypadku używania aktualnej wersji z mastera (niezalecane jeżeli chcesz używać najbardziej stabilnej wersji która została ujęta w release) dodaj do pliku composera ```json "require": { "evilnet/dotpay": "dev-master" },

Potem zarejestruj usługę i ewentualnie alias by móc używać fasady w config/app.php (Niepotrzebne od Laravela 5.5 i wzwyż), (*5)

'providers' => [

     Evilnet\Dotpay\DotpayServiceProvider::class,


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

Opublikuj konfguracje i wprowadź w niej potrzebne dane, (*6)

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

Dodaj wartości do pliku .env, (*7)

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 pliku VerifyCsrfToken (Potrzebne by uderzenia POST z dotpaya nie wymagały tego tokenu), (*8)

Środowiska

Produkcyjne: https://ssl.dotpay.pl/s2/login/, (*9)

Testowe: https://ssl.dotpay.pl/test_seller/, (*10)

Przykład użycia

``` php namespace App\Http\Controllers;, (*11)

use Evilnet\Dotpay\DotpayManager; use Illuminate\Http\Request; use Illuminate\Http\Response;, (*12)

class DotpayController extends Controller {, (*13)

private $dotpayManager;

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

// Tutaj uderzy Dotpay z danymi o tym w jakim stanie jest transakcja. Zwrócenie OK jest wymagane by dotpay przyjął, że serwer odpowiada poprawnie

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' => 'john.smith@example.com',
            'phone' => '+48123123123'
        ],
        'recipient' => config('dotpay.options.recipient')

    ];

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

}, (*14)


## Change log Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. ## Testing ``` bash $ phpunit vendor/evilnet/dotpay/tests

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details., (*15)

Security

If you discover any security related issues, please email axotion@linux.pl instead of using the issue tracker., (*16)

Credits

License

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

The Versions

20/07 2018

dev-accesslint-test

dev-accesslint-test https://github.com/Evilnet/Dotpay

Package for Dotpay payments via api instead of form

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel dotpay evilnet

16/07 2018

dev-master

9999999-dev https://github.com/Evilnet/Dotpay

Package for Dotpay payments via api instead of form

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel dotpay evilnet

16/07 2018

2.0.3

2.0.3.0 https://github.com/Evilnet/Dotpay

Package for Dotpay payments via api instead of form

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel dotpay evilnet

19/02 2018

2.0.2

2.0.2.0 https://github.com/Evilnet/Dotpay

Package for Dotpay payments via api instead of form

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel dotpay evilnet

16/02 2018

2.0.1

2.0.1.0 https://github.com/Evilnet/Dotpay

Package for Dotpay payments via api instead of form

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel dotpay evilnet

16/02 2018

dev-hotfix/namespaces

dev-hotfix/namespaces https://github.com/Evilnet/Dotpay

Package for Dotpay payments via api instead of form

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel dotpay evilnet

17/11 2017

dev-develop

dev-develop https://github.com/Evilnet/Dotpay

Package for Dotpay payments via api instead of form

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel dotpay evilnet

17/11 2017

2.0

2.0.0.0 https://github.com/Evilnet/Dotpay

Package for Dotpay payments via api instead of form

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel dotpay evilnet

14/11 2017

1.0.0

1.0.0.0 https://github.com/Evilnet/Dotpay

Package for Dotpay payments via api instead of form

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel dotpay evilnet

23/09 2017

0.0.0

0.0.0.0 https://github.com/Evilnet/Dotpay

Package for Dotpay payments via api instead of form

  Sources   Download

MIT

The Requires

 

The Development Requires

dotpay evilnet