#codyellow
1 messages · Page 1 of 1 (latest)
What are you trying to do, exactly?
Those py_123 objects are charges with a different prefix for historical reasons
but you can retreive them via the charges api
if thats what you mean
I'm trying to see if I can add more metadata on these so that my users w/ connected accounts can use this information to get logs of all their payments & customers
SUre, you can also update those via the charges API to set metadata
Is there a good lifecycle point to set metadata / description here?
For one time payments, I have calls to
Invoice.create & Invoice.pay
For subscriptions I have calls to Subscription.create
Should I be hooking into a webhook? Or is there another way to configure these params to pass along information to set on the charge?
You'd likely want to do this in a webhook handler, yea
To read the data from where you have it and write it where you want it
To confirm at your earlier message, py_* ids are for charges?
I'm getting troubles trying to find the object with Stripe::Charge.retrieve(py_some_id)
yes
Can you share a failing request?
You mentioned you're dealing with connect flows here, so you might need to be using the Stripe-Account header:
https://stripe.com/docs/connect/authentication#stripe-account-header
Ah I see - I'm trying something like this now. My read of the documentation is that I shouldn't need to update my Stripe.api_key and I could pass it in as a param?
Stripe::PermissionError: The provided key 'sk_test_***********************************************************************************************wDTA' does not have access to account 'py_1L6gKURV2IzD20LZsROvYaU4' (or that account does not exist). Application access may have been revoked.
from /src/figma/vendor/bundle/ruby/2.7.0/gems/stripe-5.55.0/lib/stripe/stripe_client.rb:714:in `handle_error_response'```
Can you share that request ID? You may be setting the wrong account
oops I used the wrong stripe_account! I got it now!
What would be the best webhook even to add my desired metadata to this you think? charge.updated?
Depends on what you're trying to achieve
Do you have a more recent example?
That one is too old for me to see the events it emitted
I don't have any offhand, though I'm effectively looking for whenever a charge is created for a connected account, update some description & metadata
charge.succeeded might make sense for seeing when the successful charge is initially created