#videovillain_api

1 messages ยท Page 1 of 1 (latest)

vital ravineBOT
#

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

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

humble heath
#

hi there!

#

can you calrify what is the issue exactly? maybe an error message, or a screenshot of the issue?

split estuary
#

HI!

#

Okay, so, I have a process in my app where I send the user through the embedded process. That process works, it heads to the backend, does the accountsession, gives me the client_secret, and then the embedded page updates and I can follow the whole process

#

but then, when it's done, it just says, thanks for submitting, we'll look at it.

#

however, in the network i see that everything is actually completed

#

the account is finished, verified, can accept payments, can make charges, etc.

#

so... what am I missing that is amking it so the page doesn't update and allow me to continue letting the user do what I want to allow them to do?

vital ravineBOT
split estuary
#

here is the embeded code we are using:

<script setup lang="ts">
import { loadConnectAndInitialize } from "@stripe/connect-js";

// API call params
const uniqueKey = authStore.player.unique_key;
const sessionParams: AccountSessionsArgs = {
  country: "JP",
};
const linkParams: AccountLinkArgs = {
  country: "JP",
  account_type: "account_onboarding", // "account_onboarding" OR "account_update"
  refresh_url: `${import.meta.env.VITE_WEB_URL}/stripe-onboarding`,
  return_url: `${import.meta.env.VITE_WEB_URL}/${uniqueKey}/courses`,
};

const container = ref<HTMLElement | null>(null);

onMounted(async () => {
  const fetchClientSecret = async () => {
    try {
      const connectedAccount: AccountSession = await createAccountSessions(uniqueKey, sessionParams);
      document.querySelector("#error")?.setAttribute("hidden", "");
      return connectedAccount.client_secret;
    } catch (e) {
      console.error("An error occurred: ", e);
      document.querySelector("#error")?.removeAttribute("hidden");
      return undefined;
    }
  };

  const stripeConnectInstance = await loadConnectAndInitialize({
    publishableKey: `${import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY}`,
    fetchClientSecret
  });

  const accountOnboarding = stripeConnectInstance.create("account-onboarding");
  accountOnboarding.setOnExit(() => {
    console.log("User exited the onboarding flow");
    router.push({ path: `/${uniqueKey}/courses` });
  });

  if (container.value) {
    container.value.appendChild(accountOnboarding);
  }
});
</script>

some code we are using to help you understand.

#

It is a Vue/Ionic app

#

Sorry, left some text in the line so maybe you thought was typing, but i was done ๐Ÿ˜„

polar sluice
split estuary
#

but that process is finished, it isn't "in review" or anything

polar sluice
#

Hmm, this text doesn't look like it comes from Stripe.

split estuary
#

?

#

that's 100% from you guys

#

I cna't even adjust the css for that embedded item

polar sluice
#

So you do see the onboarding?

split estuary
#

after I finish verification, it starts the embedded part

#

yes, i finish it

#

but then it just sits there

#

is there not a formal completion like payments?

#

like, a redirect to a succeeded or something

#

or a link I provide so once it's done i can redirect them to where they can use the account or something else?

polar sluice
split estuary
#

yes, I see that

#
const accountOnboarding = stripeConnectInstance.create("account-onboarding");
accountOnboarding.setOnExit(() => {
  console.log("User exited the onboarding flow");
  router.push({ path: `/${uniqueKey}/courses` });
});
polar sluice
#

Are you being redirected then?

split estuary
#

no, I don't seem to be

#

because i'm stuck on that page i first sent

polar sluice
#

And you don't see the log?

#

What about this callback? setOnStepChange

split estuary
#

I didn't see it no.

#

I am trying agian now

#

Okay, the redirect worked this time

#

but it is to the next part so let me keep going

#

meaning, it is asking for additional information since the first check completed, i have to enter some sort of thing for Japan specific purposes

#

Okay, well..... it all worked beautifully this time! haha

#

I wonder if our backend was just slow to react when was first trying? anyway

#

seems to be fixed ๐Ÿ˜„

#

hmmmm

#

but it says i'm not ready for payments now

#

I made a test account

polar sluice
split estuary
#

and i returend true for charges

#

it*

#

how can I check my status for a connected account from the dashboard?

#

i'm logged in as the connected account now

#

and there are no pending notices about filling in information or missing data

polar sluice
split estuary
#

ourbackend checks it

public function canMakeCharges($stripe_account_id) {
        try {
            // Retrieve the Stripe account details
            $account = $this->stripe->accounts->retrieve($stripe_account_id);
            // Check if charges are enabled for the account
            return $account->charges_enabled;
        } catch (Exception $e) {
            // Handle other exceptions
            return false;
        }
    }
#

and i'm getting the exception for this account

polar sluice
#

Exception meaning the request failed?

split estuary
#

yes, this is the exception message:

This Stripe Connected Account Is Restricted.

#

that is our message, but it is only sent when the above is false

#

Is there a way to see my accounts object from the dashboard?

#

so I can make sure my charges_enabled is true and not false on your end?

#

then I can make sure it's our problem to deal with on the backend

#

Also, those connected accounts don't show up in our main Stripe Dashboard.

polar sluice
#

I understand you're getting a false returned from this method canMakeCharges.
Do you know if it's because $account->charges_enabled is false, or because an exception is thrown within the method?

polar sluice
split estuary
#

hmmm, when I do the embedding, you saw for yourself that it says PwR partners with Stripe

#

how could they not be connected to us?

polar sluice
#

Are you sure it's in the correct mode? Test/Live mode

#

In any case, please add a log to the method to print out any errors.

split estuary
#

I will! It's getting late. I got things moving a lot further than when we started, so that's a win! If I have more trouble in the future, I'll make a new thread for help. Thanks for all the help thus far!

polar sluice
#

Happy to help.

split estuary
#

give my thanks to soma too!

#

Oh!

#

sorry!

#

sort of unrelated

#

but, once I start something with stripe-js or connect-js, i forever see the
r.stripe.com/b and m.stripe.com/6 calls in my network tab... neverending

#

is there anything to be done about it?

polar sluice
#

That shouldn't be a problem. Stripe is collecting some data for analytics and fraud prevention.