1. Go to this page and download the library: Download liteweb/laravel-dotpay library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
liteweb / laravel-dotpay example snippets
Liteweb\LaravelDotpay\ServiceProvider::class,
public function pay(Request $request)
{
$data = [
'amount' => '100',
'currency' => 'PLN',
'description' => 'Payment for internal_id order',
'control' => $transaction->id, //ID that dotpay will pong you in the answer
'language' => 'pl',
'payer' => [
'first_name' => 'John',
'last_name' => 'Smith',
'email' => '[email protected]',
'phone' => '+48123123123'
],
];
$response = $this->dotpayApi->createPayment(new Payment($data));
return $response->getPaymentUrl();
}