#amol_08238

1 messages · Page 1 of 1 (latest)

frail reefBOT
#

Hello! We'll be with you shortly. 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.

zealous root
#

hi there!

subtle cave
#

hi

zealous root
subtle cave
#

ok i'll try it put thanks.

zealous root
#

happy to help 🙂

subtle cave
#

Hi, how to pass subscription items in list without using SubscriptionItem.create. Becasue SubscriptionItem.Create will actually create these subscription items before getting invoice preview.

vital mirage
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

#

What programming language are you using?

subtle cave
#

I am using java

vital mirage
#

What does your code look like now?

subtle cave
#

public void previewInvoice(PreviewInvoiceRequest previewInvoiceRequest, StreamObserver<PreviewInvoiceResponse> responseObserver) {
SubscriptionDetail subscriptionDetail = subscriptionService.getSubscriptionsDetails(previewInvoiceRequest.getProviderOrganizationId());

    if(subscriptionDetail == null) {
        logger.error("Subscription not found for provider id {}", previewInvoiceRequest.getProviderOrganizationId());
        Status status = Status.INTERNAL.withDescription("Failed to find subscription details for organization.");
        responseObserver.onError(status.asRuntimeException());
    }

    List<String> productIds = previewInvoiceRequest.getProductsToAddList();

    List<String> pricingIds = getPricingIdsByProductIds(productIds);
    Stripe.apiKey = ''";


    InvoiceUpcomingParams params =
            InvoiceUpcomingParams.builder()
                    .setCustomer(subscriptionDetail.getProviderCustomer().getStripeCustomerId())
                    .setSubscription(subscriptionDetail.getStripeSubscriptionId())
                    .addAllSubscriptionItem()
                    .build();

    Invoice invoice = Invoice.upcoming(params);

}

#

here if you see I cant find a way to create subscriotionitems

vital mirage