#anto-destination-charge
1 messages · Page 1 of 1 (latest)
Could you share a charge ID or a request ID?
Yes, sure ch_3OO2ddGwc6mjNWZp1fqUJKWm
I suspect your capture call is failing as stripe_charge is an object and the capture call is expecting an ID
Take into account that I'm using an old version of the API and this one asks for an instance of a charge and not only the charge ID
Oh, yep, I see.
Okay, I see the capture call but the application fee and transfer data parameters are not included in the request body
Are you able to look up the details of this request in your Dashboard? req_4AqiFRqLPQLWEu
Yes, what info do you need me to send?
Nothing in particular since I can see the request on my end. I just wanted to show how application fee and transfer data values were not included in the body of the request we received
Oh yeah, I can see that. I see the transfer data in a field called Idempotency, but I can't see them in the request post body or request query parameters. And in the response the destination and application_fee are null. Should I send them somewhere else?
I think this might come down to syntax.
Try this:
stripe.Charge.capture(
stripe_charge,
application_fee_amount=application_fee,
transfer_data={
'destination': account.stripe_user_id,
},
)
anto-destination-charge
I got this error trying that
error_code=parameter_unknown error_message=u'Received unknown parameter: transfer_data[destination]' error_param=transfer_data[destination] error_type=invalid_request_error message='Stripe API error received'
Gotcha. I see we did receive body params for that request: https://dashboard.stripe.com/test/logs/req_N2J9dcCoCgT9pt
Okay, I think I see what's wrong.
transfer_data[destination] can only be passed when creating the Charge, not when capturing the Charge
Ok, can try it like this
stripe_charge = stripe.Charge.create(
amount=amount,
currency='usd',
source=customer_stripe.default_source,
customer=customer_stripe.id,
application_fee=application_fee,
transfer_data={
'destination': account.stripe_user_id,
},
)
That seems to be working! Thank you so much for your help
Amazing, glad to hear it!
One more thing if you don't mind. Can you explain a little bit why the charge was not being sent to the destination but we saw a successful payment?
Also is there a way for me to go into the docs for the version I have?
Hi 👋
I'm stepping in since my colleague had to go.
The Charge isn't sent to the Destination, the funds from it are. If you look at the funds flow diagram we show here: https://stripe.com/docs/connect/destination-charges#flow-of-funds-amount
You will see the transfer to the Connected account is the last step
So the Charge went through just fine but there was no associated transfer of funds to the destination
Oh ok, thank you! I get that now. Just in case is there a way for me to get the docs for the version I have, it's outdated and we are planning to migrate to a newer version, but for know I have to use the one I have.
VERSION = '1.75.3'
I'm not sure I understand what you mean. Our API versions don't use that numbering scheme.
Oh, you meant your stripe-python library. Unfortunately it is not possible to get a version of either the API reference doc or Stripe docs that use syntax matching that Stripe Python version.
I would recommend updating but perhaps incrementally. The version you have is 6 years old and there have been more breaking changes than I can count between now and then