-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Gift card being applied inconsistently in cart and order #5005
Comments
Submitted this: #5015 |
@olivermrbl mentionning you here so that you have the full context of the origin of the pr |
For the record, I believe the correct behaviour is for the gift card to cover everything (sub total, tax, shipping). So Stripe should not be getting charged at all if gift card is worth like $40 |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days. |
This issue was closed because it has been stalled for 3 days with no activity. |
@Arsenalist any update on this? |
To reproduce:
Discord Link: https://discord.com/channels/876835651130097704/1150475042669465692
Medusa version (including plugins): 1..14
Node.js version: 16
Cart screen
![image](https://private-user-images.githubusercontent.com/76740/266858399-94255905-c172-4bdb-89c7-bb1013e2afdb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjcwMTAsIm5iZiI6MTczOTU2NjcxMCwicGF0aCI6Ii83Njc0MC8yNjY4NTgzOTktOTQyNTU5MDUtYzE3Mi00YmRiLTg5YzctYmIxMDEzZTJhZmRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDIwNTgzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNiOWU1NmQwYzk5ZjAzZWYxZDYwMzZlNjcwZTUxODEwZDM3ZGQwZjM1ZTAxYTQ0ZmE2NGFjNWM1ZDk3MDg1ZTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.MjaOnxmmoYv2wYmaQaT-ZBS0O0HSYgk8RLG9aYkZS6Q)
Order screen
![image](https://private-user-images.githubusercontent.com/76740/266858404-a5585609-8254-48bc-9bf3-e3c4aaf0bccf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjcwMTAsIm5iZiI6MTczOTU2NjcxMCwicGF0aCI6Ii83Njc0MC8yNjY4NTg0MDQtYTU1ODU2MDktODI1NC00OGJjLTliZjMtZTNjNGFhZjBiY2NmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDIwNTgzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWExMTY3ZWIxYzdjNTUxZmY5ZjEzNTQxMTQ3NjFlZDVjMWM2YzI2NTcyNzA3Mzg0Zjk1YjU2MzYyN2JiYTk4N2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.jQuBYo9hWnyAwgiB7kgRQNkigIh9_OpX3Rq8wuhm370)
Stripe is getting charged
![image](https://private-user-images.githubusercontent.com/76740/266858451-676ce011-3270-4cbd-83e1-4d8614b0e7a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjcwMTAsIm5iZiI6MTczOTU2NjcxMCwicGF0aCI6Ii83Njc0MC8yNjY4NTg0NTEtNjc2Y2UwMTEtMzI3MC00Y2JkLTgzZTEtNGQ4NjE0YjBlN2E2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDIwNTgzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA1YmFkZmJjN2Q1ZWI4ODc5ZDcwOTI3NTk4YWExNGQyNjM0ZTg4ODQ1NWZhODYxNjlkMWY5ODBjZGFiOTk0NjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.FwUHMDlSqB7jjuD7NOVa8kTL3PQegKZk_gO2d-Ycqh8)
Database: Postgres 12
Operating system: Linux
This piece of code in cart.ts decorateTotals() does not check if region has gift card taxable when calculating gift cardable amount:
While this one in order.ts createFromCart() does:
I also don't think this is correct
decorateTotals()
is correct since gift card applies to whole amount in the cart, not just subtotal-discount_total. I mentioned that in Discord as well.The text was updated successfully, but these errors were encountered: