PHP code example of barstec / laravel-stripe-simple-payment

1. Go to this page and download the library: Download barstec/laravel-stripe-simple-payment 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/ */

    

barstec / laravel-stripe-simple-payment example snippets




namespace App\Http\Controllers;

use Barstec\Stripe\Payload;
use Barstec\Stripe\Payment;

class StripeTestController extends Controller
{
    public function test()
    {
        $payload = new Payload();
        $payload->setAmount(1.29);
        $payload->setName("test");
        $payload->setCustomerEmail("[email protected]");
        $payload->setReturnUrl('http://127.0.0.1:8000');
        $payload->addAdditionalParam('phone_number_collection.enabled', true);
        $payment = new Payment($payload);
        return $payment->redirect();
    }
}



protected $listen = [
    StripeTransactionCreated::class => [
        ExampleListener::class
    ]
];

bash
php artisan vendor:publish --provider="Barstec\Stripe\StripeServiceProvider"
bash
php artisan migrate