1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Http/Controllers/StripeConnectController.php

52 lines
1.2 KiB
PHP
Raw Normal View History

2021-04-20 16:08:33 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Http\Controllers;
use App\Http\Requests\StripeConnect\InitializeStripeConnectRequest;
use App\Models\CompanyGateway;
use App\PaymentDrivers\Stripe\Connect\Account;
use Stripe\Exception\ApiErrorException;
class StripeConnectController extends BaseController
{
/**
* Initialize Stripe Connect flow.
*
* @param string $token One-time token
* @throws ApiErrorException
*/
public function initialize(InitializeStripeConnectRequest $request, string $token)
{
// $request->getTokenContent();
$data = [
2021-04-21 00:38:50 +02:00
'type' => 'standard',
2021-04-20 16:08:33 +02:00
'email' => 'user@example.com',
'country' => 'US',
];
$account = Account::create($data);
$link = Account::link($account->id);
// Store account->id into company_gateways.
return redirect($link['url']);
}
2021-04-21 00:38:50 +02:00
public function completed()
{
dd(request()->all());
}
2021-04-20 16:08:33 +02:00
}