#Error was thrown trying to authorize payment session - payses_01JRANVCQD16TNEXWED6WWBDTN -

7 messages · Page 1 of 1 (latest)

fierce bear
#

I keep getting this error from the server when the storefront successfully completes payment using a third party payment gateway (**paystack **as the payment provider). The storefront doesn't redirect to the order placed page after making payment successfully. I don't receive an order on the admin dashboard. The payment provider just makes a pop up for the payment and when successful, nothing happens. When I check the server, I get the error - (Error: Session: payses_01JRANVCQD16TNEXWED6WWBDTN was not authorized with the provider.)

Does this issue require me to deploy the site first and connect the webhook before it works?
How do you authorize payment in development mode?

hoary ore
fierce bear
hoary ore
# fierce bear I haven't setted up webhook yet as that will require me to deploy the applicatio...

Hey, you can test out the web hook locally with something like https://ngrok.com/.

From your original message, i assume you're sending the user to a different payment page (paystack)? If so, you would likely need the webhook to send an event when payment is completed/authorized, etc.

" (Error: Session: payses_01JRANVCQD16TNEXWED6WWBDTN was not authorized with the provider.)", based on this message, i'm guessing there is a disconnect between when a user completes payment details, and the communication back to medusa .

ngrok simplifies app delivery by unifying API gateway, Kubernetes Ingress, global load balancing, DDoS protection and more with secure tunnels.

fierce bear
hoary ore
#

@fierce bear getWebhookActionAndData (https://docs.medusajs.com/resources/references/payment/provider). This method in your payment provider receives the webhook after 3rd party payment completion.

Are you successfully receiving the webhook, once payment is captured/authorized?

You will need to return captured or authorized in getWebhookActionAndData,

fierce bear
#

Yes @hoary ore , I received the webhook once payment is captured. Unfortunately, I'm not very good in coding, I came across medusa to build an ecommerce website, and it's been 5 days. I do have a bit of knowledge in coding and since medusa (as I was told is pre-built and not having much extra work), I wanted to try it out. Little did I not it will be very challenging.
I am actively trying to understand the documentation so I could use it effectively.

However, I get this errors:
PS_P_Debug: AuthorizePayment: Error Error: Error from Paystack API with status code 400: Transaction reference not found.
at Paystack.requestPaystackAPI (C:\Users\clisp\Desktop\medusa\new-store\new\node_modules\medusa-payment-paystack\dist\lib\paystack.js:74:23) ............................................................................................................................................
.......................................................................................................................................................................long file references..........
error: Error was thrown trying to authorize payment session - payses_01JRJRC10Y03JED73S5CP9F5WS - Error: Session: payses_01JRJRC10Y03JED73S5CP9F5WS was not authorized with the provider.