public final class SetReturnPaymentState extends UpdateActionImpl<Order>
See also OrderUpdateCommand.
withOrderAndReturnInfo(client(), (order, returnInfo) -> { final ReturnItem returnItem = returnInfo.getItems().get(0); final ReturnPaymentState newPaymentState = ReturnPaymentState.REFUNDED; assertThat(returnItem.getPaymentState()).isNotEqualTo(newPaymentState); final SetReturnPaymentState action = SetReturnPaymentState.of(returnItem, newPaymentState); final Order updatedOrder = client().executeBlocking(OrderUpdateCommand.of(order, action)); final ReturnPaymentState updatedPaymentState = updatedOrder.getReturnInfo().get(0).getItems().get(0).getPaymentState(); assertThat(updatedPaymentState).isEqualTo(newPaymentState); return updatedOrder; });
See the test code.
Modifier and Type | Method and Description |
---|---|
ReturnPaymentState |
getPaymentState() |
String |
getReturnItemId() |
static SetReturnPaymentState |
of(ReturnItem returnItem,
ReturnPaymentState paymentState) |
static SetReturnPaymentState |
of(String returnItemId,
ReturnPaymentState paymentState) |
getAction
public String getReturnItemId()
public ReturnPaymentState getPaymentState()
public static SetReturnPaymentState of(String returnItemId, ReturnPaymentState paymentState)
public static SetReturnPaymentState of(ReturnItem returnItem, ReturnPaymentState paymentState)