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

Cred customer purchasing #12868

Merged

Conversation

abhigyanghosh30
Copy link
Contributor

@abhigyanghosh30 abhigyanghosh30 commented May 15, 2023

Done

  • A page for buying activation keys for CUE0.1 Exam

QA

  • Check out this feature branch
  • Run the site using the command ./run serve or dotrun
  • Visit /credentials/shop
    • Select quantity
    • Pay
    • New activation keys should be visible in /credentials/shop/manage

Issue / Card

Fixes #WD-3821

Help

QA steps - Commit guidelines

@webteam-app
Copy link

Demo starting at https://ubuntu-com-12868.demos.haus

@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

Merging #12868 (60168cd) into main (6733bbd) will decrease coverage by 0.11%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##             main   #12868      +/-   ##
==========================================
- Coverage   74.90%   74.80%   -0.11%     
==========================================
  Files         107      107              
  Lines        2873     2881       +8     
  Branches      928      936       +8     
==========================================
+ Hits         2152     2155       +3     
- Misses        699      704       +5     
  Partials       22       22              
Files Changed Coverage Δ
.../subscribe/checkout/components/Summary/Summary.tsx 79.68% <50.00%> (-6.03%) ⬇️

quantity: quantity,
};

const CredCheckout = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you duplicate the whole Checkout app? You should not do that.

Your credential shop should set the product data in the localstorage and reuse the checkout app. You needed a custom redirect and you added an extra parameter for that. That's all correct.
When you add that parameter you have to make sure on all other places the Checkout component is being used, those would still work.

What else is the Checkout missing that requires you to duplicate this whole logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not duplicating the Checkout here, I am duplicating the static/js/src/advantage/subscribe/checkout/app.tsx. app.tsx is not an exported component so it won't work outside your application, hence I have to duplicate it. The thing is that you are initializing the product in the base app itself but I have to do it in a separate checkout component which then references your original checkout component. I think the component could be renamed to something like CheckoutWrapper to avoid confusion.

Copy link
Contributor

@mrgnr mrgnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! 🚀

Copy link
Contributor

@albertkol albertkol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@abhigyanghosh30
Copy link
Contributor Author

Revoking the code and QA checks as specs for this have changed

@jpmartinspt
Copy link
Contributor

@abhigyanghosh30 can you please rebase?

@jpmartinspt
Copy link
Contributor

@abhigyanghosh30 prettier and linting are failing, can you fix that?

@abhigyanghosh30
Copy link
Contributor Author

Yes. But webhook responses have stopped working. Fixing that first

@abhigyanghosh30 abhigyanghosh30 requested review from albertkol and jpmartinspt and removed request for jpmartinspt July 24, 2023 07:36
@jpmartinspt
Copy link
Contributor

@abhigyanghosh30 check-prettier still red.

@abhigyanghosh30 abhigyanghosh30 merged commit e973f05 into canonical:main Jul 26, 2023
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants