
com.vk.api.sdk.actions.Orders Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Java library for VK API interaction, includes OAuth 2.0 authorization and API methods.
The newest version!
package com.vk.api.sdk.actions;
import com.vk.api.sdk.client.AbstractAction;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.ServiceActor;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.enums.OrdersAction;
import com.vk.api.sdk.queries.orders.OrdersChangeStateQuery;
import com.vk.api.sdk.queries.orders.OrdersGetAmountQuery;
import com.vk.api.sdk.queries.orders.OrdersGetByIdQuery;
import com.vk.api.sdk.queries.orders.OrdersGetQuery;
import java.util.List;
/**
* List of Orders methods
*/
public class Orders extends AbstractAction {
/**
* Constructor
*
* @param client vk api client
*/
public Orders(VkApiClient client) {
super(client);
}
/**
* Returns a list of orders.
*
* @param actor vk actor
* @return query
*/
public OrdersGetQuery get(UserActor actor) {
return new OrdersGetQuery(getClient(), actor);
}
/**
* Returns a list of orders.
*
* @param actor vk actor
* @return query
*/
public OrdersGetQuery get(ServiceActor actor) {
return new OrdersGetQuery(getClient(), actor);
}
/**
* Returns information about orders by their IDs.
*
* @param actor vk actor
* @return query
*/
public OrdersGetByIdQuery getById(UserActor actor) {
return new OrdersGetByIdQuery(getClient(), actor);
}
/**
* Returns information about orders by their IDs.
*
* @param actor vk actor
* @return query
*/
public OrdersGetByIdQuery getById(ServiceActor actor) {
return new OrdersGetByIdQuery(getClient(), actor);
}
/**
* Changes order status.
*
* @param actor vk actor
* @param orderId order ID.
* @param action action to be done with the order. Available actions: *cancel — to cancel unconfirmed order. *charge — to confirm unconfirmed order. Applies only if processing of [vk.com/dev/payments_status|order_change_state] notification failed. *refund — to cancel confirmed order.
* @return query
*/
public OrdersChangeStateQuery changeState(UserActor actor, int orderId, OrdersAction action) {
return new OrdersChangeStateQuery(getClient(), actor, orderId, action);
}
/**
* Changes order status.
*
* @param actor vk actor
* @param orderId order ID.
* @param action action to be done with the order. Available actions: *cancel — to cancel unconfirmed order. *charge — to confirm unconfirmed order. Applies only if processing of [vk.com/dev/payments_status|order_change_state] notification failed. *refund — to cancel confirmed order.
* @return query
*/
public OrdersChangeStateQuery changeState(ServiceActor actor, int orderId,
OrdersAction action) {
return new OrdersChangeStateQuery(getClient(), actor, orderId, action);
}
/**
* @param actor vk actor
* @param userId
* @param votes
* @return query
*/
public OrdersGetAmountQuery getAmount(UserActor actor, int userId, String... votes) {
return new OrdersGetAmountQuery(getClient(), actor, userId, votes);
}
/**
* @param actor vk actor
* @param userId
* @param votes
* @return query
*/
public OrdersGetAmountQuery getAmount(UserActor actor, int userId, List votes) {
return new OrdersGetAmountQuery(getClient(), actor, userId, votes);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy