#SagSaw
1 messages · Page 1 of 1 (latest)
Hi
We accept the online table booking orders. and at the checkout we wanted the diner redirect to the stripe payment page without using JS library. We have to implement it by using server side event in ASP.NET
Sure, should be possible: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout#redirect-customers
Server-side redirection is the default integration path
API key should be secret key?
I'm getting error at line Session session = service.Create(options);
It is saying ,
StripeException: In order to use Checkout, you must set an account or business name at https://dashboard.stripe.com/account.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
public ActionResult Create()
{
var domain = "http://localhost:44360";
StripeConfiguration.ApiKey = "sk_test_51LSj9nSGSIpVBN8T07mCvWUhQCYSoMEbms1z45ibqJmJATfl82lHg1oYpDO8H6d4YXnwpKnoBREBL1b0tFCn7Jsy00RQUGWobn";
var options = new SessionCreateOptions
{
LineItems = new List<SessionLineItemOptions>
{
new SessionLineItemOptions
{
PriceData = new SessionLineItemPriceDataOptions
{
UnitAmount = 2000,
Currency = "usd",
},
Quantity = 1,
},
},
Mode = "payment",
SuccessUrl = domain + "/success.html",
CancelUrl = domain + "/cancel.html",
};
var service = new SessionService();
Session session = service.Create(options);
Response.Headers.Add("Location", session.Url);
return new StatusCodeResult(303);
}
Above is my sample code
are you there?
I am, but I'm also helping other users. Please be patient
Sounds like the error is pretty clear to me:
In order to use Checkout, you must set an account or business name at https://dashboard.stripe.com/account.
ahh. ok
Could you kindly assist me here.
Now, I have updated the account settings and it get me redirected to the payment page.
BUT,
I have to send our invoice number to the payment page too. How can we achieve it?
What is the invoice number, and what do you use it for?
our payment invoice number e.g. INV000384
so we can keep the track of success and failure of our payment by using this invoice number
and this invoice number is unique for each transaction
Sure, couple of options:
- you could user the
client_reference_idparameter: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-client_reference_id - or
metadataon the underlying Payment Intent: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.