Open 420coupe opened 1 month ago
@420coupe can you let me know what the provider ID of the payment is? As you say, this should be pp_stripe_stripe
since you are using the standard credit card method.
@420coupe can you let me know what the provider ID of the payment is? As you say, this should be
pp_stripe_stripe
since you are using the standard credit card method.
provider id in the db is pp_stripe_stripe
I have also tried paymentElement vs CardElement and still getting the same results, two capture attempts and error matching coming back to the payment.webhook_received
also something else i just noticed while digging in the db, status is never updated from authorized
to capture
in payment_collections
nor payment_sessions
to add on this payment_session.data.status
is never updated either, not sure if this is handled by the stripe_webhook return since i've never got it working.
@420coupe did you manage to figure out what's causing this? Or a workaround? I have the same problem and the order remains with an outstanding amount, even if the payment shows as captured.
@420coupe did you manage to figure out what's causing this? Or a workaround? I have the same problem and the order remains with an outstanding amount, even if the payment shows as captured.
I did not, figured core team was on it from oliver responding.
I've targeted the problem, going to try some things and create a PR if successful.
The issue lies in this line of code (I think). For me, I changed it to this:
const providerId = `pp_${eventData.provider}_${eventData.provider.split("_")[0]}`;
And it works great. I forcefully changed the node_module
file to the above line to fix, so it is a temporary fix. I am unsure if this breaks other code as I have not been able to test it fully yet.
I think this line might be correct as payment provider's providerid is defined as `pp{identifier}_{id}, where
{id}is the provider's
idproperty in the
medusa-config.ts`.
See https://github.com/medusajs/medusa/blob/92bbd7953bf3413c649ad605960eac38dac6ee34/packages/core/utils/src/payment/abstract-payment-provider.ts#L113
I had similar issues today and I found out that you need to use the webhook AP Iroute localhost:9000/hooks/payment/stripe_stripe
when you use the default "card" stripe provder service.
I can confirm changing the webhook url to {medusaUrl}/hooks/payment/stripe_stripe
works fine 👌
I can confirm changing the webhook url to
{medusaUrl}/hooks/payment/stripe_stripe
works fine 👌
so even with changing webhook to this, still get this error below when it tries to process.
info: Processing payment.webhook_received which has 1 subscribers
error: An error occurred while processing payment.webhook_received: TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView, KeyObject, or CryptoKey. Received undefined
http: POST /hooks/payment/stripe_stripe ← - (200) - 4.817 ms
edit: also there's still two capture attempts i can see in the stripe logs, still want to know what's causing this to try to collect twice on the payment_intent
Bump to get a resolution for this.
Bug report
Describe the bug
The endpoint payment.webhook_received is failing to match payment provider with id pp_stripe. Order is still placed and considered successful, payment is captured in stripe however the webhook fails because it doesn't match pp_stripe to any provider.
System information
Medusa version (including plugins):
@medusajs/medusa@2.0.0-rc-20241003153304
Node.js version:v21.7.1
Database:Supabase (postgres)
Operating system:Ubuntu 22.04.4
Browser (if relevant):Steps to reproduce the behavior
packges/modules/payment/src/services/payment-provider
Expected behavior
Submit an order and correctly match to payment provider which i believe should be
pp_stripe_stripe
instead ofpp_stripe
Screenshots
Code snippets
medusa-config.js