#bmark

1 messages ยท Page 1 of 1 (latest)

plain wharfBOT
main lynx
ocean stag
#

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

main lynx
#

A bit confused, you received the webhook event but don't have secret key of that Stripe Account?

ocean stag
#

That's correct, I don't see the client secret key in the response payload

main lynx
#

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

ocean stag
#

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

main lynx
#

So you are the Platform right?

#

You can use your own secret key and the Stripe Account header

ocean stag
#

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'],
})
main lynx
ocean stag
#

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?

main lynx
#

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

ocean stag
#

We're using StripeCheckout for the payment rather than destination or direct charges

main lynx
#

Checkout can have destination / direct charges parameters. Can you give an example of Checkout Session Id? cs_test_xxx

ocean stag
#

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

main lynx
ocean stag
#

Ok 1 min

main lynx
#

Yesp would be easy to look at a specific ID

ocean stag
#

Here you go: cs_test_b1WjXkUGnoP9vUxBWJpq4hFHEEzt0jUppfhw9vMv0z1u7Lwxl3D4knjAvy

main lynx
#
 payment_intent_data: {
    application_fee_amount: "77",
    transfer_data: {
      destination: "acct_1LkY7e2XMzA6olfa"
    }
  },

This is Destination Charge

ocean stag
#

Yes, apologies - that was for the custom account (current implementation)

this will be removed once switching to standard accounts

main lynx
#

Then it's good. It's just heads-up that Destination Charges shouldn't be used with Standard Account

ocean stag
#

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?

main lynx
ocean stag
#

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

main lynx
#

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

ocean stag
#

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

main lynx
#

Np and glad you figured it out! Good luck!

ocean stag
#

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

main lynx
#

Hi, for Direct Charge you also needs the Stripe Account header as the error mentioned

ocean stag
#

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?

hoary root
#

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.

ocean stag
#

Great, thanks. Also found the Payments > Collected Fees section ๐Ÿ‘