#z3ntl3_checkout-embedded

1 messages ยท Page 1 of 1 (latest)

gentle bluffBOT
#

๐Ÿ‘‹ 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/1263172555250995345

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

soft vergeBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

clever wigeon
#

injected iframe but i dont see anything

#

it gave me this errro

#

nd im ngrok tunneling

signal yacht
#

@clever wigeon yeah the bug is on Google's end as far as I know. And that warning is there all the time you can ignore it

#

So really we should focus on what the exact issue is I think

clever wigeon
#

normally it should render embedded checkout form but it didnt even tho i see an injected iframe in my html

#

can u pls help

signal yacht
#

z3ntl3_checkout-embedded

#

I can try for sure. I need more than just pictures though, especially of code.
Did this work before and stop working? Is this your first time? Can you give me an exact Checkout Session id that you created on the server?

clever wigeon
#

i had set the same thing up previously without anything going wrong, this time it did nothing

#

i can show some code

#

so creating a checkout session, and adding the secret to sid qs

signal yacht
#

please don't share pictures of code

clever wigeon
#

then using that

signal yacht
#

please read my messages

clever wigeon
#
    ctx.Redirect(
        302, 
        fmt.Sprintf(
            "%s/betaling/?sid=%s", 
            viper.GetString("FRONTEND"), 
            base64.StdEncoding.EncodeToString([]byte(sess.ClientSecret)),
        ),
    )
signal yacht
#

Okay why are you creating then redirecting to embed instead of loading the page and then retrieving the client_secret?

clever wigeon
#
 <!-- main container -->
    <div
      x-data
      :class='{"hidden": !$store.loaded, "block": $store.loaded}'
      class="hidden container-fluid mx-auto"
      id="checkout"
    >
    </div>
    <script>
      var stripe
      
      const init = async () => {
        let {data} = await axios({
          method: "GET",
          url: BASE_URL + "/api/accountid"
        })
        
        stripe = Stripe("pk_test_51MnMLLHwRrNToxWzG0B8XOXYaKLah6NCQfNLj7uUeqGsvoC2GFqtKWSNi3CxfASB7CqBxnW8HWGT3nXAMukzTei800xhCVOE4b", {
          stripeAccount: data.data,
        })
        let sid = new URL(window.location.href).searchParams.get("sid")
        
        const checkout = await stripe.initEmbeddedCheckout({
            clientSecret: atob(sid),
        });

        checkout.mount('#checkout');
      }

      init()
    </script>
signal yacht
#

I've never seen anyone do something like this before

clever wigeon
#

thats why

signal yacht
#

Also what is clientSecret: atob(sid), and why are you doing this? It feels likely that's the issue honestly because you change the format.

Can you try hardcoding a client secret there to see if that works?

clever wigeon
#

oke

#

still didnt work

#

s_test_a1gyO3B2GJa7rNwv35EXahGJPCoVlmHJw2CocW5COKTYjY3ctdwsgTP4aN_secret_fidwbEhqYWAnPydgaGdgYWFgYScpJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ3dgYWx3YGZxSmtGamh1aWBxbGprJz8nZGlyZHx2JyknZ2RmbmJ3anBrYUZqaWp3Jz8nJjRjNzw2Mid4JSUl

#

it injects btw

#

but i dont seee any iframe

signal yacht
#

You have an invalid character somewhere here though

#

ah you're just missing the leading c did you do a bad copy-paste?

signal yacht
#

oh gotcha, glad you figured it out, would have taken me a while to find it

clever wigeon
#

ye and sorry just one more question

#

i got this too

#

but the color is like dark grey

#

instead oft his

signal yacht
#

your love the pictures lol

clever wigeon
#

#051139

signal yacht
#

Sorry can you share more specific details? I got a picture of a few lines of code with no context. When did you create that account? Where did you set the settings? I see you use Standard accounts which means the connected account can make whatever changes they want in the Dashboard too which might have happened.
But looking

clever wigeon
#

i looked a bit in my code and i see that my update api req on connected account branding doesnt allow binding another FILE to more than one objects or something

#

so i need to create a new file on stirpe api every time and cant use the same one?

#
[ERROR] Request error from Stripe (status 400): {"status":400,"message":"That file is already attached to something else.","param":"settings[branding][logo]","request_id":"req_jrwzIy5117kYw0","request_log_url":"https://dashboard.stripe.com/acct_1PNWUvQnBUYiXKHE/test/logs/req_jrwzIy5117kYw0?t=1721235222","type":"invalid_request_error"}
not updated
#

so why i need to make new files if one already exists (for the same purpose too)

signal yacht
#

The File ids are one-time use so yes you would upload each time

clever wigeon
#

sad, bcs redundant but ye i made that list iterator that prevents creating double files for nothing

#

that fixed now color changed

#

anyways thnx for the help u can close the ticket