| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function handle() |
||
| 16 | { |
||
| 17 | Stripe::setApiKey( |
||
| 18 | config('dashboard.tiles.stripe.secret_key', env('STRIPE_SECRET')) |
||
|
|
|||
| 19 | ); |
||
| 20 | |||
| 21 | $this->info('Fetching Stripe balances ...'); |
||
| 22 | |||
| 23 | $balances = Balance::retrieve(); |
||
| 24 | |||
| 25 | $balances = collect($balances->available) |
||
| 26 | ->map(function ($balance) { |
||
| 27 | return [ |
||
| 28 | 'amount' => $this->toReadableAmount($balance->amount), |
||
| 29 | 'currency' => strtoupper($balance->currency), |
||
| 30 | ]; |
||
| 31 | })->toArray(); |
||
| 32 | |||
| 33 | StripeBalancesStore::make()->setData($balances); |
||
| 34 | |||
| 35 | $this->info('All done!'); |
||
| 36 | |||
| 37 | return 0; |
||
| 38 | } |
||
| 45 |