Open rafaelpatro opened 2 years ago
Hi @rafaelpatro. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @rafaelpatro , Thank you for reporting and collaboration. Verified the behavior on Magento 2.4-develop instance and is reproducible. deletePaymentToken mutation is always returning true even if already deleted payment tokens public_hash is given in the graphql request. If any invalid public_hash is given in the request, there is no issue. Proper error message is displayed as expected. This issue exists when deleted payment token public_hash is used. All the payment tokens created before are not removed in the vault_payment_token DB table even after deleting. As per Magento devdocs, mutation should delete a payment token from the system. There is no issue with "customerPaymentTokens" query. Empty set is retrieved if all payment tokens are deleted and no payment tokens are retrieved in the response. Hence updating the description with manual steps to reproduce and confirming this issue.
When deleted public_hash is used:
With invalid public_hash:
customerPaymentTokens query after deleting all payment tokens:
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-7048 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @rafaelpatro,
Thank you for reporting and collaboration. Verified the issue on Magento 2.4-develop instance and the issue is reproducible. Kindly refer the screenhshots.
Steps to Reproduce :
1.Generated customer token using "generateCustomerToken" mutation 2.Loggedin to store-front and placed order with Credit card vault enabled (with Save card for future option) 3.Ran "customerPaymentTokens" query and retrieved public_hash 4.Ran deletePaymentToken mutation 5.Ran deletePaymentToken mutation again using same public_hash
There is no issue if we add invalid public_hash it is throwing errors but if we reran mutation with already used public_has then also result is getting true and no payment tokens are removed from vault_payment_token DB table. so issue is getting reproducible
Hence Confirming the issue.
Thanks.
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-7048
@magento I am working on this
Hi @vinothjkgds! :wave:
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team
command to join Contributors team.
@magento add to contributors team
Hi @vinothjkgds! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.
Hi,
Verified this issue and reproducible in Magento2.4 develop instance. I have added the below code to fix this issue. @magento team can you please confirm to create PR for this issue.
File Path: app/code/Magento/Vault/Model/PaymentTokenRepository.php#L128
/** @var PaymentToken $tokenModel */ $tokenModel = $this->getById($paymentToken->getEntityId()); if (empty($tokenModel->getPublicHash())) { return false; } try { **$tokenModel->delete();** return true; }catch(\Exception $e){ return false; }
Note: Rest API delete action also uses the same method.
@magento I am working on this
@magento i am working on this
*Pre Conditions ()** Magento 2.4-develop with Credit card payment and vault enabled.
Description
I'm having some issues with disabled tokens. And I figured out the repository for tokens never deletes the registries. Actually they are just disabled by setting visibility and activation flags to zero.
https://github.com/magento/magento2/blob/7c6b6365a3c099509d6f6e6c306cb1821910aab0/app/code/Magento/Vault/Model/PaymentTokenRepository.php#L127-L140
So I was wondering why not removing these registries when requested by the customer. Is there a reason for this? Is it a good practice to keep in table old and disabled tokens?
*Manual steps to reproduce ()**
Issue: deletePaymentToken mutation always returining true. No error message displayed. No payment tokens are removed from vault_payment_token DB table.
Expected result: Could not find a token .. Error message should be displayed. Just like if invalid public_hash is given.
Actual Result: deletePaymentToken mutation always returining true.
Additional Information https://github.com/magento/magento2/issues/36137#issuecomment-1318340325