-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Checking for Already purchased product fails if the receiving wallet is different. #1000
Comments
Hello, @yondifon. The method has long been deprecated and this is written in phpdoc. /**
* Checks acquired product your wallet.
*
* @deprecated The method is slow and will be removed in the future
* @see PurchaseServiceInterface
*/ The method was deprecated when the receiving purchases functionality was added. Now you need to do this. $transfers = app(PurchaseServiceInterface::class)->already($user, $cart->getBasketDto()); Confirmation of purchases is the amount of transfers equal to the number of items in the basket. |
In general, the current implementation is a crutch that I was strongly asked to add to the package. It does not normally take into account the return and check of the purchase of goods when transferring $receiving, since the architecture was originally different. A separate table for orders has been requested for a long time. Most likely, this will not be earlier than v12.0. We need to come up with a new structure so as not to break the current code, which is used by many projects. |
alright. make sense. thanks for the clarification. (need some extra hands any time, just let me know) |
@rez1dent3 you say we should do this: $transfers = app(PurchaseServiceInterface::class)->already($user, $cart->getBasketDto()); but in the original Am I missing something here? |
@mokhosh Hello. The difference is that the current laravel-wallet/src/Traits/CartPay.php Lines 542 to 544 in 4fd4f9b
This was my first thought, then I went to double-check the code and discovered that for it to work properly, a new table was needed, which needed to be developed and added within the 12.x version. Now, unfortunately, when setting the wallet for item, some of the functionality will not work, yes, because there is not enough data. If you have a separate table with purchased goods, then you can override PurchaseServiceInterface and implement your logic there. Or wait for laravel-wallet 12.0, which will have this functionality out of the box. The release will be after the release of laravel 12. |
Makes sense. Thanks. |
Describe the bug
Using
$customer->paid($product))
fails when product was purchased with money transferred to another wallet.To Reproduce
Steps to reproduce the behavior:
1.
Expected behavior
The method is supposed to return true but it still return false.
It fails when it should pass (as it should though, The underlying code needs to provide a $receiving wallet
Server:
The text was updated successfully, but these errors were encountered: