#senakaRan

1 messages ยท Page 1 of 1 (latest)

astral scaffoldBOT
kindred silo
spiral cove
#

moment

#

thanks

#

I will check it

#

req_kFhb80U5p8XeQO

#

this one plz

#

working on development test mode

#

now

kindred silo
#

Taking a look

#

I see the metadata key: value pair updated in the charge object. What were you expecting to be different?

spiral cove
#

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?

kindred silo
#

You didn't update the description you updated the metadata

spiral cove
#

sorry

#

did you check the description field of the response

#

I also set param for the description too

kindred silo
#

Not in this API request

spiral cove
#

stripe.charges.update('ch_3MTSzEHSSJFxb6zy0NHwUDxv',
{metadata: {description: shipment.invoiceNo.toString(),
description: shipment.invoiceNo.toString()}}).then((resultCharges)=>{
console.log(resultCharges,'------->>>>------------>>>' );

kindred silo
#

This is the entire payload

{
  metadata: {
    description: "INV-0012A",
  },
}
spiral cove
#

this is my code

#

this is wrong?

kindred silo
#

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

spiral cove
#

so you mean I can not set the description content by this charge update api call?

kindred silo
#

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

spiral cove
#

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

radiant shoal
#

๐Ÿ‘‹ 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?

spiral cove
#

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

radiant shoal
#

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?

spiral cove
#

this one

radiant shoal
spiral cove
#

of course

radiant shoal
#

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.

#

This will give you the Payment on the Connected Account (which is also a Charge object)

spiral cove
#

Thank you

#

let me try based on your guide

radiant shoal
#

Sounds good

spiral cove
#

Hello

radiant shoal
#

๐Ÿ‘‹

spiral cove
#

I hope nothing is interrupting you

radiant shoal
#

Happy to help ๐Ÿ™‚

#

What's up

spiral cove
#

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

radiant shoal
#

Or, if you are on an older API version you should see a charges property

spiral cove
#

oh excellent

#

this api based on the latest_charge id

#

right?

radiant shoal
#

Yep

spiral cove
#

and check transfer. destination _payment

#

?

radiant shoal
#

Exactly

spiral cove
#

thx

radiant shoal
#

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

spiral cove
#

Excellent!

#

it seems I have null value

#

from the latest_charge

radiant shoal
#

Can you provide me the PaymentIntent ID you are retrieving?

#

And do you know what API Version you are using?

spiral cove
#

Yup

#

thanks moment

radiant shoal
#

Yep okay that's why

spiral cove
#

this is the version

radiant shoal
#

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

spiral cove
#

sorry now I have production integration already running

radiant shoal
#

Oh that's fine

#

Then you want charges.data[0] not latest_charge

spiral cove
#

ok

#

undefined

#

am I wrong?

#

should I get this, from retrieve list api call?

vital ermine
#

That code snippet appears to be following a payment intent create call

spiral cove
#

!?

#

so it means I can not get the current transaction charge id by payment intent create call api?

vital ermine
#

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

spiral cove
#

thanks

#

after payment is completed, how could I get current charge id?

#

I can not call paymentIntents create api call again

vital ermine
#

How are you completing these payments?

spiral cove
#

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

vital ermine
#

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

spiral cove
#

Thanks

#

is there a sample or guide for webhooks in the stripe guide?

#

I am new to it

vital ermine
#

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

Listen for events on your Stripe account so your integration can automatically trigger reactions.

Learn how to set up and deploy a webhook to listen to events from Stripe.

How to use webhooks to respond to offline payment events.

spiral cove
#

thanks