#karuppasamy

1 messages ยท Page 1 of 1 (latest)

hollow pastureBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

modest mantle
#

hi

waxen stump
#

๐Ÿ‘‹ happy to help

modest mantle
#

can u check my comments pls

waxen stump
#

taking a look

modest mantle
#

ok

waxen stump
modest mantle
#

public async Task<ActionResult<string>> CreateCheckout()
{
try
{
var options = new Stripe.Checkout.SessionCreateOptions
{
SuccessUrl = "https://example.com/success",
LineItems = new List<Stripe.Checkout.SessionLineItemOptions>
{
new Stripe.Checkout.SessionLineItemOptions
{
Price = "price_1NrxA7Labf7E4J4Fr0eknD2d",
Quantity = 22,
},
},
Mode = "subscription",
};
var service = new Stripe.Checkout.SessionService();
var session = service.Create(options);

            return session.Url;
        }
        catch (Exception ex)
        {
            return NotFound("No data available");
        }
    }

here i am using same

#

where to add adjustable qty

waxen stump
#

in the lineItemOptions

modest mantle
#

var options = new Stripe.Checkout.SessionCreateOptions
{
SuccessUrl = "https://example.com/success",
LineItems = new List<Stripe.Checkout.SessionLineItemOptions>
{
new Stripe.Checkout.SessionLineItemOptions
{
Price = "price_1NrxA7Labf7E4J4Fr0eknD2d",
Quantity = 22,
AdjustableQuantity=true,
},
},
Mode = "subscription",
};
var service = new Stripe.Checkout.SessionService();
var session = service.Create(options);

            return session.Url;

added like that but getting error "cannot implicitly convert type bool to stripe.chekout.sessionlineitemsadjustqtyoption"

waxen stump
#

it's not a boolean

#

it's an object that has 3 properties

#

line_items.adjustable_quantity.enabled
REQUIRED
Set to true if the quantity can be adjusted to any non-negative integer. By default customers will be able to remove the line item by setting the quantity to 0.

line_items.adjustable_quantity.maximum
optional
The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999.

line_items.adjustable_quantity.minimum
optional
The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0.