added it_get_all_invoices_from_admin, it_get_single_user_invoice_page test

This commit is contained in:
Peter Papp
2021-03-07 09:50:04 +01:00
parent da7aee2790
commit 5660fcd4dc
6 changed files with 159 additions and 112 deletions
+16 -8
View File
@@ -333,7 +333,10 @@ class StripeService
*/
public function deletePlan($slug)
{
$this->stripe->plans()->delete($slug);
$this
->stripe
->plans()
->delete($slug);
}
/**
@@ -344,20 +347,22 @@ class StripeService
*/
public function getUserInvoices($user)
{
return $user->invoices();
return $user
->invoices();
}
/**
* Get user invoice by id
*
* @param $customer
* @param $id
* @return \Laravel\Cashier\Invoice|null
*/
public function getUserInvoice($customer, $id)
{
$user = User::where('stripe_id', $customer)->firstOrFail();
return $user->findInvoice($id);
return User::whereStripeId($customer)
->firstOrFail()
->findInvoice($id);
}
/**
@@ -367,8 +372,11 @@ class StripeService
*/
public function getInvoices()
{
return $this->stripe->invoices()->all([
'limit' => 20
]);
return $this
->stripe
->invoices()
->all([
'limit' => 20
]);
}
}