Package org.wso2.am.monetization.api
Interface BillingEngineConnector
-
public interface BillingEngineConnectorConnector interface for Stripe billing and subscription operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CustomercreateCustomer(String apiKey, Customer customer)Creates a customer record in Stripe.SubscriptionInfocreateSubscription(String apiKey, String customerId, String priceId)Creates a new subscription in Stripe using an existing customer and price ID.WebhookProvisionResultensureWebhookEndpoint(String apiKey, String endpointUrl, List<String> enabledEvents, Map<String,String> metadata)Create or update a webhook endpoint in the billing engine (Stripe).
-
-
-
Method Detail
-
createCustomer
Customer createCustomer(String apiKey, Customer customer) throws MonetizationException
Creates a customer record in Stripe.- Parameters:
apiKey- apiKeycustomer- customer- Returns:
- Customer Customer
- Throws:
MonetizationException- MonetizationException
-
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- apiKeycustomerId- customerIdpriceId- 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 keyendpointUrl- 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
-
-