#karuppasamy
1 messages ยท Page 1 of 1 (latest)
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.
- karuppasamy, 2 hours ago, 16 messages
- karuppasamy, 20 hours ago, 32 messages
hi
๐ happy to help
can u check my comments pls
taking a look
ok
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
in the lineItemOptions
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"
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.