v1.7 RC.1

This commit is contained in:
carodej
2020-07-20 16:03:39 +02:00
parent 6f95fc2565
commit b67297f160
22 changed files with 766 additions and 320 deletions

View File

@@ -114,6 +114,26 @@ class User extends Authenticatable
'used_capacity', 'storage'
];
/**
* Get tax rate id for user
*
* @return array
*/
public function taxRates()
{
$stripe = resolve('App\Services\StripeService');
// Get tax rates
$rates = collect($stripe->getTaxRates());
// Find tax rate
$user_tax_rate = $rates->first(function ($item) {
return $item['jurisdiction'] === $this->settings->billing_country && $item['active'];
});
return $user_tax_rate ? [$user_tax_rate['id']] : [];
}
/**
* Get user used storage details
*