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

Revert "fix: Use default channel in Stripe webhook calls to reach all orders" #3139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LeftoversTodayAppAdmin
Copy link

Reverts #3076

Issue: #3072

Hello!

Id like to reopen this issue because the above fix is causing issues when using default channel context to switch order state to ArrangingPayment but then using the channel specific context to add a payment method. If the bug is around being able to find the right order number from the correct channel, it should not be using this hack to get around it as it has other unintended consequences.

My scenario: In a multi-vendor marketplace where each store is its own channel the user is shopping within a channel and the cart is only showing items in that channel and only allows for checkouts within the context of that channel.

If the arranging payments part is done with the default context then when Vendure tries to apply the payment method it fails with this error: Error adding payment to order: ORDER_PAYMENT_STATE_ERROR. Doing everything with the channel specific context works correctly without any errors.

const paymentMethod = await this.getPaymentMethod(ctx);
            const addPaymentToOrderResult = await this.orderService.addPaymentToOrder(ctx, orderId, {
                method: paymentMethod.code,
                metadata: {
                    paymentIntentAmountReceived: paymentIntent.amount_received,
                    paymentIntentId: paymentIntent.id,
                },
            });
if (!(addPaymentToOrderResult instanceof core_2.Order)) {
                core_2.Logger.error(`Error adding payment to order ${orderCode}: ${addPaymentToOrderResult.message}`, constants_1.loggerCtx);
                return;
            }

Copy link

vercel bot commented Oct 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Oct 16, 2024 6:18am

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.

1 participant