#xfechx_api
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/1374758302088691883
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Yeah this is expected
Cross border payouts are only available to US platforms
Since your platform is AU based, you can only do destination charges (without on_behalf_of) to AU accounts
But not sure where exactly is on_behalf_of being used, so I am trying to pinpoint the exact API error. Because the platform also after checkout has an API instruction (webhook on invoice.payment_succeded OR charge.succeded) to make a transfer to a specific connected account, not sure if that is what is causing the error, or the original source transaction with the connected account.
on_behalf_of isn't being used. that's the issue
you need on_behalf_of if doing a destination charge to a country other than AU
where can I see what is been used, like which instructions are been sent to API.
In your code
Ah
Here's the checkout session creation request though for the example you shared: https://dashboard.stripe.com/logs/req_SNgYLfS2leyXBx
I have developed a LOT of stripe API stuff, including connect
but this time, it is 3rd party, so I want to know if it is my fault or 3rd party fault
Yeah the integration is not accounting for cross border issues
So it's whoever developed it
so, given this, if I wanted to patch it myself:
"cancel_url": "https://app.somamystica.com/?bkntc_stripe_split_status=cancel&bkntc_stripe_split_session_id={CHECKOUT_SESSION_ID}&tenant_id=68",
"line_items": {
"0": {
"price_data": {
"currency": "USD",
"product_data": {
"images": {
"0": "https://app.somamystica.com/wp-content/plugins/booknetic/app/Backend/Services/assets/images/no-photo.png"
},
"name": "Consult"
},
"unit_amount": "300"
},
"quantity": "1"
}
},
"metadata": {
"appointment_ids": "",
"payment_id": "c9dd747b1385f180730ba776bc61984d",
"type": ""
},
"mode": "payment",
"payment_intent_data": {
"application_fee_amount": "60",
"transfer_data": {
"destination": "acct_1RJW8kQYkxTHZCIU"
}
},
"payment_method_types": {
"0": "card"
},
"success_url": "https://app.somamystica.com/?bkntc_stripe_split_status=success&bkntc_stripe_split_session_id={CHECKOUT_SESSION_ID}&tenant_id=68"
}```
I would need to add on_behalf_of?
on the checkout session array
also, for me it would be best by doing a webhook, then I don't have to tamper with 3rd party code, is there a way of intercepting the checkout session BEFORE it is created, or just after it is created and modify for on_behalf_of ?
No there's not
This is something that needs to be set on creation
You'd need to reach out to the third party to get this corrected
found this in the code:
{
try
{
$checkout_session = $this->_stripeClient->checkout->sessions->create([
'payment_method_types' => ['card'],
'line_items' => $this->_items,
'mode' => 'payment',
'payment_intent_data' => [
'application_fee_amount' => $this->_fee['fee'],
'transfer_data' => [
'destination' => $this->_fee['destination'],
],
],
'success_url' => $this->_successURL,
'cancel_url' => $this->_cancelURL,
"metadata" => ['payment_id' => $this->_paymentId ,'type'=>$this->_type,'appointment_ids'=>$this->_appointmentIds]
]);
}
catch (ApiErrorException $e)
{
return 0;
}
return $checkout_session->id;
}```
what do I need to add here, to account for cross-border connected accounts
Oh so you do have access to the code?
You need to add a check to check the country of the connect account
Yes, it is open source
And if it's not AU (your platform country), you need to add on_behalf_of to settle funds in the connect account's country: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_intent_data-on_behalf_of
Can I just add on_behalf_of for every time no matter what account?
You can but you should understand the impact of doing that
What would the impact be? Thanks for your help
I think it should be fine, so on_behalf_of, the connected account takes more responsibility, correct?
I am looking where do I need to add on_behalf_of, and where in the code can I see the connected account id
Would you be able to help me with that snippet?
No platform still is responsible for disputes, etc
What do you need help with
I shared the doc
You just add it in payment_intent_data
Where in the snippet I shared, is that code using the connected account id?
transfer_data[destination] is how you specify the connect merchant for destination charges
can you help me see if this is ok?
'application_fee_amount' => $this->_fee['fee'],
'transfer_data' => [
'destination' => $this->_fee['destination'],
],
'on_behalf_of' => $this->_fee['destination'],
],```
I'm not familiar with the plugin code so idk where $this->_fee['destination'] comes from
That's up to you to trace
You're passing obo correctly in payment_intent_data at least
I know, but that is how transfer_data is been passed, and it receives the same data, correct? (the connected account id)