#theplay3r_api

1 messages ยท Page 1 of 1 (latest)

glacial ingotBOT
#

๐Ÿ‘‹ 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.

lime kelp
#

๐Ÿ‘‹ Thanks for waiting

lapis basin
#

Still waiting ๐Ÿ‘€

lime kelp
#

Apologies, needed to do some quick testing

lapis basin
#

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.

lime kelp
#

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

lapis basin
#

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?

lime kelp