| POST | /donations/ach |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class DonationAchRequest 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;
/**
* Use GET /campaigns to retreive valid list of campaignIDs
*/
@ApiMember(Description="Use GET /campaigns to retreive valid list of campaignIDs")
public Integer CampaignId = null;
/**
* RoutingNumber and AccountNumber are not required if AchRef is provided
*/
@ApiMember(Description="RoutingNumber and AccountNumber are not required if AchRef is provided")
public String AchRef = null;
/**
* Required if AchRef is not provided
*/
@ApiMember(Description="Required if AchRef is not provided")
public String RoutingNumber = null;
/**
* Required if AchRef is not provided
*/
@ApiMember(Description="Required if AchRef is not provided")
public String AccountNumber = null;
public DonationDonorInfo getDonorInfo() { return DonorInfo; }
public DonationAchRequest setDonorInfo(DonationDonorInfo value) { this.DonorInfo = value; return this; }
public DonationMemberInfo getMemberInfo() { return MemberInfo; }
public DonationAchRequest setMemberInfo(DonationMemberInfo value) { this.MemberInfo = value; return this; }
public Integer getCampaignId() { return CampaignId; }
public DonationAchRequest setCampaignId(Integer value) { this.CampaignId = value; return this; }
public String getAchRef() { return AchRef; }
public DonationAchRequest setAchRef(String value) { this.AchRef = value; return this; }
public String getRoutingNumber() { return RoutingNumber; }
public DonationAchRequest setRoutingNumber(String value) { this.RoutingNumber = value; return this; }
public String getAccountNumber() { return AccountNumber; }
public DonationAchRequest setAccountNumber(String value) { this.AccountNumber = 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 DonationAchResponse 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 Integer getErrorCode() { return ErrorCode; }
public DonationAchResponse setErrorCode(Integer value) { this.ErrorCode = value; return this; }
public String getErrorMessage() { return ErrorMessage; }
public DonationAchResponse setErrorMessage(String value) { this.ErrorMessage = value; return this; }
public Boolean getIsError() { return IsError; }
public DonationAchResponse setIsError(Boolean value) { this.IsError = value; return this; }
public String getTransactionId() { return TransactionId; }
public DonationAchResponse setTransactionId(String value) { this.TransactionId = value; return this; }
}
}
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/ach 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,"AchRef":"String","RoutingNumber":"String","AccountNumber":"String","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"}