#alex1984

1 messages · Page 1 of 1 (latest)

loud barnBOT
quaint mason
#

Yeah you can

#

Just add on the additional fee to the total

#

What integration path are you following?

lyric garden
#

c#

quaint mason
#

Ok. Are you using Elements, Checkout, etc?

lyric garden
#

windows Form

quaint mason
#

Windows form? What's that?

lyric garden
#

no just the normal api

quaint mason
#

There's multiple integration paths with our api. What guide are you following?

lyric garden
#

using Stripe.Checkout;
using Stripe;

quaint mason
#

Ok so Checkout?

lyric garden
#

// Create a new HttpClient to communicate with the Stripe API
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + stripeApiKey);

            var content = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair<string, string>("amount", "100"),
                new KeyValuePair<string, string>("currency", "USD"),
                new KeyValuePair<string, string>("description", "Test payment"),
                new KeyValuePair<string, string>("source", "tok_visa"), // Replace this with the actual token for the payment method you want to use
            });

            var response = client.PostAsync("https://api.stripe.com/v1/charges", content).Result;
            var responseContent = response.Content.ReadAsStringAsync().Result;
            var charge = JsonConvert.DeserializeObject<dynamic>(responseContent);

            MessageBox.Show("Charge id: " + charge.id + Environment.NewLine +
                            "Amount: " + charge.amount / 100 + " " + charge.currency + Environment.NewLine +
                            "Status: " + charge.status, "Payment Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
#

yes

#

it is a check out

#

like POS

quaint mason
#

Wait but that code you just shared calls the Charges api

#

So not Checkout?

lyric garden
#

is just a test

quaint mason
#

Can you link the guide you are following

lyric garden
#

im not folling any guide just the docs of stripe

#

if you have a lik to a guide that will be help full

quaint mason
#

But to add a fee, you can just add to the total

lyric garden
#

OK

#

👍

#

thank you so much, im flying blind

quaint mason
#

No problem