#deepumi_api

1 messages ¡ Page 1 of 1 (latest)

honest mulchBOT
maiden mossBOT
#

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.

honest mulchBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1253499161131614300

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

sand terrace
fading cave
#

This is the json I post to Stripe using PaymentIntent API.
{
"expand": [
"latest_charge"
],
"description": "Re-Elect Chito Vela",
"metadata": {
"donationType": "OneTimeCharge",
"donorId": "194625",
"x-dwy-id": "cc15b5fe-e6d7-44fc-9025-32939dc3d529"
},
"application_fee_amount": "53",
"transfer_data": {
"destination": "acct_1OK4gCJgmkdYjuX9"
},
"currency": "usd",
"off_session": "true",
"payment_method_data": {
"type": "card",
"card": {
"token": "tok_1PTsVwIcWSSPnlgrZMECsRVv"
}
},
"confirm": "true",
"amount": "2500",
"payment_method_types": [
"card"
]
}

#

Are there any specific json parameter I am missing, Sorry to say that, we lost almost $4000.00 due to this, and platform account is having negative amount...

sand terrace
fading cave
#

Using PaymentIntent API can I do the direct charges?

sand terrace
#

Yes, you'd want to follow the above document and use the Stripe Account Header

fading cave
#

I am sending destination account as shown in the JSON above.

#

"transfer_data": {
"destination": "acct_1OK4gCJgmkdYjuX9"
},

sand terrace
#

Yes, that is what the document I shared uses.

fading cave
#

but how to say which parameter to Split the fees

sand terrace
#

Your current flow is called a Destination Charge, and the payments belong to the Platform Account.

fading cave
#

I mean take the fees from the connected account (all the fees)

#

okay, I see

sand terrace
#

If you use Direct Charges, those would belong to your Connected Account and the fees will be deducted from those accounts.

fading cave
#

Do you have a sample JSON how it might look on your side? or what changes to make it from the above JSON to make it happen?

sand terrace
#

const paymentIntent = await stripe.paymentIntents.create(
{
amount: 1000,
currency: 'usd',
automatic_payment_methods: {
enabled: true,
},
application_fee_amount: 123,
},
{
stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
}
);

fading cave
#

I see that the CURL code.
curl https://api.stripe.com/v1/checkout/sessions
-u "sk_test_u7EPXn2YDSrs1gUI29kaC67Z:"
-H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}"
-d "line_items[0][price_data][currency]"=usd
-d "line_items[0][price_data][product_data][name]"=T-shirt
-d "line_items[0][price_data][unit_amount]"=1000
-d "line_items[0][quantity]"=1
-d "payment_intent_data[application_fee_amount]"=123
-d mode=payment
--data-urlencode success_url="https://example.com/success?session_id={CHECKOUT_SESSION_ID}"

sand terrace
#

With Direct Charges, you can take an application fee.

#

That is the example for Checkout

fading cave
#

Would this work then?
curl https://api.stripe.com/v1/payment_intents
-u "sk_test_u7EPXn2YDSrs1gUI29kaC67Z:"
-H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}"
-d amount=1000
-d currency=usd
-d "automatic_payment_methods[enabled]"=true
-d application_fee_amount=123

sand terrace
#

Yes!

fading cave
#

Could you please confirm weather the equivalent of full fees including application_fee + stripe fee taking from Connected account correct?

#

okay I will make the code change to do the above.

#

thank you so much.

#

just to confirm

sand terrace
fading cave
#

the token capturing request is all good right for ex; the request id for capturing token is "
req_FOKeFuRH57ZAiW"

sand terrace
#

Please test these in test mode and confirm that is what you want.

fading cave
#

yes, this is wat we used to do from many years, it was my mistake that I have not checked after pushing this code a month or so

#

thank you so much..

#

One last question, sorry

sand terrace
fading cave
#

where is the card token passing in this payment_intent_api

sand terrace
#

Or else, you would see an error whna attenpting to use it

fading cave
#

customer already linked their account with the platform, so what other token we are talking about?

#

could you explain please..

sand terrace
#

Also, you would want to use Stripe Elements on the client side to collect payment method details

#

On req_FOKeFuRH57ZAiW"

fading cave
#

we don't use the Stripe Element or Stripe UI to collect payment.

#

we use our own form and back end code use the STripe API to process the transaction

sand terrace
#

You should as it is compliant

#

I see!

fading cave
#

yea, its almost 9 year or so, everything was good, after I switched recently to use the new Payment Intent API and I screwed up

#

we prefer custom flow

#

Do you know when we use the custom flow, we will create the card token as the first step.
And the second request to the payment API

#

Card token API looks good to me, But the Payment API, I want to know how I can pass the card token

sand terrace
#

So you can use these on your Connected Account

fading cave
#

So I need to use PaymentMethods API instead of PaymentIntent API is that correct?

sand terrace
#

No!

#

You would want to use them together

#

I recommend you review the above documents carefully and test the flow first

fading cave
#

okay, let me go over the flow first.. thank you

sand terrace
#

Sure!

fading cave
#

Thank you so much