#xfechx
1 messages · Page 1 of 1 (latest)
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.
- xfechx-connect-embedded, 22 minutes ago, 19 messages
Hey there
We can't re-open threads but happy to help you here if you summarize your issue/question.
Hi@ bismark
I am getting the following error: TypeError: Module name, '@stripe/connect-js' does not resolve to a valid URL
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
Hmm that seems like a specific WordPress wrapper
yes, it is already loaded in the page. I then do not know how to call the window
Are you calling loadConnectAndInitialize?
I don't see Connect JS loading there?
getting Uncaught Error: Call to a member function create() on null as a php error for $account_session = $stripe->accountSessions->create([
What version of the Stripe PHP library are you using?
how can I tell?
I haven't upgraded it in a while..
and how can I upgrade it? I have downloaded it with composer
What package is in your composer.lock?
"version": "v7.114.0",
Recommend you upgrade to latest. Account session wasn't added until 12.1.0
how do I update the current installation?
with composer
So can't you just change the version in your composer.json file?
OK, I've updated it
but still getting the same error
TypeError: Module name, '@stripe/connect-js' does not resolve to a valid URL.
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([```
Now I am not getting that error
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
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
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
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
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
ok, I am able to mitigate that error with this:
import { loadConnectAndInitialize } from "https://connect-js.stripe.com/v1.0/connect.js";
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
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
ok, getting somwhere now
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?
You can customize fonts, buttons, etc. using the Appearance object or other parameters like so: https://stripe.com/docs/connect/get-started-connect-embedded-components#customize-the-look-of-connect-embedded-components
For sizing, you need to work with the regular HTML/CSS on the element that contains the embedded Stripe Element (e.g the <div> that the embedded Connect element exists in)
what other modules can I use apart from payments?
I'm not sure I understand the question
yes, how can i show more info, and not only payments
const payments = stripeConnectInstance.create('payments');
What do you mean by show more info?
for example, also show payouts
Have you tried passing payouts as a parameter when creating the Account Session?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
is there any way to download receipts from the payments stripe connect component?
Hi, stepping in... No, we document the payments features here, https://stripe.com/docs/api/account_sessions/create#create_account_session-components-payments-features.
another question:
for the customer portal, how can I use it by passing the connected account id
You can use the on_behalf_of parameter, https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-on_behalf_of to specify only the subscriptions and invoices associated with the on_behalf_of account to appear in the portal.
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
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?
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
I see, that is not
how to display it, then?
This is not currently supported
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
...
This looks like it's our Express Dashboard, https://stripe.com/docs/connect/express-dashboard. If you use Express Connect, your connected accounts will have access to that.
how can I make a login link with php?
What have you tried?
Is this, https://stripe.com/docs/api/account/create_login_link not working for you?
Can you share more?
I highly recommend that you try these on your end and let me know if you get stuck by sharing the request id where you tried making the request. Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Fatal error: Uncaught Stripe\Exception\InvalidArgumentException: The resource ID cannot be null or whitespace. in
I am getting that errror
Can you share the request id with me?
Wherre exactly are you seeing this error? I do not understand what you mean here
in the php output error
Can you share what your code looks like along with a screenshot of where you see this error?
"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>';
}```
If you try making the request again, do you still see the same error?
yes
Can you pass the account id explicitely instead of $connected_account when creating the login link?