All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.electrum.vas.model.BasicReversal Maven / Gradle / Ivy

There is a newer version: 3.19.0
Show newest version
package io.electrum.vas.model;

import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;

import io.electrum.vas.Utils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * An advice that notifies of the negative completion of a transaction. This can be either due to customer cancellation,
 * or as a result of receiving a non-final response (or no response) to a request
 */
@ApiModel(description = "An advice that notifies of the negative completion of a transaction. This can be either due to customer cancellation, or as a result of receiving a non-final response (or no response) to a request")
public class BasicReversal extends BasicAdvice {

   public enum ReversalReason {
      TIMEOUT("TIMEOUT"), CANCELLED("CANCELLED"), RESPONSE_NOT_FINAL("RESPONSE_NOT_FINAL");

      private String value;

      ReversalReason(String value) {
         this.value = value;
      }

      @Override
      @JsonValue
      public String toString() {
         return String.valueOf(value);
      }
   }

   protected ReversalReason reversalReason;

   /**
    * The reason for the reversal
    **/
   public BasicReversal reversalReason(ReversalReason reversalReason) {
      this.reversalReason = reversalReason;
      return this;
   }

   @ApiModelProperty(required = true, value = "The reason for the reversal")
   @JsonProperty("reversalReason")
   @NotNull
   public ReversalReason getReversalReason() {
      return reversalReason;
   }

   public void setReversalReason(ReversalReason reversalReason) {
      this.reversalReason = reversalReason;
   }

   @Override
   public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class BasicReversal {\n");

      sb.append("    id: ").append(Utils.toIndentedString(id)).append("\n");
      sb.append("    requestId: ").append(Utils.toIndentedString(requestId)).append("\n");
      sb.append("    time: ").append(Utils.toIndentedString(time)).append("\n");
      sb.append("    thirdPartyIdentifiers: ").append(Utils.toIndentedString(thirdPartyIdentifiers)).append("\n");
      sb.append("    reversalReason: ").append(Utils.toIndentedString(reversalReason)).append("\n");
      sb.append("}");
      return sb.toString();
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy