hello... i am trying to create card payment through stripe. i use the followng code:
LineItems = new List
{
new Stripe.Checkout.SessionLineItemOptions
{
Price = "2.00",
Quantity = 2,
},
},
but i get error for Price = "2.00",... i dont know how to define.
please help me out how to define... kind regards
Prasad RaveendranPosted Aug 4, 2024, 2:46 AM
The issue you're encountering is because the
Pricefield should be a reference to a predefined price object in Stripe, not a direct amount. If you want to specify an amount directly, you need to use theAmountandCurrencyfields withinPriceData.Please refer the stripe document
https://docs.stripe.com/api
https://github.com/stripe/stripe-dotnet
https://docs.stripe.com/get-started/development-environment?lang=dotnet
venus najadPosted Aug 4, 2024, 11:00 AM
hello mr Raveendran and thanks for your respond. it saved me...
i have another issue, if your search in questions: contact us in webapplication aspnet webform
i have an advertise website, in which people put their ads and they contact echother by any form of email address. the same when people will contact me with their defaqult email address. in my case, the problem is the client's creditial and host, which must be specific or defined. but how make it default or general?
protected void btnSend_Click(object sender, EventArgs e)
{
MailMessage message = new MailMessage(txtEmail.Text, emailto, txtSubject.Text, txtBody.Text); //creates a mail message
message.IsBodyHtml = true;
SmtpClient client = new SmtpClient
{
Port = 25, //any client
Host = "smtp.gmail.com",//"smtp-mail.outlook.com", //"smtp.sendgrid.net", //or another email sender provider
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = true,
Credentials = new NetworkCredential("[email protected]", 'my secret password') //but it must be sender, not me
};
try
{
client.Send(message);
lblResult.Text = "your mail has been sent successfully!";
}
catch (Exception ex) { lblResult.Text = ex.Message; }
finally { btnSend.Enabled = true; clearFields(); }
}
//////////////////////////////////////////////
i used another way, made droppdownlist with different hosts and i used
client.Credentials = new NetworkCredential(txtEmail.Text, txtPassword.Text, domain);
but didn't worked??!!
how should i make it default??!! appreciate your respond, with codes. very kind regards