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

feat(medusa): Update payment session management #2937

Merged
merged 26 commits into from
Jan 10, 2023

Conversation

adrien2p
Copy link
Member

@adrien2p adrien2p commented Jan 4, 2023

What

Update the session management in the cart checkout flow.

@changeset-bot
Copy link

changeset-bot bot commented Jan 4, 2023

🦋 Changeset detected

Latest commit: 7397483

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@medusajs/medusa Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@adrien2p adrien2p force-pushed the chore/cart-payment-sessions-handling branch from bb07143 to dd67f8b Compare January 4, 2023 11:30
packages/medusa/src/services/cart.ts Outdated Show resolved Hide resolved
packages/medusa/src/services/cart.ts Show resolved Hide resolved
packages/medusa/src/services/cart.ts Show resolved Hide resolved
packages/medusa/src/services/cart.ts Outdated Show resolved Hide resolved
packages/medusa/src/services/cart.ts Outdated Show resolved Hide resolved
@adrien2p adrien2p force-pushed the chore/cart-payment-sessions-handling branch 2 times, most recently from 9cf73b2 to ad0a1f3 Compare January 6, 2023 08:49
@adrien2p adrien2p marked this pull request as ready for review January 6, 2023 11:12
@adrien2p adrien2p requested a review from a team as a code owner January 6, 2023 11:12
@adrien2p
Copy link
Member Author

adrien2p commented Jan 6, 2023

I ll perform some tests through my scripts. We should also plan some tests on staging around this chore

@adrien2p
Copy link
Member Author

adrien2p commented Jan 6, 2023

Screenshot 2023-01-06 at 12 51 54

Screenshot 2023-01-06 at 12 52 14

From the tests, we can see that only one payment is created for the active session instead of one payment for each session no matter the one that the customer selects. We can also see that only once customer is created as well as one intent and this intent is updated twice, one for each cart manipulation post session selection

@adrien2p
Copy link
Member Author

adrien2p commented Jan 6, 2023

Screenshot 2023-01-06 at 12 55 19

Screenshot 2023-01-06 at 13 11 19

and one of the payment is cancelled when it is not selected anymore

@adrien2p
Copy link
Member Author

adrien2p commented Jan 6, 2023

/snapshot-this

@adrien2p
Copy link
Member Author

adrien2p commented Jan 6, 2023

I ll continue the test locally for now

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/medusa@1.7.3-snapshot-20230106120456
yarn add @medusajs/medusa-js@1.3.6-snapshot-20230106120456
yarn add @medusajs/stock-location@2.0.0-snapshot-20230106120456

Latest commit: 39c834e

@adrien2p
Copy link
Member Author

adrien2p commented Jan 6, 2023

/snapshot-this

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/medusa@1.7.3-snapshot-20230106122348
yarn add @medusajs/medusa-js@1.3.6-snapshot-20230106122348
yarn add @medusajs/stock-location@2.0.0-snapshot-20230106122348

Latest commit: 39c834e

@olivermrbl olivermrbl changed the title chore: Update cart payment session management feat(medusa): Update payment session management Jan 6, 2023
@chemicalkosek
Copy link
Contributor

chemicalkosek commented Jan 6, 2023

I've done some payment tests on this snapshot with multiple stripe providers. All went fine :)

@adrien2p adrien2p force-pushed the chore/cart-payment-sessions-handling branch from 9a08bac to 4eb68c9 Compare January 9, 2023 11:31
@adrien2p
Copy link
Member Author

adrien2p commented Jan 9, 2023

@olivermrbl for the existing payment session, I wanted to add a migration that set them as is_initiated if there have some data? What do you think? should I proceed?

@olivermrbl
Copy link
Contributor

@adrien2p Yes, I think that is an excellent idea 👍

@olivermrbl
Copy link
Contributor

Do you want to add it in this PR or a subsequent one?

@adrien2p
Copy link
Member Author

adrien2p commented Jan 9, 2023

Do you want to add it in this PR or a subsequent one?

I will add it in that one 👌e

@adrien2p adrien2p requested a review from olivermrbl January 9, 2023 13:59
@olivermrbl
Copy link
Contributor

@srindom Do you have any final comments before we merge?

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM, strong work! 🚀

@adrien2p adrien2p merged commit cac8174 into develop Jan 10, 2023
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.

4 participants