#Anas_Discord-Capture

1 messages · Page 1 of 1 (latest)

gleaming atlas
#

Hi, by unique transaction ID you mean the charge ID?

#

where do you want to pass it to?

humble sandal
#

yes exactly

#

var service = new ChargeService();
service.Capture("here");

#

currently i am getting this id in charge in this format and i cant understand how to use it here in the function

gleaming atlas
#

ummm charge.Id will return the Id?

humble sandal
#

I hope so , let me see please

humble sandal
#

sir its not working actually , and what i want to make clear is i want to store the charge id in my databse of each customer whose card is on hold now. Lets say there are 10 customers who need my service and they and authorize and their cards get on hold. I need to store those 10 ids into my database and then when i provide my service to each customer from 10 , i would charge them separately through their charge ids which are stored in my db already. what the main issue that i cant understand is how to store those charge ids into db and then call them in the function (which is working correct when passing id manually) provided by you.

#

Ihave shared the image above and you can see for now i am getting that charge id in chrge object

#

Thankyou for listening to me with patience

#

any help in this regard will be highly appreciated

fiery gate
#

Step in here for Orakaro.
Can you share what is not working? What you are asking is very straightforward where you pass in the charge ID that you want to capture

var service = new ChargeService();
service.Capture("ch_1DWvnnxxxx1");

where ch_xxxxxx is the ID that you need to save in your DB
https://stripe.com/docs/api/charges/capture?lang=dotnet

humble sandal
#

sir this is the id i want to store in my db and then use later here

#

var service = new ChargeService();
service.Capture("chere");

fiery gate
#

correct, that is the charge id

humble sandal
#

this is my method of placing the hold on card

fiery gate
#

the balanceTransactionId is null

#

that's not the id you need

humble sandal
#

for capturing the amount when service is provided i use this [ var service = new ChargeService();
service.Capture("chere");
wsw — Today at 10:34 AM ]

fiery gate
#

what you need is simply charge.Id

humble sandal
#

sir every thing is working perfectly fine , we just want to successfully store the charge id in db and then call that id respectively for each unique case

#

any help in this regards will be highly appreciated

fiery gate
#

I don't know what is not working unfortunately

#

what help do you need exactly

#

as I mentioned, you just need to store charge.Id in your database if you insist on using Charge API

#

and use charge.Id in your service.Capture("ch_1DWvnnxxxx1"); call

humble sandal
#

yes exactly , how do i store this id? as this id will be unique for every customer that comes

fiery gate
#

that depends on your own application business logic. How do you store your customer now in your DB?

#

just ignore Stripe for a second

humble sandal
#

we are storing in postgres sql

fiery gate
#

which table and what schema do you have? customers will have their own table I assume?

humble sandal
#

let me show you

#

we want to store unique charge id against patient id

#

every time they take service and their card gets on hold an id is generated , we would store that id in db here and then call that id to charge against that particular patient

fiery gate
#

you can create another table with name like patients_transactions the colomn could be
PatientId | stripe_charge_id

#

they you can simply join the table to find all the charges that the Patient has

humble sandal
#

I will simply create a column

#

thats not a problem

fiery gate
#

not column

#

a table

humble sandal
#

problem is how do i take that charge id into db

fiery gate
#

a seprate table

#

How do you write to your db now ?

#

there will be no difference than how you write any other data to your db

#

Do you have database access layer for you to call to write to DB?

humble sandal
#

isnt the charge id unique every time a new customer comes?

#

yes we can write to db using database access layer

fiery gate
#

charge id is always unique yes

#

you mean your application don't know who is paying?

#

I imagine your system will requrie your patience to login before paying

#

then you will have a patience ID, you create a charge and you get a charge id
you write patienceID<>chargeID pair into your DB

humble sandal
#

let me see somethings and iwill get back to you

#

thanks for assisting and showing patience

#

lets say i use this function

#

then how do i pass the unique ids in service.capture each time i want to do a capture

fiery gate
#

You just pass the payment_intent id. as your screenshot shows

#

payment_intent id like charge id, it is unique