#theplay3r_api
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/1286773981633839177
๐ 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.
- play3r_connect-webhooks, 2 days ago, 35 messages
- theplay3r_code, 2 days ago, 13 messages
- theplay3r_api, 3 days ago, 7 messages
๐ Thanks for waiting
Still waiting ๐
Apologies, needed to do some quick testing
It doesn't look like changing currencies on a Subscription is possible - you'll run into an error as you've discovered. You'll need to create a new Subscription. We have an explanation of how to do this here: https://support.stripe.com/questions/updating-subscription-currency
I've found that, but I'm struggling with figuring how to duplicate the Subscription and ideally not charge the customer anything.
I currently have this setup, but I'm wondering if it's the right approach and whether or not am I missing something.
val couponParams = CouponCreateParams.builder()
.setName("USD-$productId")
.setDuration(CouponCreateParams.Duration.ONCE)
.setPercentOff(BigDecimal(100))
.setAppliesTo(CouponCreateParams.AppliesTo.builder()
.addProduct(productId)
.build())
.setRedeemBy(System.currentTimeMillis().plus(86400000))
.build()
val coupon = stripeClient.coupons().create(couponParams)
val createParams = SubscriptionCreateParams.builder()
.setCustomer(customer.id)
.setCurrency("USD")
.setDefaultPaymentMethod(currentSub.defaultPaymentMethod)
.setDescription(currentSub.description)
.addItem(SubscriptionCreateParams.Item.builder()
.setPrice(product.stripePriceIdMonthly)
.setQuantity(1)
.build())
.setProrationBehavior(SubscriptionCreateParams.ProrationBehavior.NONE)
.setBillingCycleAnchor(currentSub.currentPeriodEnd)
.setMetadata(currentSub.metadata)
.setCoupon(coupon.id)
.build()
stripeClient.subscriptions().create(createParams)
stripeClient.subscriptions().cancel(currentSub.id)
I would not like to do any mistakes, I believe you can undestand that.
You could use free trials to make up the difference. For example, customer A has paid their most recent Subscription Invoice on the first of the month, and you're planning to migrate their Subscription to the new Subscription with a different currency on the 15th. You can create the new Subscription with a free trial that lasts until the first of the next month
I've created a temporary coupon that will give the subscription 100% discount once, but I wonder if I can duplicate the data as I showcased, or if that will produce any errors/won't work well?
Using coupons and discounts should work, but you can also use Trial Periods: https://docs.stripe.com/billing/subscriptions/trials