-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
Confliction With Laravel Cashier #530
Comments
Hello. duplicate #87 Model example: https://github.com/bavix/laravel-wallet/blob/77b781e2ccef1a4638d5fb414a5a1f5570ba5777/tests/Infra/Models/UserCashier.php laravel-wallet/tests/Units/Domain/MultiWalletTest.php Lines 530 to 554 in 59a8026
|
Hey @rez1dent3
No collision with Cashier if am not using CanPay Trait along with Customer interface. |
In reference of suggested way to implement desired functionality I have changed my User model to be like this
But still am facing the same problem Can see in the above image am even unable to make the server up i.e, |
So it will not work, because. Packages use methods with the same name. You need to use multi wallets, they have all the necessary functionality |
I mean, CanPay is already inside the wallet and there is no need to mark it in the model |
So @rez1dent3
to this
|
Yes |
Changing the User Model to look like this
can serve now. @rez1dent3 Thanks mate (y) |
Furthermore, just to clear silly doubt Need to use full syntax in place of shorthand syntax right?
|
@rez1dent3
am receiving an error saying ** TypeError: App\Models\Order::getAmountProduct(): Argument #1 ($customer) must be of type Bavix\Wallet\Interfaces\Customer, App\Models\User given on line 1 ** |
purchases come from the wallet. you need to get the wallet and pass it to the method |
So need to change
with this
|
if the purchase was this wallet, then yes |
Well as per your suggestion am using multi wallet now but am not creating any new wallet rather than working with default wallet as of now |
Maxim @rez1dent3 |
yes, if you only use one wallet, then you need to transfer it. I wrote this for general understanding. |
Describe the bug
Already handling subscriptions with Laravel Cashier, so as per Laravel Cashier my User Model contains Cahier's Billable trait
Now, need to use Wallet's Purchases feature So Changed my User model to this
But now I am getting below error and even unable to serve.
**PHP Fatal error: Trait method Bavix\Wallet\Traits\CanPay::pay has not been applied as App\Models\User::pay, because of collision with Laravel\Cashier\Billable::pay in /var/www/html/better_cloud/app/Models/User.php on line 20
Symfony\Component\ErrorHandler\Error\FatalError
Trait method Bavix\Wallet\Traits\CanPay::pay has not been applied as App\Models\User::pay, because of collision with Laravel\Cashier\Billable::pay**
The text was updated successfully, but these errors were encountered: