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

Update payment.md #778

Closed
wants to merge 1 commit into from
Closed

Conversation

justinkekeocha
Copy link
Contributor

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

Signed-off-by: Kekeocha Justin Chetachukwu <[email protected]>
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #778 (c17ddaa) into master (a83b72a) will not change coverage.
The diff coverage is n/a.

❗ Current head c17ddaa differs from pull request most recent head 5ad6b8a. Consider uploading reports for the commit 5ad6b8a to get more accurate results

@@             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.
Copy link
Member

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.

$transfers = app(PurchaseServiceInterface::class)->already($this, $basketDto, $gifts);
if (count($transfers) !== $basketDto->total()) {

Copy link
Contributor Author

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

Copy link
Member

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.

@rez1dent3 rez1dent3 closed this Sep 19, 2023
@rez1dent3
Copy link
Member

Thanks for your contribution to the project. I closed these PRs as not relevant.

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

Successfully merging this pull request may close these issues.

2 participants