| POST | /donations/creditcard |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class DonationCreditCardRequest extends DonationRequestBase implements IDonationRequestWithDonorInfo
{
/**
* Not required if MemberInfo is present on request
*/
@ApiMember(Description="Not required if MemberInfo is present on request")
public DonationDonorInfo DonorInfo = null;
/**
* Not required if DonorInfo is present on request
*/
@ApiMember(Description="Not required if DonorInfo is present on request")
public DonationMemberInfo MemberInfo = null;
/**
* Campaign to track donation against and to define fund allocation. Use GET /campaigns to retreive valid list of campaignIDs
*/
@ApiMember(Description="Campaign to track donation against and to define fund allocation. Use GET /campaigns to retreive valid list of campaignIDs")
public Integer CampaignId = null;
/**
* CardRef returned from client-side tokenization. Also handles raw card number if your servers are PCI-DSS-compliant, and in that case this must be a valid card number for the CardType indicated.
*/
@ApiMember(Description="CardRef returned from client-side tokenization. Also handles raw card number if your servers are PCI-DSS-compliant, and in that case this must be a valid card number for the CardType indicated.", IsRequired=true, Name="CardReferenceOrCardNumber")
public String CardReferenceOrCardNumber = null;
public String CardType = null;
/**
* Credit Card Validation value. If Visa, Master Card or Discover, must be 3 digits. If AmEx, must be 4 digits.
*/
@ApiMember(Description="Credit Card Validation value. If Visa, Master Card or Discover, must be 3 digits. If AmEx, must be 4 digits.", Name="Cvv")
public String Cvv = null;
@ApiMember(IsRequired=true)
// @ApiMember(Description="Credit Card expiration month. Valid Values 1-12.", IsRequired=true, Name="ExpirationMonth")
public Integer ExpirationMonth = null;
/**
* Credit Card expiration year. Four-digit Year. Value cannot be less than current year or more than 20 years in the future. ExpMonth + ExpYear must not be in the past.
*/
@ApiMember(Description="Credit Card expiration year. Four-digit Year. Value cannot be less than current year or more than 20 years in the future. ExpMonth + ExpYear must not be in the past.", IsRequired=true, Name="ExpirationYear")
public Integer ExpirationYear = null;
public DonationDonorInfo getDonorInfo() { return DonorInfo; }
public DonationCreditCardRequest setDonorInfo(DonationDonorInfo value) { this.DonorInfo = value; return this; }
public DonationMemberInfo getMemberInfo() { return MemberInfo; }
public DonationCreditCardRequest setMemberInfo(DonationMemberInfo value) { this.MemberInfo = value; return this; }
public Integer getCampaignId() { return CampaignId; }
public DonationCreditCardRequest setCampaignId(Integer value) { this.CampaignId = value; return this; }
public String getCardReferenceOrCardNumber() { return CardReferenceOrCardNumber; }
public DonationCreditCardRequest setCardReferenceOrCardNumber(String value) { this.CardReferenceOrCardNumber = value; return this; }
public String getCardType() { return CardType; }
public DonationCreditCardRequest setCardType(String value) { this.CardType = value; return this; }
public String getCvv() { return Cvv; }
public DonationCreditCardRequest setCvv(String value) { this.Cvv = value; return this; }
public Integer getExpirationMonth() { return ExpirationMonth; }
public DonationCreditCardRequest setExpirationMonth(Integer value) { this.ExpirationMonth = value; return this; }
public Integer getExpirationYear() { return ExpirationYear; }
public DonationCreditCardRequest setExpirationYear(Integer value) { this.ExpirationYear = value; return this; }
}
public static class DonationRequestBase
{
/**
* Client value for Group. String must already be configured in Billhighway system.
*/
@ApiMember(Description="Client value for Group. String must already be configured in Billhighway system.", IsRequired=true, Name="GroupID")
public String GroupId = null;
/**
* Amount of the payment. Must be an amount less than $10,000,000.00.
*/
@ApiMember(Description="Amount of the payment. Must be an amount less than $10,000,000.00.", IsRequired=true, Name="Amount")
public BigDecimal Amount = null;
/**
* The currency the payment is being made in. Three digit currency code (see ISO 4217) for a valid currency supported by Billhighway. Defaults to USD
*/
@ApiMember(Description="The currency the payment is being made in. Three digit currency code (see ISO 4217) for a valid currency supported by Billhighway. Defaults to USD", ExcludeInSchema=true, Name="CurrencyCode")
public String CurrencyCode = null;
/**
* Notes about the donation. Maximum 70 characters.
*/
@ApiMember(Description="Notes about the donation. Maximum 70 characters.", Name="Memo")
public String Memo = null;
@ApiMember()
public DonationRecurringInfo DonationRecurringInfo = null;
/**
* Custom fields
*/
@ApiMember(Description="Custom fields", Name="MetaData")
public JsonObject MetaData = null;
public String getGroupId() { return GroupId; }
public DonationRequestBase setGroupId(String value) { this.GroupId = value; return this; }
public BigDecimal getAmount() { return Amount; }
public DonationRequestBase setAmount(BigDecimal value) { this.Amount = value; return this; }
public String getCurrencyCode() { return CurrencyCode; }
public DonationRequestBase setCurrencyCode(String value) { this.CurrencyCode = value; return this; }
public String getMemo() { return Memo; }
public DonationRequestBase setMemo(String value) { this.Memo = value; return this; }
public DonationRecurringInfo getDonationRecurringInfo() { return DonationRecurringInfo; }
public DonationRequestBase setDonationRecurringInfo(DonationRecurringInfo value) { this.DonationRecurringInfo = value; return this; }
public JsonObject getMetaData() { return MetaData; }
public DonationRequestBase setMetaData(JsonObject value) { this.MetaData = value; return this; }
}
public static class DonationRecurringInfo
{
/**
* How often donation is collected automatically
*/
@ApiMember(Description="How often donation is collected automatically", IsRequired=true, Name="Frequency")
public String Frequency = null;
/**
* Number of recurring donation cycles.
*/
@ApiMember(Description="Number of recurring donation cycles.", IsRequired=true, Name="NumberOfOccurrences")
public Integer NumberOfOccurrences = null;
/**
* Allows the submitter to set a future date for the donation
*/
@ApiMember(Description="Allows the submitter to set a future date for the donation", Name="FutureDonationDate")
public Date FutureDonationDate = null;
public String getFrequency() { return Frequency; }
public DonationRecurringInfo setFrequency(String value) { this.Frequency = value; return this; }
public Integer getNumberOfOccurrences() { return NumberOfOccurrences; }
public DonationRecurringInfo setNumberOfOccurrences(Integer value) { this.NumberOfOccurrences = value; return this; }
public Date getFutureDonationDate() { return FutureDonationDate; }
public DonationRecurringInfo setFutureDonationDate(Date value) { this.FutureDonationDate = value; return this; }
}
public static class JsonObject extends HashMap<String,String>
{
}
public static class DonationDonorInfo
{
/**
* Name of donor. Maximum 100 characters. Format must be Firstname {space} Lastname.
*/
@ApiMember(Description="Name of donor. Maximum 100 characters. Format must be Firstname {space} Lastname.", IsRequired=true, Name="FullName")
public String FullName = null;
/**
* Billing address. Maximum 100 characters.
*/
@ApiMember(Description="Billing address. Maximum 100 characters.", IsRequired=true, Name="Address")
public String Address = null;
/**
* Billing city. Maximum 100 characters.
*/
@ApiMember(Description="Billing city. Maximum 100 characters.", IsRequired=true, Name="City")
public String City = null;
/**
* Billing state. Two characters, must match valid US state code.
*/
@ApiMember(Description="Billing state. Two characters, must match valid US state code.", IsRequired=true, Name="State")
public String State = null;
/**
* Credit Card billing address postal code. Maximum 10 characters.
*/
@ApiMember(Description="Credit Card billing address postal code. Maximum 10 characters.", IsRequired=true, Name="PostalCode")
public String PostalCode = null;
/**
* Email address of donor. Maximum 100 characters. If provided, must be valid email format.
*/
@ApiMember(Description="Email address of donor. Maximum 100 characters. If provided, must be valid email format.", Name="EmailAddress")
public String EmailAddress = null;
/**
* Preferred phone number. Maximum 12 characters.
*/
@ApiMember(Description="Preferred phone number. Maximum 12 characters.", Name="Phone")
public String Phone = null;
public String getFullName() { return FullName; }
public DonationDonorInfo setFullName(String value) { this.FullName = value; return this; }
public String getAddress() { return Address; }
public DonationDonorInfo setAddress(String value) { this.Address = value; return this; }
public String getCity() { return City; }
public DonationDonorInfo setCity(String value) { this.City = value; return this; }
public String getState() { return State; }
public DonationDonorInfo setState(String value) { this.State = value; return this; }
public String getPostalCode() { return PostalCode; }
public DonationDonorInfo setPostalCode(String value) { this.PostalCode = value; return this; }
public String getEmailAddress() { return EmailAddress; }
public DonationDonorInfo setEmailAddress(String value) { this.EmailAddress = value; return this; }
public String getPhone() { return Phone; }
public DonationDonorInfo setPhone(String value) { this.Phone = value; return this; }
}
public static class DonationMemberInfo
{
@ApiMember(IsRequired=true)
public Integer BhUserId = null;
public Integer getBhUserId() { return BhUserId; }
public DonationMemberInfo setBhUserId(Integer value) { this.BhUserId = value; return this; }
}
public static class DonationCreditCardResponse implements IHaveErrorField
{
/**
* Legacy ErrorCode
*/
@ApiMember(Description="Legacy ErrorCode", ExcludeInSchema=true)
@Ignore()
public Integer ErrorCode = null;
public String ErrorMessage = null;
public Boolean IsError = null;
/**
* Donation Transaction ID
*/
@ApiMember(Description="Donation Transaction ID")
public String TransactionId = null;
public String CardRef = null;
public Integer getErrorCode() { return ErrorCode; }
public DonationCreditCardResponse setErrorCode(Integer value) { this.ErrorCode = value; return this; }
public String getErrorMessage() { return ErrorMessage; }
public DonationCreditCardResponse setErrorMessage(String value) { this.ErrorMessage = value; return this; }
public Boolean getIsError() { return IsError; }
public DonationCreditCardResponse setIsError(Boolean value) { this.IsError = value; return this; }
public String getTransactionId() { return TransactionId; }
public DonationCreditCardResponse setTransactionId(String value) { this.TransactionId = value; return this; }
public String getCardRef() { return CardRef; }
public DonationCreditCardResponse setCardRef(String value) { this.CardRef = value; return this; }
}
}
Java DonationCreditCardRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /donations/creditcard HTTP/1.1
Host: devapi.billhighway.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"DonorInfo":{"FullName":"String","Address":"String","City":"String","State":"String","PostalCode":"String","EmailAddress":"String","Phone":"String"},"MemberInfo":{"BhUserId":0},"CampaignId":0,"CardReferenceOrCardNumber":"String","CardType":"String","Cvv":"String","ExpirationMonth":0,"ExpirationYear":0,"GroupId":"String","Amount":0,"CurrencyCode":"String","Memo":"String","DonationRecurringInfo":{"Frequency":"String","NumberOfOccurrences":0,"FutureDonationDate":"0001-01-01T00:00:00.0000000"},"MetaData":{"String":"String"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ErrorCode":0,"ErrorMessage":"String","IsError":false,"TransactionId":"String","CardRef":"String"}