PHP code example of dominservice / laravel-stripe-connect

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

    

dominservice / laravel-stripe-connect example snippets


'providers' => [
    Dominservice\LaravelStripeConnect\ServiceProvider::class,
],

(...)

'aliases' => [
    'StripeConnect' => Dominservice\LaravelStripeConnect\Facade\LaravelStripeConnectFacade::class,
]

'stripe' => [
  'model'  => App\User::class,
  'key'    => env('STRIPE_KEY'),
  'secret' => env('STRIPE_SECRET'),
],

use Dominservice\LaravelStripeConnect\StripeConnect;

use Dominservice\LaravelStripeConnect\Repositories\Account;

(...)

$account = Account::create($vendor, $params = [], $company = false);

StripeConnect::transaction($token)
    ->amount(1000, 'usd')
    ->from($customer)
    ->to($vendor, [], $company ?? false)
    ->create();

StripeConnect::createCustomer($token, $customer);

StripeConnect::transaction()
    ->amount(1000, 'usd')
    ->useSavedCustomer()
    ->from($customer)
    ->to($vendor, $params = [], $company = false)
    ->create(); 

StripeConnect::createAccount($vendor);

StripeConnect::transaction($token)
    ->amount(1000, 'usd', 50)
    ->from($customer)
    ->to($vendor, $params = [], $company = false)
    ->create(); 
 
 $sessionCheckout = new Checkout;
 $session = $sessionCheckout->vendor(auth()->user())
   ->destinationCharges()
   ->serReferenceTransaction($order->reference_number)
   ->customer($user)
   ->product(__('orders.transaction.name', [
     'days' => $days,
     'project' => $projectName,
     'campaign' => $campaignName,
   ]), $amount)
   ->fee(10, true)
   ->successUrl(route('orders.paymentSuccess', ['uuid'=>$order->uuid]))
   ->cancelUrl(route('orders.checkout', ['uuid'=>$order->uuid]))
   ->create();

$vendor = User:: (object) [
    'first_name' => 'Zenon',
    'last_name' => 'Burczymucha',
    'phone' => '+48555555555',
    'email' => '[email protected]',
    'country' => 'PL',
];

$vendorCompany = Company:: (object) [
    'city' => 'Warszawa',
    'address' => 'Zatyna 12',
    'address_2' => '',
    'postcode' => '01-000',
    'state' => 'Mazowieckie',
    'name' => 'Firma Testowa',
    'phone' => '+48555555555',
    'tax_no_prefix' => 'PL',
    'tax_no' => '0123456789',
    'country' => 'PL',
];

php artisan migrate