-
-
Notifications
You must be signed in to change notification settings - Fork 953
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
Removed shipping address & customer email from payment intent metadata #2366
Conversation
…ed with the stripe.paymentIntent.create() request. This is because Stripe express payments require a payment intent, but at the point of doing an express payment we may not have customer details (they are fetched from the payment resolver, such as Google/Apple pay.
✅ Deploy Preview for effervescent-donut-4977b2 canceled.
|
Hi, thanks for the detailed investigation and PR. I'm not understanding something about this though:
I don't see this in the changes to the PR. All I see is that you are removing the call to |
Hey Michael options.metadata() is deconstructed, generating the following pairs when an order has no customerEmail or shippingAddress attached: {
"customerEmail": "unknown",
"shippingAddress": "undefined undefined, undefined, undefined undefined, undefined",
} Removing the call you referred to should omit the key-value pairs above. The rest are hard-coded: {
channelToken: ctx.channel.token,
orderId: order.id,
orderCode: order.code,
} The unit tests don't check for shippingAddress, but they check for the customerEmail field, which is why I removed it from the checks to make the tests pass. |
What I'm not understanding is that by default, the |
Great Catch - Michael. I actually do define this metadata in Stripe's config when setting up (in vendure-config.ts). We can remove this and this should solve the issue without going with this change. Happy to discard the change if you think it's necessary to keep it. |
Thanks for the clarification. I'm gonna close this because I don't think it's the right direction for a solution. I've made another suggestion in the original issue. |
This should solve #2364
Removed shipping address and customer email from payment intent request metadata. This is because Stripe express payments require a payment intent, but at the point of doing an express payment we may not have customer details (they are fetched from the payment resolver, such as Google/Apple pay.