#Devi

1 messages ยท Page 1 of 1 (latest)

versed cedarBOT
keen trellis
#

You need the Update Subscription API. Make sure to read about Prorations

mint orbit
#

i want to update recurrence price option for exisiting subscription

#

For ex:May month price is30$ and monthly subscription . Now i want to change June month price is 1000$ and Yearly subscription

keen trellis
#

When it's yearly subscription you will need price for a whole year

#

Refer the API Reference above!

mint orbit
#

ok, so i use same subscription token to update the plan month to year right. Please refer the below code and correct me if am wrong.

#

//Create reucrring Price
var Priceoptions = new PriceCreateOptions
{
UnitAmountDecimal = pay.PaidAmount * 100,
Currency = pay.CurrencyCode,
BillingScheme = "per_unit",
Recurring = new PriceRecurringOptions
{
Interval = pay.RecurrenceId == 1 ? "month" : "year",
IntervalCount = 1,
UsageType = "licensed"
},
Product = pay.ProductToken
};
var PriceService = new PriceService();
Stripe.Price PriceResponse = PriceService.Create(Priceoptions);

            var options = new SubscriptionUpdateOptions
            {
                ProrationBehavior = "none",
            };
            var service = new SubscriptionService();
            Stripe.Subscription subscription= service.Update(pay.SubscriptionToken, options);
keen trellis
#

You seem to haven't used PriceResponse in your Subscription Update call

mint orbit
#

which property can i use to reset PriceResponse in Subscription Update call?

keen trellis
mint orbit
#

Yes, thank you. issue resolved.๐Ÿ˜€ .

#

can i ask you one more question?

keen trellis
#

Sure!

mint orbit
#

currently am getting card number details in my website.I want to use stripe page to get customer card details. Which url i need to redirect to get card details?

keen trellis
#

Do you really handling card number by yourself? That's exposed to PCI Compliance

#

Stripe has Checkout or Payment Element. Checkout is easier but PaymentElement is more customizable