#smiley717
1 messages ยท Page 1 of 1 (latest)
Payment Links are supported with Connect: https://stripe.com/docs/connect/payment-links
You should test this out to inform you on how to work with different products. I'm not sure I understand your question
I just found this is similar case what I wanted to ask.
Did you read the docs I sent you?
Yep, I have already worked on stripe connect accounts for invoice feature, we can only use one stripe connect account at a time?
If products are coming from several vendors, then how can we map products to specific vendors? also wondering if we can set multi connect accounts on the code.
async function createPaymentLink() {
const params = {
line_items: [{price: '{PRICE_ID}', quantity: 1}],
payment_method_types: ['card'],
mode: 'payment',
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
};
// Set the Stripe version and account for this request
const requestOptions = {
stripeAccount: '{CONNECTED_STRIPE_ACCOUNT_ID}',
stripeVersion: '2020-08-27',
};
const paymentLink = await stripe.checkout.sessions.create(params, requestOptions);
return paymentLink;
}
If all products are from CONNECTED_STRIPE_ACCOUNT_ID, it works, but product1 is for CONNECTED_STRIPE_ACCOUNT_ID and product2 is for CONNECTED_STRIPE_ACCOUNT_ID2 , and then how can we handle this case?
Let's focus on one question at a time. What type of charge flow are your connect accounts using?
I need to implement once I confirm it.
I don't understand what you mean.
When customers make purchases from our platform, we prefer to directly charge the sellers deduct application fees,
const params = {
line_items: [{price: '{PRICE_ID}', quantity: 1}],
payment_method_types: ['card'],
mode: 'payment',
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
};
// Set the Stripe version and account for this request
const requestOptions = {
stripeAccount: '{CONNECTED_STRIPE_ACCOUNT_ID}',
stripeVersion: '2020-08-27',
};
const paymentLink = await stripe.checkout.sessions.create(params, requestOptions);
If I create paymentLink with above code, the payment will be directly sent to CONNECTED_STRIPE_ACCOUNT_ID instead of having our balance. right?
Correct
Lets assume that.
PRICE_ID -> CONNECTED_STRIPE_ACCOUNT_ID
PRICE_ID1 -> CONNECTED_STRIPE_ACCOUNT_ID1 (different supplier)
If products are from different suppliers, I need to determine where products come from and separate the payment as well.
For example, PRICE_ID means vegetable from Vendor 1 (connect account) and PRICE_ID1 means fruit form Vendor2. How can we automatically charge to connect accounts when user pay?
So you're using Stripe Checkout product to do that?
Yes, I am going to use it for now
So you would need to know the account's ID before you create the Checkout Session, right?
I have stored connect account id's for vendors on our database.
When I create payment link, I can get their account's IDs.
Okay, so if you know the account ID already, then what's the issue? Can't you simply store the price ID in your database alonside the Account ID?
personally think it's not possible, my question again like this....
// Set the Stripe version and account for this request
const requestOptions = {
stripeAccount: ['{CONNECTED_STRIPE_ACCOUNT_ID1}', '{CONNECTED_STRIPE_ACCOUNT_ID2}'],
stripeVersion: '2020-08-27',
};
You can't set the accounts like that
You would need to set the account at the request level
Not at the top level
I wanna send CONNECTED_STRIPE_ACCOUNT_ID1 for price1, and CONNECTED_STRIPE_ACCOUNT_ID2 for price2 just take out application feee.
I still don't understand what you're asking
You add an application fee to a Payment Link using this attribute: https://stripe.com/docs/api/payment_links/payment_links/create#create_payment_link-application_fee_amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You need to store the Price ID alongside the Account ID in your database if you want to be able to do a quick lookup and send both when you create the Payment LInk
As a marketplace platform, we are not only working with one vendor, multi vendors. my concern is how the payment is automatically separated to account ID by price Id.
price2 is not associated to CONNECTED_STRIPE_ACCOUNT_ID1 for example, it should be sent to CONNECTED_STRIPE_ACCOUNT_ID2
You could just create Price1 on Account1 and then later on create Price2 on Account2. It's really not as complicated as you seem to think it is
Ahhhhh, Yessss
๐ then I don't need to add CONNECT_STRIPE_ACCOUNT for creating payment link?
because there are two prices for two connects accounts for the link. not sure which connect_account_id used?
It makes sense to me
Again, you do need to pass the account header. And you do need to store the price id alongside the account id so that you can look them up when you create the payment link
I am so sorry for bothering you...
const params = {
line_items: [{price: '{PRICE_ID1}', quantity: 1}, {price: '{PRICE_ID2}', quantity: 1}],
};
const requestOptions = {
stripeAccount: '{CONNECTED_STRIPE_ACCOUNT_ID1}',
stripeVersion: '2020-08-27',
};
const paymentLink = await stripe.checkout.sessions.create(params, requestOptions);
Please see above code, Where do you think the payment go? CONNECTED_STRIPE_ACCOUNT_ID1
It's alright, I just think you may need more help than I can give you. Are you a web developer?
Yes
I love working with stripe payment gateway system for many websites, but always need to make sure it's working well.
@magic karma thank you for you time today and I do appreciate it. let me figure it out a little more and will get back to you once I try your approaches.
Sounds good. Best of luck