#bmark
1 messages ยท Page 1 of 1 (latest)
Hi, let's expand its transfer first: https://stripe.com/docs/api/charges/object?lang=ruby#charge_object-transfer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Then inside Transfer find the source_transaction https://stripe.com/docs/api/transfers/object?lang=ruby#transfer_object-source_transaction
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 would want to call Retrieve Charge API on that py_ object and use expand: https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I don't appear to have access to that charge id
One thing I should mention - this is all being done via the Stripe webhook listener on the payment.created event
A bit confused, you received the webhook event but don't have secret key of that Stripe Account?
That's correct, I don't see the client secret key in the response payload
the secret key is not in any response payload. It's on Dashboard if you have access to
You can't call APIs without the secret key
Currently, I'm using Connect with Checkout and setting up the webhook listener on a few events - one of the events payment.created is being listened to because I need the id value that is prefixed with py_ to be saved in my db
So you are the Platform right?
You can use your own secret key and the Stripe Account header
Yes I'm the platform, let me try that
Just to confirm, I should be making this call, correct?
Stripe::Charge.retrieve({
id: "py_REST_OFPAYMENT_ID",
expand: ['customer', 'invoice.subscription'],
})
yes, but use the Stripe Account header: https://stripe.com/docs/connect/authentication
Aha that worked!
I also just realized I had mistakenly used a Custom account in test mode, but am supposed to be using Standard accounts (and will be making this change)
Is there anything I should know in advance that may be different?
Regarding the Stripe Account header, no. A bit concern about the fund flow, since Express/Custom goes with Destination Charge/Separate Charges and Transfers which generates the py_ object, but Standard Account should go with Direct Charge, which doesn't generate the py_ object AFAIK
We're using StripeCheckout for the payment rather than destination or direct charges
Checkout can have destination / direct charges parameters. Can you give an example of Checkout Session Id? cs_test_xxx
Is there an easy way to find that on the Stripe dashboard once the payment has already been created?
If it's more useful, I can go through a new checkout process and grab the id at time of creation
Best way is to look at the request created the Checkout Session, ie if if has parameters like: https://stripe.com/docs/api/checkout/sessions/create?lang=ruby#create_checkout_session-payment_intent_data-transfer_data-destination
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok 1 min
Yesp would be easy to look at a specific ID
Here you go: cs_test_b1WjXkUGnoP9vUxBWJpq4hFHEEzt0jUppfhw9vMv0z1u7Lwxl3D4knjAvy
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
payment_intent_data: {
application_fee_amount: "77",
transfer_data: {
destination: "acct_1LkY7e2XMzA6olfa"
}
},
This is Destination Charge
https://stripe.com/docs/connect/destination-charges <- only for Express or Custom
Yes, apologies - that was for the custom account (current implementation)
this will be removed once switching to standard accounts
Then it's good. It's just heads-up that Destination Charges shouldn't be used with Standard Account
Ok perfect, thanks
Yeah, gonna get rid of the destination charges - they were meant only for Custom accounts but we decided to swap over to use Standard accounts instead
Actually that brings up another question
If we need to charge the Connected account a fee, how would we do that via Checkout?
https://stripe.com/docs/connect/direct-charges#collecting-fees <- collect fee with Direct Charge
So there will be two payment intents then?
- one for Stripe line items/order
- one for the Direct Charge
The fee we would like to apply is a percentage based off the line item total $ amount
Hey sorry, only 1 PaymentIntent. Since you are already using Checkout, it should generate PaymentIntent underlyingly. You can specify the same fee on https://stripe.com/docs/api/checkout/sessions/create?lang=ruby#create_checkout_session-payment_intent_data-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.
Ahh ok my mistake, I'm mixing up the destination charge with the application fee
Accidentally assumed they were part of the same object
Already passing in the application fee in the Checkout session payload, so it's all good ๐
Thanks! That's everything. Have yourself a good evening
Np and glad you figured it out! Good luck!
Hey @main lynx, I just tried going through the same process using a newly setup Standard account and receiving a 400 bad request error
Here's my req id: req_4AZ7c2bBPdcLs3
Hi, for Direct Charge you also needs the Stripe Account header as the error mentioned
Ok, I have the Stripe payment going through successfully now and the application_fee appears to be deducted
Does the fee object always belong to the platform account?
I'm looking at https://stripe.com/docs/api/application_fees/object
but don't see a reference to which account the fee actually goes to, only where it was taken from
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hi! I'm taking over this thread.
If you are using the Stripe-Account header, the application_fee object will always be on the platform account.
Great, thanks. Also found the Payments > Collected Fees section ๐