#satvik-techie_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1293183985069068359
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- satvik-techie_code, 1 day ago, 8 messages
- satvik-techie_code, 1 day ago, 8 messages
- satvik-techie_code, 4 days ago, 15 messages
- satvik-techie_code, 4 days ago, 17 messages
- satvik-techie_code, 6 days ago, 71 messages
hi
hi there!
can you share the request ID (req_xxx)? you can find it here https://dashboard.stripe.com/test/logs
req_M3NGB3M0E1a29I
i want to update price
StripeConfiguration.ApiKey = stripePaymentRequestViewModel.ApiKey;
var requestOptions = new RequestOptions
{
StripeAccount = stripePaymentRequestViewModel.AccountKey
};
var options = new PriceUpdateOptions
{
CurrencyOptions = new AutoConstructedDictionary<string, PriceCurrencyOptionsOptions>() {
{ "unit_amount_decimal", new PriceCurrencyOptionsOptions()
{ UnitAmountDecimal = Convert.ToDecimal(stripePaymentRequestViewModel.MTAAmount * 100)} }}
};
var service = new PriceService();
await service.UpdateAsync(stripePaymentRequestViewModel.PriceId, options, requestOptions);
but getting error
am is missing something ?
having a look
you forgot to set a currency: https://docs.stripe.com/api/prices/update?lang=curl#update_price-currency_options-<currency>.unit_amount_decimal
it should be something like currency_options.usd.unit_amount_decimal: xxx, notice the usd in the middle.
ok let me check
but i am not getting the currency option
public class PriceCurrencyOptions : StripeEntity<PriceCurrencyOptions>
{
/// <summary>
/// When set, provides configuration for the amount to be adjusted by the customer during
/// Checkout Sessions and Payment Links.
/// </summary>
[JsonProperty("custom_unit_amount")]
public PriceCurrencyOptionsCustomUnitAmount CustomUnitAmount { get; set; }
/// <summary>
/// Only required if a <a
/// href="https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)">default
/// tax behavior</a> was not provided in the Stripe Tax settings. Specifies whether the
/// price is considered inclusive of taxes or exclusive of taxes. One of <c>inclusive</c>,
/// <c>exclusive</c>, or <c>unspecified</c>. Once specified as either <c>inclusive</c> or
/// <c>exclusive</c>, it cannot be changed.
/// One of: <c>exclusive</c>, <c>inclusive</c>, or <c>unspecified</c>.
/// </summary>
[JsonProperty("tax_behavior")]
public string TaxBehavior { get; set; }
/// <summary>
/// Each element represents a pricing tier. This parameter requires <c>billing_scheme</c> to
/// be set to <c>tiered</c>. See also the documentation for <c>billing_scheme</c>.
/// </summary>
[JsonProperty("tiers")]
public List<PriceCurrencyOptionsTier> Tiers { get; set; }
/// <summary>
/// The unit amount in cents (or local equivalent) to be charged, represented as a whole
/// integer if possible. Only set if <c>billing_scheme=per_unit</c>.
/// </summary>
[JsonProperty("unit_amount")]
public long? UnitAmount { get; set; }
/// <summary>
/// The unit amount in cents (or local equivalent) to be charged, represented as a decimal
/// string with at most 12 decimal places. Only set if <c>billing_scheme=per_unit</c>.
/// </summary>
[JsonProperty("unit_amount_decimal")]
public decimal? UnitAmountDecimal { get; set; }
}
this is the class
what SDK are you using? .NET?
yes
Hey! Taking over for my colleague. Let me catch up.
Have you tried to use AddExtraParam?
what to add in param ?
CurrencyOptions = new AutoConstructedDictionary<string, PriceCurrencyOptionsOptions>() {
{ "gdp.unit_amount_decimal", new PriceCurrencyOptionsOptions()
{
UnitAmountDecimal = Convert.ToDecimal(stripePaymentRequestViewModel.MTAAmount * 100),
} }}
will this work ?
where gdp is currency
You need to make something like this:
options.AddExtraParam("currency_options[usd][unit_amount_decimal]", 10000);
Where options is the Price update options PriceUpdateOptions
ok let me check
ok worked, but one small query
will it update in the subscription ?
if i have created with that price ?
Hey there, my understanding of currency option is that it affects only the presentment currency and payment
the price remains the price object you used.
hi
i want to update subscription with price
so during subscription the price i have created with unit_amount_decimal let say --> 15
now i want to update subscription with the price unit_amount_decimal say --> 20
now if i update price with the price id which i had set in subscription , will it update subsription ?
This sounds very different that using currency_options -- you're describing now that you want to change the price object used on a subscription item?
In that case, please review the docs here about updating subscriptions to use new prices: https://docs.stripe.com/billing/subscriptions/upgrade-downgrade#changing
okay