#RGRTHAT
1 messages ยท Page 1 of 1 (latest)
hi! it could be, it would depend. That's what the setup_future_usage parameter on PaymentIntents is for. When you say "Connect", what exact model of charging are you using? Direct or Destination charges for instance?
direct
u pay straight away with ur card
Currently i have had a seperate page where u can "setup" ur card
so you specifically mean you are implementing https://stripe.com/docs/connect/direct-charges where you use the Stripe-Account option to process a charge on a connected account?
yes
ok, further question. Do you want to save the card details on the connected merchant account, or on your platform account?
connected account i suppose
cuz if i have alot of connected accounts its easier to keep track of things
then you simply pass setup_future_usage when creating the PaymentIntent. https://stripe.com/docs/payments/save-during-payment covers this, it's the same thing, only difference for Connect is you would be passing Stripe-Account and an application_fee_amount as well for example.
I try do do clientside js stripe .confirmCardPayment('{PAYMENT_INTENT_CLIENT_SECRET}', { payment_method: { card: cardElement, }, }) but get error saying ```js
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'HTMLDivElement'
| property '__reactFiber$fdinkoi3ows' -> object with constructor 'FiberNode'
--- property 'stateNode' closes the circle
at JSON.stringify (<anonymous>)
I use this cardElement
import {
PaymentElement,
} from "@stripe/react-stripe-js";
maybe this cardElement is wrong for the .confirmCardPayment
it is yes. The PaymentElement component that you're importing there would be used with confirmPayment ( https://stripe.com/docs/js/payment_intents/confirm_payment ) not confirmCardPayment
either way there's no client side component to this, setup_future_usage is something you set on the server side
if you have a working client side integration for taking a payment on a connected account using Elements, nothing has to change on the frontend. You just pass setup_future_usage when creating the PaymentIntent.
I have now implemented a checkout where user can choose between using existing card or use another new card by entering card details
@charred arch so if I add "setup future usage": "off_session" as parameter on paymentIntent serverside, this will save a paymentMethod?
๐ taking over for my colleague. Let me catch up.
let paymentIntent = await stripe.paymentIntents.create(
{
customer: connected_account_customer_id,
setup_future_usage: "off_session",
},
{
stripeAccount: stripe_account_id,
}
);
will this save the paymentMethod?
currently i have saved a user paymentMethod using setupIntent
but i want to save the paymentMethod at first ever payment with a card
adding setup_future_usage as off_session tells Stripe to save the Payment Method you're collecting for this Payment Intent for future usage
just for this specific paymentIntent?
i need to be able to save the payment method at first ever payment with card, and then fetch the payment method l8r to see if a customer have an already existing payment method
so customer dont have to paste card details again
in this case the future usage is set to be off_session meaning that you can use the Payment Method to collect payments without having your customer in your website to authenticate the payment
this is what setup_future_usage is meant to do
it doesnt seem to have saved a payment method
i created a new account and did my first ever payment
the payment method is saved on the Connected Account
could you please share the Payment Intent ID?
i have created a hook that calls for all payment methods
but i see now that it only fetches the payment methods of customer and not payment methods of customer that is for the connect account
let me check when i add the connect account parameter
it should find the paymentmethod then
yes
is it possible to clone a platform customer to make the customer a connected account customer?
yes
current i create a connected account customer, but i need to fetch the connected account customer based on platform customer
wait what?
yeh but this uses the old token crap
in this case it's not a problem to use tokens
there are some cases where tokens are still the valid way to go
is it possible to create connect account using stripe.customers.create, but where u can specify platform "customer"
no not really
no unfortunately that's not possible
the issue i have is this:
how can I fetch connected customer based on platform customer
cuz i create the connected customer by using customer.create()
when i create the connected customer i dont create it based on platform customer
You would need to store that info on your backend somewhere, or on the metadata of either the platform or connected customer
We don't really save info like "cus_123 on the platform is cus_456 on this connected account", so you would need to keep track of that yourself in some way
in my webhook how can i listen for setupintent success?
i need to create a connected payment method from the platform payment method when setupintent is complete
what is the event name
setup_intent.succeeded https://site-admin.stripe.com/docs/api/events/types#event_types-setup_intent.succeeded
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.