#anto-destination-charge

1 messages · Page 1 of 1 (latest)

tiny yarrowBOT
karmic arch
#

Could you share a charge ID or a request ID?

graceful path
#

Yes, sure ch_3OO2ddGwc6mjNWZp1fqUJKWm

karmic arch
#

I suspect your capture call is failing as stripe_charge is an object and the capture call is expecting an ID

graceful path
#

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

karmic arch
#

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

graceful path
#

Yes, what info do you need me to send?

karmic arch
#

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

graceful path
#

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?

karmic arch
#

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,
},
)

tiny yarrowBOT
#

anto-destination-charge

graceful path
#

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'

karmic arch
#

Okay, I think I see what's wrong.

#

transfer_data[destination] can only be passed when creating the Charge, not when capturing the Charge

graceful path
#

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,
},
)

tiny yarrowBOT
graceful path
#

That seems to be working! Thank you so much for your help

karmic arch
#

Amazing, glad to hear it!

graceful path
#

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?

hushed bridge
#

Hi 👋

I'm stepping in since my colleague had to go.

#

So the Charge went through just fine but there was no associated transfer of funds to the destination

graceful path
#

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'

hushed bridge
#

I'm not sure I understand what you mean. Our API versions don't use that numbering scheme.

hushed bridge
#

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