com.payu.sdk.api.util.ResponseUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-client Show documentation
Show all versions of api-client Show documentation
A fresh implementation of the PayU API Client for Android
The newest version!
package com.payu.sdk.api.util;
import com.payu.sdk.api.exceptions.PayUException;
import com.payu.sdk.api.exceptions.SDKException;
import com.payu.sdk.api.model.response.Response;
import com.payu.sdk.api.model.response.ResponseCode;
import com.payu.sdk.base.Preconditions;
public final class ResponseUtils {
private ResponseUtils() {
}
public static void validateResponse(Response response) throws PayUException {
if (!Preconditions.isNull(response)) {
if (!Preconditions.isNull(response.getCode())) {
if (ResponseCode.ERROR.equals(response.getCode())) {
throw new PayUException(SDKException.ErrorCode.API_ERROR, response.getError());
}
}
}
}
}