#valdozzz
1 messages · Page 1 of 1 (latest)
Hello
Hi there!
If the Connected Account is a Standard Connected Account then you could connect the platform to it just like it is connected to the platform. So then you could clone platform --> Connected Account. But this isn't possible with Express/Custom accounts.
i dont get it, sorry!
let me show you our use case:
- we use connect to onboard ecommerces
- we create a payment to make a purchase from customers of a the connected account
- we would like to clone the customer and his payment method to the platform account so when a customer tries to make a purchase with another ecommerce thats in out network we can simplify the payment
What type of Connected Accounts are you working with?
standard
Okay yeah what you want isn't really possible. What you should be doing instead is creating the PaymentMethod on your Platform and cloning it to the Connected Account each time you take a payment. Then you can share across accounts.
So really you need to change your flow.
ok i thought about this!
i'm trying to use stripe elements using nextjs, i wanna use only the CardElement so i can tokenize the card and save it to the platform. but im having a lot of issues due to CSP, i've tried following ofc the docs, but it really doesnt work
can i build a form without using stripe elements to let users type their cc info and then send the data directly to stripe tokenize endpoint?
No you need to use Elements otherwise you will be responsible for a high PCI burden as you will be handling sensitive data.
What issues are you running into exactly?
as i thought pt.2
let me show you
Content-Security-Policy: The page's settings blocked the loading of a resource at inline ("style-src"). i get this error, and doesnt show the CardElement, but if i try with the Address element, it reders properly
Can you show me your code for how you are creating and mounting your Card Element?
import {loadStripe} from '@stripe/stripe-js';
// Make sure to call `loadStripe` outside of a component’s render to avoid
// recreating the `Stripe` object on every render.
const stripePromise = loadStripe("pk_test_....");
function CheckoutPage({ checkout }: Response) {
return (
<>
<h1>TEST</h1>
<Elements stripe={stripePromise} options={{}}>
<CardElement />
{/* <Address Element options={{mode: 'shipping'}} /> */}
</Elements>
</>
);
}
here you go
Okay and have you checked your CSP config?
nextjs doesn come with default CSP configuration.
but i've also tried to add middleware.ts endpoint to add the CSP header but nothing!
what im noticing is that the code is being pushed into the html node tree
Can you see in your network requests what specifically is getting blocked and what the style-src directive in your CSP header was for that request?
And sorry, I'm not immediately following on what that HTML shows us. What should I be noticing?
sorry Pompey, i got some CSP errors in my console, and thought that where issues with the loading of stripe scripts! then i noticed that the stripe code was correctly injected, the only thing i didn't do was set the width and height of the CardElement component! by default it was a 0x0 box :/
Wow, that is a surprising cause of this error. Good catch
now i see this element! any way to make it look like as the following: https://docs.stripe.com/elements/appearance-api?platform=web
The card element doesn't support the Appearance API, but you can pass it a style object to change its appearance https://docs.stripe.com/js/appendix/style
oh damn so that element doesn inherit any of the "themes"
Correct, unfortunately not
any trick to get hte styles of the themes without copy pasting by hand?
Good question checking in to that
Unfortunately it is looking like it isn't possible at the moment. I can put in a feature request, but for now coordinating these will be manual if you are only specifying a theme.
Not sure if you have already considered it but you can use the payment element and specify that only cards can show in it. That way it will just render as simple card inputs with no tabs. The Payment Element does support the Appearance API.
the issue here is that i need to setup a payment intent in ordfer to use the payment elements right?
because the thing i need to do is:
let the custoemr tokenize his cc, then i save the custoemr and his payment method in my platform account, then i clone the customer and pm to the connected account, then i make a direct charge from the customer to the connected account
i explain my use case at the top of the conversation
Not true exactly. You could use a setupintent, which might be better for your usecase
And we do also support flows that let you tokenize before creating a SetupIntent (apologies for missing your question)
https://docs.stripe.com/payments/accept-a-payment-deferred
https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=web&type=setup