#xfechx

1 messages · Page 1 of 1 (latest)

willow tartanBOT
#

Hello! We'll be with you shortly. 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.

near nest
#

Hey there

#

We can't re-open threads but happy to help you here if you summarize your issue/question.

midnight hatch
#

Hi@ bismark

#

I am getting the following error: TypeError: Module name, '@stripe/connect-js' does not resolve to a valid URL

near nest
#

Hmm

#

How are you loading Connect JS?

midnight hatch
#

without npm

#

in wordpress

#
  wp_register_script('stripe_connect_embedded_components', 'https://connect-js.stripe.com/v1.0/connect.js', '', '', array('async'));
  wp_enqueue_script('stripe_connect_embedded_components');
}
add_action( 'wp_enqueue_scripts', 'enqueue_stripe_connect_components' );```
#

I can see that connect.js is loaded properly

near nest
#

Hmm that seems like a specific WordPress wrapper

midnight hatch
#

yes, it is already loaded in the page. I then do not know how to call the window

near nest
#

Are you calling loadConnectAndInitialize?

near nest
#

I don't see Connect JS loading there?

midnight hatch
#

getting Uncaught Error: Call to a member function create() on null as a php error for $account_session = $stripe->accountSessions->create([

near nest
#

What version of the Stripe PHP library are you using?

midnight hatch
#

how can I tell?

#

I haven't upgraded it in a while..

#

and how can I upgrade it? I have downloaded it with composer

near nest
#

What package is in your composer.lock?

willow tartanBOT
midnight hatch
#

"version": "v7.114.0",

zealous girder
#

Recommend you upgrade to latest. Account session wasn't added until 12.1.0

midnight hatch
#

how do I update the current installation?

zealous girder
#

I'm not familiar with your infra

#

How did you install it

midnight hatch
#

with composer

zealous girder
#

So can't you just change the version in your composer.json file?

midnight hatch
#

I don't know how to do that, sorry

#

can you help me?

zealous girder
#

php composer.phar update monolog/monolog [...]```
midnight hatch
#

OK, I've updated it

#

but still getting the same error

#

TypeError: Module name, '@stripe/connect-js' does not resolve to a valid URL.

zealous girder
#

That's a different error, no?

#

You had before:

Uncaught Error: Call to a member function create() on null 
 as a php error for $account_session = $stripe->accountSessions->create([```
midnight hatch
#

Now I am not getting that error

zealous girder
#

Ok so the package update resolved that issue

#

That's a client-side error

#

Can you share your code for loading connect-js

#

If you're not using npm, you're likely referring to the module wrong

midnight hatch
#

yes, I am not using npm. How can I refer to the module?

zealous girder
#

I'm not familiar with wordpress. How is it loaded then if not npm?

#
  wp_register_script('stripe_connect_embedded_components', 'https://connect-js.stripe.com/v1.0/connect.js', '', '', array('async'));
  wp_enqueue_script('stripe_connect_embedded_components');
}
add_action( 'wp_enqueue_scripts', 'enqueue_stripe_connect_components' );```
That's all wordpress specific functions
#

So you need to research how to import a script after loading it with the above wordpress functions (ie wp_register_script and wp_enqueue_script)

#

We can't give wordpress support

midnight hatch
#

so the file connect.js

#

is imported properly in the page

zealous girder
#

No it's imported improperly

#

That's why you're getting an error

#

Like do those wordpress functions already import the script and make it available?

#

I'm not a wordpress dev so idk how that works

midnight hatch
#

yes they make the file custom.js available to the page

#

but then I am not sure if in the code I am calling it properly

#

inside the js code

zealous girder
#

You're not

#

That's why there's an error

#

Again, not a wordpress dev

#

So you need to look into how to refer to scripts in your client side code after loading them via wp_register_script/wp_enqueue_script

willow tartanBOT
midnight hatch
#

ok, I am able to mitigate that error with this:

#

but I am now getting Failed to load resource: Origin https://app.somamystica.org is not allowed by Access-Control-Allow-Origin. Status code: 200

austere burrow
#

Hi there 👋 taking over, as my colleague needs to step away

I don't think we are the right people to be working to help fix this. As mentioned, it looks like you need to look into how to refer to client-side scripts through wordpress, but we're Stripe devs

midnight hatch
#

ok, getting somwhere now

midnight hatch
#

I can see the viewport now

#

with all info, but without background and 100% width of the page. How can I give it some style?

austere burrow
midnight hatch
#

what other modules can I use apart from payments?

austere burrow
#

I'm not sure I understand the question

midnight hatch
#

yes, how can i show more info, and not only payments

#

const payments = stripeConnectInstance.create('payments');

austere burrow
#

What do you mean by show more info?

midnight hatch
#

for example, also show payouts

austere burrow
willow tartanBOT
midnight hatch
#

is there any way to download receipts from the payments stripe connect component?

neon gazelle
midnight hatch
#

another question:
for the customer portal, how can I use it by passing the connected account id

neon gazelle
midnight hatch
#

where can I find instructions to display a window like this one

#

within my app, like pressing a button and showing that for a connected account

neon gazelle
#

I do not understand what you're asking here, can you elaborate a bit more? Are you asking if you can use Connect Embedded components to surface this payment processing graph?

midnight hatch
#

yes, i am wondering if this ui is something that I can just call from within my website/app

#

by passing the credentials, and connect id

neon gazelle
#

I see, that is not

midnight hatch
#

how to display it, then?

neon gazelle
#

This is not currently supported

midnight hatch
#

but I found this popup on another app

#

which has a button that pops up that window. I am wondering how that was made?

#

it is using a stripe url

#

...

neon gazelle
midnight hatch
#

how can I make a login link with php?

neon gazelle
#

What have you tried?

#

Can you share more?

midnight hatch
#

Fatal error: Uncaught Stripe\Exception\InvalidArgumentException: The resource ID cannot be null or whitespace. in

#

I am getting that errror

neon gazelle
#

Can you share the request id with me?

midnight hatch
#

I get the link in the logs

#

but in php I got an error...?

neon gazelle
#

Wherre exactly are you seeing this error? I do not understand what you mean here

midnight hatch
#

in the php output error

neon gazelle
#

Can you share what your code looks like along with a screenshot of where you see this error?

midnight hatch
#
"error":"The resource ID cannot be null or whitespace."```
#
  include('stripe.php');
  global $current_user;
  $connected_account = get_user_meta($current_user->ID, 'stripe_user_id', true);
  $stripe = new \Stripe\StripeClient($secret_key);
  try{
    $login_link = $stripe->accounts->createLoginLink($connected_account, []);
  } catch (Exception $e) {
    error_log("An error occurred when calling the Stripe API to create an account session: {$e->getMessage()}");
    http_response_code(500);
    echo json_encode(['error' => $e->getMessage()]);
  }

  echo'
  <a href="'.$login_link->url.'">Stripe Express Dashboard</a>';
  
}```
neon gazelle
#

If you try making the request again, do you still see the same error?

midnight hatch
#

yes

neon gazelle
#

Can you pass the account id explicitely instead of $connected_account when creating the login link?