-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(core-flows,types): pass cart in create payment session context #12694
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
Changes from all commits
5e5e246
f7d19ec
5c4f693
da523a5
e95b9a7
83b6e12
3babaaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@medusajs/core-flows": patch | ||
| "@medusajs/types": patch | ||
| --- | ||
|
|
||
| feat(core-flows,types): pass cart in create payment session context |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,7 +77,28 @@ export const createPaymentSessionsWorkflow = createWorkflow( | |
| ): WorkflowResponse<PaymentSessionDTO> => { | ||
| const paymentCollection = useRemoteQueryStep({ | ||
| entry_point: "payment_collection", | ||
| fields: ["id", "amount", "currency_code", "payment_sessions.*"], | ||
| fields: [ | ||
| "id", | ||
| "amount", | ||
| "currency_code", | ||
| "payment_sessions.*", | ||
| "cart.id", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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:
Not loving it, but this was the first approach that came to mind, so mainly sharing to start the discussion.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that makes sense, but maybe we can have separate |
||
| "cart.currency_code", | ||
| "cart.items.*", | ||
shahednasser marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "cart.items.tax_lines.*", | ||
| "cart.total", | ||
| "cart.subtotal", | ||
| "cart.tax_total", | ||
| "cart.discount_total", | ||
| "cart.discount_tax_total", | ||
| "cart.gift_card_total", | ||
| "cart.gift_card_tax_total", | ||
| "cart.shipping_total", | ||
| "cart.shipping_subtotal", | ||
| "cart.shipping_tax_total", | ||
| "cart.item_total", | ||
| "cart.item_subtotal", | ||
| ], | ||
| variables: { id: input.payment_collection_id }, | ||
| list: false, | ||
| }).config({ name: "get-payment-collection" }) | ||
|
|
@@ -175,6 +196,7 @@ export const createPaymentSessionsWorkflow = createWorkflow( | |
| ...data.input.context, | ||
| customer: data.paymentCustomer, | ||
| account_holder: data.accountHolder, | ||
| cart: data.paymentCollection.cart, | ||
| }, | ||
| amount: data.paymentCollection.amount, | ||
| currency_code: data.paymentCollection.currency_code, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.