Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
POST | /billing/company/creditcard | Add a new credit card with Ticket Id from payment solution. | Add new credit card from payment solution with their ticket id. |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
@ValidateRequest(Validator="IsAuthenticated")
public static class CreateCompanyCreditCard implements ICompany
{
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
@ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
public UUID CompanyId = null;
/**
* The credit card name
*/
@ApiMember(Description="The credit card name")
public String Name = null;
/**
* The credit card type. In example Mastercard, Visa
*/
@ApiMember(Description="The credit card type. In example Mastercard, Visa")
public String Type = null;
/**
* The credit card expiration Year
*/
@ApiMember(Description="The credit card expiration Year")
public String ExpYear = null;
/**
* The credit card expiration month
*/
@ApiMember(Description="The credit card expiration month")
public String ExpMonth = null;
/**
* The credit card ticket name. This is secret information and won't be displayed
*/
@ApiMember(Description="The credit card ticket name. This is secret information and won't be displayed")
public String TicketId = null;
public UUID getCompanyId() { return CompanyId; }
public CreateCompanyCreditCard setCompanyId(UUID value) { this.CompanyId = value; return this; }
public String getName() { return Name; }
public CreateCompanyCreditCard setName(String value) { this.Name = value; return this; }
public String getType() { return Type; }
public CreateCompanyCreditCard setType(String value) { this.Type = value; return this; }
public String getExpYear() { return ExpYear; }
public CreateCompanyCreditCard setExpYear(String value) { this.ExpYear = value; return this; }
public String getExpMonth() { return ExpMonth; }
public CreateCompanyCreditCard setExpMonth(String value) { this.ExpMonth = value; return this; }
public String getTicketId() { return TicketId; }
public CreateCompanyCreditCard setTicketId(String value) { this.TicketId = value; return this; }
}
public static class CompanyCreditCardQueryResponse
{
/**
* The credit card id
*/
@ApiMember(Description="The credit card id")
public Integer Id = null;
/**
* The credit card name
*/
@ApiMember(Description="The credit card name")
public String Name = null;
/**
* If the credit card is active
*/
@ApiMember(Description="If the credit card is active")
public Boolean Active = null;
/**
* If the credit card is valid (active and not expired)
*/
@ApiMember(Description="If the credit card is valid (active and not expired)")
public Boolean IsValid = null;
/**
* The credit card type
*/
@ApiMember(Description="The credit card type")
public String Type = null;
/**
* The credit card expiration Year
*/
@ApiMember(Description="The credit card expiration Year")
public String ExpYear = null;
/**
* The credit card expiration month
*/
@ApiMember(Description="The credit card expiration month")
public String ExpMonth = null;
/**
* The credit card ticket name. This is secret information and won't be displayed
*/
@ApiMember(Description="The credit card ticket name. This is secret information and won't be displayed")
public String TicketId = null;
/**
* The date when the credit card was saved.
*/
@ApiMember(Description="The date when the credit card was saved.")
public Date Created = null;
/**
* The date when the credit card was updated.
*/
@ApiMember(Description="The date when the credit card was updated.")
public Date Updated = null;
public Integer getId() { return Id; }
public CompanyCreditCardQueryResponse setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public CompanyCreditCardQueryResponse setName(String value) { this.Name = value; return this; }
public Boolean isActive() { return Active; }
public CompanyCreditCardQueryResponse setActive(Boolean value) { this.Active = value; return this; }
public Boolean getIsValid() { return IsValid; }
public CompanyCreditCardQueryResponse setIsValid(Boolean value) { this.IsValid = value; return this; }
public String getType() { return Type; }
public CompanyCreditCardQueryResponse setType(String value) { this.Type = value; return this; }
public String getExpYear() { return ExpYear; }
public CompanyCreditCardQueryResponse setExpYear(String value) { this.ExpYear = value; return this; }
public String getExpMonth() { return ExpMonth; }
public CompanyCreditCardQueryResponse setExpMonth(String value) { this.ExpMonth = value; return this; }
public String getTicketId() { return TicketId; }
public CompanyCreditCardQueryResponse setTicketId(String value) { this.TicketId = value; return this; }
public Date getCreated() { return Created; }
public CompanyCreditCardQueryResponse setCreated(Date value) { this.Created = value; return this; }
public Date getUpdated() { return Updated; }
public CompanyCreditCardQueryResponse setUpdated(Date value) { this.Updated = value; return this; }
}
}
Java CreateCompanyCreditCard DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /billing/company/creditcard HTTP/1.1
Host: api.bokamera.se
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","Name":"String","Type":"String","ExpYear":"String","ExpMonth":"String","TicketId":"String"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Id":0,"Name":"String","Active":false,"IsValid":false,"Type":"String","ExpYear":"String","ExpMonth":"String","TicketId":"String","Created":"0001-01-01T00:00:00","Updated":"0001-01-01T00:00:00"}