com.univapay.sdk.resources.ChargesResource Maven / Gradle / Ivy
package com.univapay.sdk.resources;
import com.univapay.sdk.constants.UnivapayConstants;
import com.univapay.sdk.models.common.ChargeId;
import com.univapay.sdk.models.common.IdempotencyKey;
import com.univapay.sdk.models.common.StoreId;
import com.univapay.sdk.models.common.Void;
import com.univapay.sdk.models.request.charge.CaptureReq;
import com.univapay.sdk.models.request.charge.ChargesReq;
import com.univapay.sdk.models.request.charge.PatchReq;
import com.univapay.sdk.models.response.PaginatedList;
import com.univapay.sdk.models.response.charge.Charge;
import com.univapay.sdk.types.CursorDirection;
import java.util.Map;
import org.jetbrains.annotations.Nullable;
import retrofit2.Call;
import retrofit2.http.*;
public interface ChargesResource {
@GET("/charges")
Call> listAllCharges(
@Query("limit") @Nullable Integer limit,
@Query("cursor_direction") @Nullable CursorDirection cursorDirection,
@Query("cursor") @Nullable ChargeId cursor,
@QueryMap @Nullable Map propertySearch,
@Query("metadata") @Nullable String metadataSearch);
@GET("/stores/{storeId}/charges")
Call> listAllStoreCharges(
@Path("storeId") StoreId storeId,
@Query("limit") @Nullable Integer limit,
@Query("cursor_direction") @Nullable CursorDirection cursorDirection,
@Query("cursor") @Nullable ChargeId cursor,
@QueryMap @Nullable Map propertySearch,
@Query("metadata") @Nullable String metadataSearch);
@GET("/stores/{storeId}/charges/{id}")
Call getStoreCharge(
@Path("storeId") StoreId storeId,
@Path("id") ChargeId id,
@Query("polling") @Nullable Boolean polling);
@POST("/charges")
Call createCharge(
@Body ChargesReq requestBody,
@Header(UnivapayConstants.idempotencyKeyHeaderName) IdempotencyKey idempotencyKey);
@PATCH("/stores/{storeId}/charges/{id}")
Call updateCharge(
@Path("storeId") StoreId storeId,
@Path("id") ChargeId id,
@Body PatchReq requestBody,
@Header(UnivapayConstants.idempotencyKeyHeaderName) IdempotencyKey idempotencyKey);
@POST("/stores/{storeId}/charges/{id}/capture")
Call capture(
@Path("storeId") StoreId storeId,
@Path("id") ChargeId id,
@Body CaptureReq requestBody,
@Header(UnivapayConstants.idempotencyKeyHeaderName) IdempotencyKey idempotencyKey);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy