-
-
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
Update payment.md #778
Update payment.md #778
Conversation
Signed-off-by: Kekeocha Justin Chetachukwu <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #778 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 551 551
===========================================
Files 83 83
Lines 1946 1946
===========================================
Hits 1946 1946 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -84,7 +84,7 @@ class Item extends Model implements ProductLimitedInterface | |||
``` | |||
|
|||
I do not recommend using the limited interface when working with a shopping cart. | |||
If you are working with a shopping cart, then you should override the `PurchaseServiceInterface` interface. | |||
If you are working with a shopping cart, then you should override the `ProductLimitedInterface` with the `PurchaseServiceInterface` interface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will answer here immediately for all three PRs. It is not correct. You are confusing the service contract and the model contract.
This talks about the public contract of the service that works with purchases. The service has one single method that returns a list of transfers for making a refund.
laravel-wallet/src/Traits/CartPay.php
Lines 201 to 202 in a83b72a
$transfers = app(PurchaseServiceInterface::class)->already($this, $basketDto, $gifts); | |
if (count($transfers) !== $basketDto->total()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add how to override this in the documentation will be of great help. Or documenting what the PurchaseServiceInterface
actually does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The laravel documentation answers your question:
https://laravel.com/docs/10.x/container#binding
No one asks about it. There are two options: everything is clear or no one uses it. I'm sticking with the second option.
Thanks for your contribution to the project. I closed these PRs as not relevant. |
Instead of repeating ourselves at multiple place, won't it be better to only write about the
ProductLimitedInterface
,PurchaseServiceInterface
interface, in the payment page. Then we link the payment page at other pages. @rez1dent3