#Anas_Discord-Capture
1 messages · Page 1 of 1 (latest)
Hi, by unique transaction ID you mean the charge ID?
where do you want to pass it to?
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
ummm charge.Id will return the Id?
I hope so , let me see please
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
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
sir this is the id i want to store in my db and then use later here
var service = new ChargeService();
service.Capture("chere");
correct, that is the charge id
for capturing the amount when service is provided i use this [ var service = new ChargeService();
service.Capture("chere");
wsw — Today at 10:34 AM ]
what you need is simply charge.Id
and you are using Charge API, which is not recommended anymore, what you should do is to follow our guide here instead.
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
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
yes exactly , how do i store this id? as this id will be unique for every customer that comes
that depends on your own application business logic. How do you store your customer now in your DB?
just ignore Stripe for a second
we are storing in postgres sql
which table and what schema do you have? customers will have their own table I assume?
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
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
problem is how do i take that charge id into db
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?
isnt the charge id unique every time a new customer comes?
yes we can write to db using database access layer
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