#senakaRan
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Can you share the request ID for the request to update the Charge?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
moment
thanks
I will check it
req_kFhb80U5p8XeQO
this one plz
working on development test mode
now
Taking a look
I see the metadata key: value pair updated in the charge object. What were you expecting to be different?
this is the client side
stripe express
if the destination client log in stripe express account
and check this
the description must be updated by the invoice id
but just set by default company name
I tried to change this description info
something is wrong with this?
You didn't update the description you updated the metadata
sorry
did you check the description field of the response
I also set param for the description too
Not in this API request
stripe.charges.update('ch_3MTSzEHSSJFxb6zy0NHwUDxv',
{metadata: {description: shipment.invoiceNo.toString(),
description: shipment.invoiceNo.toString()}}).then((resultCharges)=>{
console.log(resultCharges,'------->>>>------------>>>' );
This is the entire payload
{
metadata: {
description: "INV-0012A",
},
}
The description is not being passed in the API request
I would recommend saving those values to individual variables and logging them prior to making the API call
so you mean I can not set the description content by this charge update api call?
Yes you can, it's one of the valid parameters: https://stripe.com/docs/api/charges/update#update_charge-description
I'm saying we are not receiving a value for the description in your API call.
This is because you need to close the object you are passing for metadata
this metadata: {description: shipment.invoiceNo.toString(),, needs to this: metadata: {description: shipment.invoiceNo.toString()},
Oh I see
let me try again
thanks
req_1Ue7A88lxsQZxY
can you check this request again?
still not updated I guess
stripe.charges.update('ch_3MTSzEHSSJFxb6zy0NHwUDxv',
{
metadata: {description: shipment.invoiceNo.toString()}
}
).then((resultCharges)=>{
console.log(resultCharges,'------->>>>------------>>>' );
callBack({
success: true,
STATUSCODE: 200,
message: 'Client Secret',
response_data: { client_secret: paymentIntent.client_secret }
});
})
here is my code
๐ stepping in as Snufkin needed to step away
Catching up
So that request updates the metadata of the Charge
It did successfully perform the update as you can see that key/value was added to the metadata returned in the response
Are you trying to just update the description property? Or specifically update metadata to contain a description within metadata?
I am going to update this description info
according to the guide, I can set description param directly or with meta data
am I right?
this is the destination client stripe express transaction info
I want to update it
I hope my explanation is clear to you
Which guide are you referencing? It sounds like you are talking about updating the description of a payment within a Connected Account
Is that correct?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
this one
Yeah but you are talking about customizing the "Activity" feed of your Connected Accounts like we discuss here: https://stripe.com/docs/connect/customize-express-dashboard#set-custom-descriptions correct?
of course
Alright so two things are incorrect then in what you are doing above
First, you are updating the original Charge, not the Payment. You need to retrieve the Payment that is the result of the Transfer related to that Charge.
So what you want to do is retrieve the Charge that you are currently trying to update (using https://stripe.com/docs/api/charges/retrieve) and expand the transfer. destination_payment
This will give you the Payment on the Connected Account (which is also a Charge object)
Then you update that Charge's description (what you linked above - https://stripe.com/docs/api/charges/update#update_charge-description) and pass the Stripe Account header to update the Payment that lives on the Connected Account (see: https://stripe.com/docs/connect/authentication)
Sounds good
Hello
๐
I hope nothing is interrupting you
could you guide me in more detail plz...
in my backend project, only paymentIntents api call
and after this api call, all the transactions are done
but can not find any code for this
how could I get the current charge id, after calling stripe.paymentIntents
I just tried to call this api
stripe.transfers.list({
limit: 3
})
and can not get the current transaction charge id
When you retrieve a PaymentIntent it will contain the latest_charge: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-latest_charge
Or, if you are on an older API version you should see a charges property
oh excellent
and second step I call https://stripe.com/docs/api/charges/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
this api based on the latest_charge id
right?
Yep
Exactly
thx
You can actually just do this straight from the PaymentIntent retrieval
Using expand
So you would expand latest_charge.transfer.destination_payment
Then you don't need multiple API calls
Can you provide me the PaymentIntent ID you are retrieving?
And do you know what API Version you are using?
Yep okay that's why
this is the version
So on that API version you have the charges property
Are you creating a new project?
I'd recommend just upgrading your API Version to the latest if you don't have a production integration already running
sorry now I have production integration already running
That code snippet appears to be following a payment intent create call
!?
so it means I can not get the current transaction charge id by payment intent create call api?
You can, if the payment is confirmed during creation. In the requests you're making it does not appear than you're confirming the payment intents so there is not yet a charge where you expect one.
eg: https://dashboard.stripe.com/test/logs/req_cxXb28LHyecgZK
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So you either need to do this later once the payment is complete, or you can change this test to confirm during creation with confirm=true
thanks
after payment is completed, how could I get current charge id?
I can not call paymentIntents create api call again
How are you completing these payments?
in the current backend project only stripe.paymentIntents.create api call is existing
on other transfer or charges api calls
but all the transactions are done auto
I want to customize the descriptions for destination client0side
client-side
I am advised to follow this guide
face issues on proceed it
Yes, you'll need to do that once you get the charge ID from the payment intent
For payments completed async, you could for example listen to payment_intent.succeeded webhooks and use that to kick off your update process
Thanks
is there a sample or guide for webhooks in the stripe guide?
I am new to it
There is, yes, just a sec
General overview/entry point for reading: https://stripe.com/docs/webhooks
Integration example: https://stripe.com/docs/webhooks/quickstart
Examples specific to post-payment events: https://stripe.com/docs/payments/handling-payment-events
thanks