Search in sources :

Example 96 with Entitlement

use of org.killbill.billing.entitlement.api.Entitlement in project killbill by killbill.

the class SubscriptionResource method uncancelSubscriptionPlan.

@TimedResource
@PUT
@Path("/{subscriptionId:" + UUID_PATTERN + "}/" + UNDO_CANCEL)
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Un-cancel an entitlement")
@ApiResponses(value = { @ApiResponse(code = 204, message = "Successful operation"), @ApiResponse(code = 400, message = "Invalid subscription id supplied"), @ApiResponse(code = 404, message = "Entitlement not found") })
public Response uncancelSubscriptionPlan(@PathParam("subscriptionId") final UUID subscriptionId, @QueryParam(QUERY_PLUGIN_PROPERTY) final List<String> pluginPropertiesString, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment, @javax.ws.rs.core.Context final HttpServletRequest request) throws EntitlementApiException {
    final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString);
    final Entitlement current = entitlementApi.getEntitlementForId(subscriptionId, context.createCallContextNoAccountId(createdBy, reason, comment, request));
    current.uncancelEntitlement(pluginProperties, context.createCallContextNoAccountId(createdBy, reason, comment, request));
    return Response.status(Status.NO_CONTENT).build();
}
Also used : PluginProperty(org.killbill.billing.payment.api.PluginProperty) Entitlement(org.killbill.billing.entitlement.api.Entitlement) Path(javax.ws.rs.Path) TimedResource(org.killbill.commons.metrics.TimedResource) Produces(javax.ws.rs.Produces) ApiOperation(io.swagger.annotations.ApiOperation) PUT(javax.ws.rs.PUT) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

Entitlement (org.killbill.billing.entitlement.api.Entitlement)96 LocalDate (org.joda.time.LocalDate)76 Account (org.killbill.billing.account.api.Account)71 PlanPhaseSpecifier (org.killbill.billing.catalog.api.PlanPhaseSpecifier)68 Test (org.testng.annotations.Test)68 UUID (java.util.UUID)64 DefaultEntitlementSpecifier (org.killbill.billing.entitlement.api.DefaultEntitlementSpecifier)64 DefaultEntitlement (org.killbill.billing.entitlement.api.DefaultEntitlement)53 BigDecimal (java.math.BigDecimal)37 ExpectedInvoiceItemCheck (org.killbill.billing.beatrix.util.InvoiceChecker.ExpectedInvoiceItemCheck)34 DateTime (org.joda.time.DateTime)32 Invoice (org.killbill.billing.invoice.api.Invoice)27 PluginProperty (org.killbill.billing.payment.api.PluginProperty)22 ArrayList (java.util.ArrayList)20 EntitlementApiException (org.killbill.billing.entitlement.api.EntitlementApiException)18 BillingPeriod (org.killbill.billing.catalog.api.BillingPeriod)16 ApiOperation (io.swagger.annotations.ApiOperation)14 ApiResponses (io.swagger.annotations.ApiResponses)14 TimedResource (org.killbill.commons.metrics.TimedResource)14 Produces (javax.ws.rs.Produces)13