#j_r_e

1 messages · Page 1 of 1 (latest)

cobalt waveBOT
strange pond
#

Hi there, so you want to collect the payment at the end of the subscription instead of the beginning?

iron robin
#

hi Jack

#

yes that's right

#

for sure there is an option to set while creating subscription

strange pond
#

Yes there is

iron robin
#

currently I'm using the following options:

                    SubscriptionCreateParams.PaymentSettings
                        .builder()
                        .setSaveDefaultPaymentMethod(SaveDefaultPaymentMethod.ON_SUBSCRIPTION)
                        .build();
                            
                SubscriptionCreateParams subCreateParams = SubscriptionCreateParams
                    .builder()
                    .setCustomer(customer.getId())
                    //Item Monthly
                    .addItem(
                        SubscriptionCreateParams
                        .Item.builder()
                        .setPrice(subscriptionPricingMonthly.getStripeSubscriptionItem())
                        .build()
                    )
                    //Item unit1
                    .addItem(
                        SubscriptionCreateParams
                        .Item.builder()
                        .setPrice(subscriptionPricingUnits.get(0).getStripeSubscriptionItem())
                        .build()
                    )


                    .setPaymentSettings(paymentSettings)
                    .setPaymentBehavior(SubscriptionCreateParams.PaymentBehavior.DEFAULT_INCOMPLETE)
                    .addAllExpand(Arrays.asList("latest_invoice.payment_intent"))
                    .build();```
#

ok I see

#

yes but this one is ok, I plan to send to Stripe a usage during the month

#

but as soon as the Subscription is created it generates a first invoice

#

and I don't want it

#

I would need:
1- create a subscription based on my products (1 monthly + 1 based on volume): this one is OK.
2- ask to the end user its payment details (OK thtrough StripeElements)
3- take into account Subscription payment details to Activate service for the end user
4- during the month we are sending to Stripe a usage based on UsageRecordCreateOnSubscriptionItemParams
5- at the end of the month we are generating the invoice and proceed for payment.

for now everything is working fine except that point 2 generates an invoice and I would prefer to wait for the end of the month to generate it.

#

Hope this is clear for you