package com.stripe.model;
import com.stripe.exception.APIConnectionException;
import com.stripe.exception.APIException;
import com.stripe.exception.AuthenticationException;
import com.stripe.exception.CardException;
import com.stripe.exception.InvalidRequestException;
import com.stripe.net.APIResource;
import com.stripe.net.RequestOptions;
import java.util.Map;
public class FeeRefund extends APIResource implements MetadataStore<ApplicationFee>, HasId {
String id;
String object;
Long amount;
String balanceTransaction;
String currency;
Long created;
String fee;
Map<String, String> metadata;
public String getId() {
return id;
}
public String getObject() {
return object;
}
public void setObject(String object) {
this.object = object;
}
public Long getAmount() {
return amount;
}
public void setAmount(Long amount) {
this.amount = amount;
}
public String getBalanceTransaction() {
return balanceTransaction;
}
public void setBalanceTransaction(String balanceTransaction) {
this.balanceTransaction = balanceTransaction;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public Long getCreated() {
return created;
}
public void setCreated(Long created) {
this.created = created;
}
public String getFee() {
return fee;
}
public void setFee(String fee) {
this.fee = fee;
}
public Map<String, String> getMetadata() {
return metadata;
}
public void setMetadata(Map<String, String> metadata) {
this.metadata = metadata;
}
public FeeRefund update(Map<String, Object> params)
throws AuthenticationException, InvalidRequestException,
APIConnectionException, CardException, APIException {
return update(params, (RequestOptions) null);
}
@Deprecated
public FeeRefund update(Map<String, Object> params, String apiKey)
throws AuthenticationException, InvalidRequestException,
APIConnectionException, CardException, APIException {
return update(params, RequestOptions.builder().setApiKey(apiKey).build());
}
public FeeRefund update(Map<String, Object> params, RequestOptions options)
throws AuthenticationException, InvalidRequestException,
APIConnectionException, CardException, APIException {
return request(RequestMethod.POST, this.getInstanceURL(), params, FeeRefund.class, options);
}
public String getInstanceURL() {
if (this.fee != null) {
return String.format("%s/%s/refunds/%s", classURL(ApplicationFee.class), this.fee, this.getId());
}
return null;
}
}