#jayvir_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1371424390561923103
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- jayvir_api, 2 days ago, 55 messages
- jayvir_code, 5 days ago, 45 messages
hi
link integration vs card is different ?
@timid loom
transfer_data: {
destination: connectedAccountId,
},
customer: customerId,
payment_method_types: ['link'],
on_behalf_of: connectedAccountId,
meaning
Hi
Can you please share more detals ?
If you are ask is whether you can use Link with destination charge or not, the answer is yes you can
example is that :
when i use stripe with card it using normal direct payment in connected account
but for link it is using destination charge for connected account
transfer_data: {
destination: connectedAccountId,
},
customer: customerId,
payment_method_types: ['link'],
on_behalf_of: connectedAccountId,
Got some example request IDs (req_xxx) that highlight the difference? But specifiying p_m_t: ['link'] shouldn't influence that
card:
pi_3RLO2oQ9z9PFZF260cL1AlHv
link:
py_1RNpebQ9z9PFZF26CLW093kb
@timid lynx
pi_3RLO2oQ9z9PFZF260cL1AlHvwas created as a direct charge: https://dashboard.stripe.com/test/logs/req_wqIqYjREt5bzGApy_1RNpebQ9z9PFZF26CLW093kbwas created as a destination charge: https://dashboard.stripe.com/test/logs/req_phn1XvGgqnWbGk
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You're missing the Stripe-Account header from the last one
https://dashboard.stripe.com/test/logs/req_phn1XvGgqnWbGk
static async StripeLinkRequestWithApplicationFee(
amount: any,
paymentId: any,
connectedAccountId: any,
secretKey: any,
serviceFee: any,
customerId: any,
metadata: any,
) {
try {
const data = {
amount: amount,
currency: 'usd',
confirm: true,
payment_method: paymentId,
metadata: metadata,
application_fee_amount: serviceFee,
transfer_data: {
destination: connectedAccountId,
},
customer: customerId,
payment_method_types: ['link'],
on_behalf_of: connectedAccountId, // โ
Ensures liability is on connected
};
let url = 'https://api.stripe.com/v1/payment_intents';
let apiCall = await axios({
method: 'post',
maxBodyLength: Infinity,
url: url,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: Bearer ${secretKey},
},
data: data,
});
let insuranceData = apiCall?.data || {};
return insuranceData;
} catch (error) {
console.log(error, 'StripeRequestWithApplicationFee');
return {};
}
}
it is link transaction
i want to pay using connected account
platform should get application fee
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You're missing the Stripe-Account header from the last one
i tried to add but it is getting failed in above example
What does 'getting failed' mean? What's the actual error
400 bad request
The actual error message, or just share the req_xxx ID
I suspect it's because you're passing paymentId which exists on a different acocunt
req_2QZgs15VIupdwX
@timid lynx
That won't work โ you're trying to 'clone' pm_1RNoykLKTM2K3idyIGZSM5F3 onto the connected account. You can't clone Link PMs to connected accounts:
You can clone only certain types of PaymentMethods. Cloning supports PaymentMethods that have type set to either card or us_bank_account.
https://docs.stripe.com/connect/direct-charges-multiple-accounts#clone-payment-method
req_FvmCeEg1PZck8L
@timid lynx what is the issue in here ?
Did you read the error message returned?
static async StripeLinkRequestWithApplicationFee(
amount: any,
paymentId: any,
connectedAccountId: any,
secretKey: any,
serviceFee: any,
customerId: any,
metadata: any,
) {
try {
const data = {
amount: amount,
currency: 'usd',
confirm: true,
payment_method: paymentId,
metadata: metadata,
application_fee_amount: serviceFee,
transfer_data: {
destination: connectedAccountId,
},
customer: customerId,
payment_method_types: ['link'],
on_behalf_of: connectedAccountId, // โ
Ensures liability is on connected
};
let url = 'https://api.stripe.com/v1/payment_intents';
let apiCall = await axios({
method: 'post',
maxBodyLength: Infinity,
url: url,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: Bearer ${secretKey},
},
data: data,
});
let insuranceData = apiCall?.data || {};
return insuranceData;
} catch (error) {
console.log(error, 'StripeRequestWithApplicationFee');
return {};
}
}
so it is only option to use link integration ?
link is always Destination Charge not direct Charge
i will direct charge for card
platform account should get application_fee_amount
refund or charge back should apply to connected
not platform by default
@timid lynx ignore all
read above message
lets start fresh
Sorry not clear what your question is
i want link integration in stripe ?
link is always Destination Charge not direct Charge ?
i use direct charge for card working fine
platform account should get application_fee_amount
refund or charge back should apply to connected
not platform by default
link is always Destination Charge not direct Charge ?
Not sure, no. Link can be used for direct charges
But you can't clone existing Link payment methodes between accounts
@timid lynx link meaning pay with link (third party)
not stripe payment link
I know, this: https://docs.stripe.com/payments/link
The problem you have is that the existing type: 'link' PM exists on your platform account. You want to clone it to a connected account to be used for a direct charge sub/payment but you can't clone it. The direct charge part is not the issue
what changes i should do ?
You'd need to create the Link PM on the connected account(s)
yes i got that
i wont clone the PM on the connected account
the setup intent is created in platform account
how to create direct charges for connected account ?
can i use setupIntents & deduct the money using payment intent ?
possible right ?
using link & direct charges ?
Yep, you can use a 'direct charge' Setup Intent to save the payment details directly to the conncted account and then charge them later
ok let me check & try
thanks @timid lynx
setup intent should of connected account not of platform ?
Yes, exactly
ok @timid lynx
so i cant clone link pm
card pm can be copied (current it is working as i need in flow )
apple pay pm can be copied ? (next todo for me after link)
Yes, Apple Pay PMs can be cloned as they are type: 'card'
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!