-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix/ Retrieve saved cards for at Profile System for PII accounts #664
Conversation
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
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.
@beatrizmaselli, retornei com alguns comentários para ver o que você acha.
Se quiser pode me chamar e avaliamos juntos
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.
@beatrizmaselli conversei com o @GusGuerra ontem. Demos uma olhada no PR juntos e achamos que a correção está basicamente OK
Só será mesmo necessário corrigir um bug que ocorre quando o usuário não possui cartão cadastrado. São as sugestões que deixei ativas ainda
Dá uma olhada e me fala!
Co-authored-by: vmourac-vtex <[email protected]>
Co-authored-by: vmourac-vtex <[email protected]>
Your PR has been merged! App is being published. 🚀 After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:
After that your app will be updated on all accounts. For more information on the deployment process check the docs. 📖 |
What problem is this solving?
Cards saved at a profile using PII are not retrieved at my account.
The first problem is that the API to retrieve the
purchase-info
does not accept the alternativeKey param and it was calling the API with the unmasked path twice likeunmasked/unmasked
. So when this API was being called it was returning 404 even when the profile had already purchase infos saved to it.Ex:
http://portal.vtexcommercestable.com.br/api/storage/profile-system/profiles/[email protected]/purchase-info/unmask?alternativeKey=email&useCase=MyAcocunts&onBehalfOf=user&an=dunnesstoresqa
This will return 404. ❌
Calling using the userId:
http://portal.vtexcommercestable.com.br/api/storage/profile-system/profiles/5f2e2bf9-13ba-4679-9ce4-5877fee681e6/purchase-info/unmask?useCase=MyAcocunts&onBehalfOf=user&an=dunnesstoresqa
The information is retrieve as expected. ✅
The second problem is that the service was not ready to deal with the format of the paymentsRawData for PII accounts.
Example PV1 account:
Example PV2 account:
To deal with this I added a new call to the LM to check if the context is PII or not to differentiate the format for the paymentsRawData.
How to test it?
Workspace
Screenshots or example usage:
Graphql returning payments:
How does this PR make you feel? 🔗