#Kshitij-Connect

1 messages · Page 1 of 1 (latest)

carmine glade
#

It's expected to only receive an ID by default. However you can expand it the get the whole object

#

In your case, you would want to expand "destination_payment"

dapper fiber
#

Thanks for pointing me in the right direction.

I passed in TransferRetrieveParams.builder().addExpand("destination_payment").build(),
when retrieving the transfer object.

It then does contain the destinationPayment object.
However if I use the description setter on the destination payment object, the value is not getting reflected in the dashboard.

Confirmed by retrieving the transfer object again after that step. The description is still blank.

No exceptions are thrown. Am I missing a step? Or is there some configuration that is preventing a destination payment object from getting updated?

carmine glade
#

if I use the description setter on the destination payment object, the value is not getting reflected in the dashboard
I think there might be an issue with this call. Generally it should work

#

If you go to your API logs (on Dashboard) and find that request, do you see your new description in the request body?

dapper fiber
#

So this is the snippet of code I'm trying:

TransferRetrieveParams params = TransferRetrieveParams.builder().addExpand("destination_payment").build();
Transfer transfer = Transfer.retrieve("<transfer_id>", params, null);
Charge destinationPayment = transfer.getDestinationPaymentObject();
destinationPayment1.setDescription("test");

I checked the API logs in the dashboard, only one there is when the transfer is retrieved. Nothing about the setting the description.

I think I may be missing a step. Do I need to perform an update on either the transfer or the destinationPayment Charge object after the step of setting the description?

carmine glade
#

You are setting Description on an object from Transfer.retrieve API

#

You only modify your local copy of the object. You will need to call the Update API for this particular Payment, to reflect the description

#

I am not sure if this work, just give it a try!

#

It's the PaymentIntent Update API

dapper fiber
#

I agree it did seem that only the local copy was getting updated.

TransferRetrieveParams params = TransferRetrieveParams.builder().addExpand("destination_payment").build();
Transfer transfer = Transfer.retrieve("<transfer_id>", params, null);
Charge destinationPayment = transfer.getDestinationPaymentObject();

the destination payment object seems to be a Charge. But the odd thing if I try to search for the charge using the ID py_xxxxx

Charge.retrieve(py_xxxxx)
I get a com.stripe.exception.InvalidRequestException: No such charge: 'py_xxxxxx'; code: resource_missing;

Same with PaymentIntent.retrieve(py_xxxxx)
com.stripe.exception.InvalidRequestException: No such payment_intent: 'py_xxxxxx

carmine glade
#

You need to use the Stripe Account header

#

because that py object belongs to the Connected Account

dapper fiber
#

ahh that makes sense.. will try that

dapper fiber
#

Setting the connect header was key. So below is what worked. Hopefully that's the recommended way:

Transfer transfer = Transfer.retrieve("<transfer_id>", params, null);
String destinationPaymentId = transfer.getDestinationPayment();

  • retrieve the charge for the destination payment id, specifying the connected account header
  • update the charge, passing in the description property as param to be changed

The description is now getting reflected on the dashboard.

Thanks so much for your help and patience.