#jin_code

1 messages ยท Page 1 of 1 (latest)

calm roseBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1300939292243263498

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

tidal veldt
tidal veldt
weak gate
#

Hi there

#

Can you share the error message that goes along with that 403 status code?

tidal veldt
# weak gate Can you share the error message that goes along with that 403 status code?

calling from preparePaymentSheet
URLSession.shared.dataTask
data Optional(2870 bytes)
response Optional(<NSHTTPURLResponse: 0x6000002443e0> { URL: https://www.openxverse.com/ } { Status Code: 403, Headers {
Connection = (
"keep-alive"
);
"Content-Length" = (
2870
);
"Content-Type" = (
"text/html; charset=utf-8"
);
"Cross-Origin-Opener-Policy" = (
"same-origin"
);
Date = (
"Tue, 29 Oct 2024 17:11:05 GMT"
);
"Referrer-Policy" = (
"same-origin"
);
Server = (
"nginx/1.24.0"
);
"X-Content-Type-Options" = (
nosniff
);
"X-Frame-Options" = (
DENY
);
} })
error nil

tidal veldt
weak gate
#

Just so I'm clear, is the 403 being returned when you make a request to backendCheckoutUrl (which is https://www.openxverse.com in this case, and not a Stripe endpoint)?

tidal veldt
#

{"paymentIntent": "pi_3QF5Rm05PIMIj7Fi0VfJqJGM_secret_iHRiWU4ph1zlWvKzGuTb1qhUW", "ephemeralKey": "ek_live_YWNjdF8xUThwS3IwNVBJTUlqN0ZpLE1WRUVtMmRYc1lKaEpPdTNWQUlHUllXUHNzb3Nqc00_00835ByQxA", "customer": "cus_R7K5OR2NOJOPVC", "publishableKey": "pk_live_51Q8pKr05PIMIj7FiXlWJbCvEGwU6RVTuFPnwaiCZMPboMkApIwO4SBtm8ePLTsBMLJyyFM7oRPNKeQrccK2LiR4l00OQlOULUs"}

weak gate
#

Okay, so yes, it looks like you have some Python code server side that is creating PaymentIntents

rich junco
#

Hi ๐Ÿ‘‹

I'm stepping in to offer some assistance, I hope that's okay

rich junco
#

Okay so you get a 403 when you are making the backendCheckoutUrl function call, correct?

tidal veldt
#

i get a 403 when I make an URLRequest to "backendCheckoutUrl"

rich junco
#

And you control the server side code operating at openxverse.com ?

rich junco
#

What is that code doing that is throwing the 403 error?

#

Looking at the payment intent you shared earlier, pi_3QF5Rm05PIMIj7Fi0VfJqJGM, it doesn't look like there is any attempt to update or confirm it after it's created. There isn't a log of a failing API request on our end

tidal veldt
#

i followed this guide for the server

#

it shows me how to create Payment Intent but not how to confirm or update

tidal veldt
rich junco
#

Unfortunately I don't know, it's your server so you will need to identify why you cannot make a request to it from your app

#

Why are you making that request? What is the purpose?

tidal veldt
#

the URLRequest is made to server so I can get a Stripe Payment Intent

rich junco
#

And that request is throwing the 403 error that says Forbidden?

rich junco
#

Unfortuantely that means there isn't anything we can help with. The error seems to be that your API request is not properly authenticated.

#

You should check with your server hosting provider about how you can configure your back-end to accept these requests

tidal veldt
# tidal veldt

so looking at this doc at the site below, on line 12 in the screenshot, why is "request.httpMethod = "POST" when I am trying to get Payment Intent from server?