Interface BillingEngineConnector


  • public interface BillingEngineConnector
    Connector interface for Stripe billing and subscription operations.
    • Method Detail

      • createSubscription

        SubscriptionInfo createSubscription​(String apiKey,
                                            String customerId,
                                            String priceId)
                                     throws MonetizationException
        Creates a new subscription in Stripe using an existing customer and price ID.
        Parameters:
        apiKey - apiKey
        customerId - customerId
        priceId - priceId
        Returns:
        SubscriptionInfo SubscriptionInfo
        Throws:
        MonetizationException - MonetizationException
      • ensureWebhookEndpoint

        WebhookProvisionResult ensureWebhookEndpoint​(String apiKey,
                                                     String endpointUrl,
                                                     List<String> enabledEvents,
                                                     Map<String,​String> metadata)
                                              throws MonetizationException
        Create or update a webhook endpoint in the billing engine (Stripe).
        Parameters:
        apiKey - Billing engine secret key
        endpointUrl - Target webhook URL (DevPortal or Moesif URL)
        enabledEvents - Stripe event types (e.g., "invoice.paid"). Use ["*"] to enable all if needed.
        metadata - Optional metadata tags to identify the endpoint later
        Returns:
        result containing endpoint id + signing secret (secret is only available when created)
        Throws:
        MonetizationException - if webhook endpoint creation fails