#jayvir_code

1 messages ยท Page 1 of 1 (latest)

soft owlBOT
#

๐Ÿ‘‹ 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.

vague rune
#

hi

#

link integration vs card is different ?

@timid loom

#

transfer_data: {
destination: connectedAccountId,
},
customer: customerId,
payment_method_types: ['link'],
on_behalf_of: connectedAccountId,

meaning

timid loom
#

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

soft owlBOT
vague rune
#

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,
timid lynx
#

Got some example request IDs (req_xxx) that highlight the difference? But specifiying p_m_t: ['link'] shouldn't influence that

vague rune
#

card:
pi_3RLO2oQ9z9PFZF260cL1AlHv

link:
py_1RNpebQ9z9PFZF26CLW093kb

@timid lynx

timid lynx
#
#

You're missing the Stripe-Account header from the last one

vague rune
#

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

#

You're missing the Stripe-Account header from the last one

i tried to add but it is getting failed in above example

timid lynx
#

What does 'getting failed' mean? What's the actual error

vague rune
#

400 bad request

timid lynx
#

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

vague rune
#

req_2QZgs15VIupdwX

@timid lynx

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

Save payment details on your platform and clone them to connected accounts for making direct charges.

vague rune
#

req_FvmCeEg1PZck8L

@timid lynx what is the issue in here ?

timid lynx
#

Did you read the error message returned?

vague rune
#

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

timid lynx
#

Sorry not clear what your question is

vague rune
#

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

timid lynx
#

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

vague rune
timid lynx
#

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

vague rune
#

what changes i should do ?

timid lynx
#

You'd need to create the Link PM on the connected account(s)

vague rune
#

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 ?

timid lynx
vague rune
#

can i use setupIntents & deduct the money using payment intent ?

possible right ?

using link & direct charges ?

timid lynx
#

Yep, you can use a 'direct charge' Setup Intent to save the payment details directly to the conncted account and then charge them later

vague rune
#

ok let me check & try
thanks @timid lynx

#

setup intent should of connected account not of platform ?

timid lynx
#

Yes, exactly

vague rune
#

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)

soft owlBOT
timid lynx
#

Yes, Apple Pay PMs can be cloned as they are type: 'card'

hollow cloud
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!