#jin_code
1 messages ยท Page 1 of 1 (latest)
๐ 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.
my client side 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
hi thanks for your reply. error message from console output is posted
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)?
"backendCheckoutUrl" is my "stipe endpoint" i suppose?
{"paymentIntent": "pi_3QF5Rm05PIMIj7Fi0VfJqJGM_secret_iHRiWU4ph1zlWvKzGuTb1qhUW", "ephemeralKey": "ek_live_YWNjdF8xUThwS3IwNVBJTUlqN0ZpLE1WRUVtMmRYc1lKaEpPdTNWQUlHUllXUHNzb3Nqc00_00835ByQxA", "customer": "cus_R7K5OR2NOJOPVC", "publishableKey": "pk_live_51Q8pKr05PIMIj7FiXlWJbCvEGwU6RVTuFPnwaiCZMPboMkApIwO4SBtm8ePLTsBMLJyyFM7oRPNKeQrccK2LiR4l00OQlOULUs"}
Okay, so yes, it looks like you have some Python code server side that is creating PaymentIntents
yes
Hi ๐
I'm stepping in to offer some assistance, I hope that's okay
hi yes appreciate it
Okay so you get a 403 when you are making the backendCheckoutUrl function call, correct?
i get a 403 when I make an URLRequest to "backendCheckoutUrl"
"backendCheckoutUrl" is openxverse.com
And you control the server side code operating at openxverse.com ?
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
how do i update or confirm paymentIntent after it's created?
i followed this guide for the server
it shows me how to create Payment Intent but not how to confirm or update
403 forbidden means the client side don't have permission to access the server? Is there something wrong with my clientside code posted?
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?
the URLRequest is made to server so I can get a Stripe Payment Intent
And that request is throwing the 403 error that says Forbidden?
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
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?