feat(core-flows,types): pass cart in create payment session context#12694
feat(core-flows,types): pass cart in create payment session context#12694shahednasser wants to merge 7 commits intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
8 Skipped Deployments
|
🦋 Changeset detectedLatest commit: 3babaaa The changes in this PR will be included in the next version bump. This PR includes changesets to release 77 packages
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 |
|
/snapshot-this |
🚀 A snapshot release has been made for this PRTest the snapshots by updating your yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add [email protected]yarn add @medusajs/[email protected]yarn add [email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]yarn add @medusajs/[email protected]
|
packages/core/core-flows/src/payment-collection/workflows/create-payment-session.ts
Show resolved
Hide resolved
packages/core/core-flows/src/payment-collection/workflows/create-payment-session.ts
Show resolved
Hide resolved
| "amount", | ||
| "currency_code", | ||
| "payment_sessions.*", | ||
| "cart.id", |
There was a problem hiding this comment.
thought: If I am not mistaken, this workflow can also be used to create payment sessions for orders. I wonder if we should reconsider the approach here to account for this?
One idea that comes to mind would be to:
- Allow passing
cart_idandorder_idto the workflow - Fetch the data based on which of these was passed
- Pass
cart_or_orderin the context passed to the provider
Not loving it, but this was the first approach that came to mind, so mainly sharing to start the discussion.
There was a problem hiding this comment.
I think that makes sense, but maybe we can have separate cart and order properties in the context? They're both optional, so we don't guarantee they're passed anyway and that would allow us to account for other use cases in the future.
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
@olivermrbl let me know what we should do about this one |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR was closed because it has been stalled for 5 days with no activity. |
|
After an initial review, this PR looks good to us. Here's a summary: ✅ Changeset included with correct format Notes:
A team member will do a final review before this is merged. |
Some payment providers requires details related to the cart, such as its items and totals. This PR passes the cart information in the create payment session context