Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cashier::findBillable($customerId) not returning anythying #239

Closed
Benoit1980 opened this issue Jan 19, 2024 · 2 comments
Closed

Cashier::findBillable($customerId) not returning anythying #239

Benoit1980 opened this issue Jan 19, 2024 · 2 comments

Comments

@Benoit1980
Copy link

Benoit1980 commented Jan 19, 2024

Cashier Paddle Version

2.1.0

Laravel Version

10.4.1

PHP Version

8.1

Database Driver & Version

mariadb

Description

Not getting any output with:

use Laravel\Cashier\Cashier;

$user = Cashier::findBillable($customerId);

Steps To Reproduce

Hi,

I followed your documentation:

Here is my test:
$user = Auth::user(); // This user has an active subscription
logger($user);

Output:
{"id":397,"name":"kay","email":"xxxxxxxxxxxxxxxx@gmail.com","email_verified_at":"2023-12-04T22:20:03.000000Z","created_at":"2023-11-22T22:33:37.000000Z","updated_at":"2024-01-18T14:32:27.000000Z","paddle_id":null,"paddle_email":null,"trial_ends_at":null,"total_credits":39494,"current_credits":200000,"account_restriction":0,"dashboard_notifications":0,"roles":[{"id":2,"name":"customer","guard_name":"web","created_at":"2022-09-01T20:53:39.000000Z","updated_at":"2022-09-01T20:53:41.000000Z","pivot":{"model_type":"App\\Models\\User","model_id":397,"role_id":2}}]}

$results = Cashier::findBillable($user->id);

The Return is empty

I also tried to pass the paddle_id instead of the user_id form the subscription table, but no returns either.

Thank you.

@driesvints
Copy link
Member

This method requires a Paddle customer id, not a user ID. https://laravel.com/docs/10.x/cashier-paddle#retrieving-customers

@Benoit1980
Copy link
Author

Got it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants