#SagSaw

1 messages · Page 1 of 1 (latest)

crimson egret
#

Hey, what kind of integration are you building?

crude nest
#

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

crimson egret
#

Server-side redirection is the default integration path

crude nest
#

API key should be secret key?

#

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?

crimson egret
#

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.

crude nest
#

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?

crimson egret
#

What is the invoice number, and what do you use it for?

crude nest
#

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

crimson egret
#