Billhighway Cloud API

<back to all web services

DonationCreditCardRequest

The following routes are available for this service:
POST/donations/creditcard

export class DonationRecurringInfo
{
    /**
    * How often donation is collected automatically
    */
    // @ApiMember(Description="How often donation is collected automatically", IsRequired=true, Name="Frequency")
    public Frequency?: string;

    /**
    * Number of recurring donation cycles.
    */
    // @ApiMember(Description="Number of recurring donation cycles.", IsRequired=true, Name="NumberOfOccurrences")
    public NumberOfOccurrences: number;

    /**
    * 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 FutureDonationDate?: string;

    public constructor(init?: Partial<DonationRecurringInfo>) { (Object as any).assign(this, init); }
}

export class Dictionary<T> { [Key: string]: T; }

export class JsonObject extends Dictionary<string>
{

    public constructor(init?: Partial<JsonObject>) { super(); (Object as any).assign(this, init); }
}

export 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 GroupId?: string;

    /**
    * 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 Amount: number;

    /**
    * 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 CurrencyCode?: string;

    /**
    * Notes about the donation. Maximum 70 characters.
    */
    // @ApiMember(Description="Notes about the donation. Maximum 70 characters.", Name="Memo")
    public Memo?: string;

    // @ApiMember()
    public DonationRecurringInfo?: DonationRecurringInfo;

    /**
    * Custom fields
    */
    // @ApiMember(Description="Custom fields", Name="MetaData")
    public MetaData?: JsonObject;

    public constructor(init?: Partial<DonationRequestBase>) { (Object as any).assign(this, init); }
}

export class DonationCreditCardResponse implements IHaveErrorField
{
    /**
    * Legacy ErrorCode
    */
    // @ApiMember(Description="Legacy ErrorCode", ExcludeInSchema=true)
    // @Ignore()
    public ErrorCode?: number;

    public ErrorMessage?: string;
    public IsError?: boolean;
    /**
    * Donation Transaction ID
    */
    // @ApiMember(Description="Donation Transaction ID")
    public TransactionId?: string;

    public CardRef?: string;

    public constructor(init?: Partial<DonationCreditCardResponse>) { (Object as any).assign(this, init); }
}

export 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 FullName?: string;

    /**
    * Billing address. Maximum 100 characters.
    */
    // @ApiMember(Description="Billing address. Maximum 100 characters.", IsRequired=true, Name="Address")
    public Address?: string;

    /**
    * Billing city. Maximum 100 characters.
    */
    // @ApiMember(Description="Billing city. Maximum 100 characters.", IsRequired=true, Name="City")
    public City?: string;

    /**
    * 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 State?: string;

    /**
    * 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 PostalCode?: string;

    /**
    * 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 EmailAddress?: string;

    /**
    * Preferred phone number. Maximum 12 characters.
    */
    // @ApiMember(Description="Preferred phone number. Maximum 12 characters.", Name="Phone")
    public Phone?: string;

    public constructor(init?: Partial<DonationDonorInfo>) { (Object as any).assign(this, init); }
}

export class DonationMemberInfo
{
    // @ApiMember(IsRequired=true)
    public BhUserId: number;

    public constructor(init?: Partial<DonationMemberInfo>) { (Object as any).assign(this, init); }
}

export 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 DonorInfo?: DonationDonorInfo;

    /**
    * Not required if DonorInfo is present on request
    */
    // @ApiMember(Description="Not required if DonorInfo is present on request")
    public MemberInfo?: DonationMemberInfo;

    /**
    * 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 CampaignId?: number;

    /**
    * 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 CardReferenceOrCardNumber?: string;

    public CardType?: string;
    /**
    * 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 Cvv?: string;

    // @ApiMember(IsRequired=true)
    // @ApiMember(Description="Credit Card expiration month. Valid Values 1-12.", IsRequired=true, Name="ExpirationMonth")
    public ExpirationMonth: number;

    /**
    * 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 ExpirationYear: number;

    public constructor(init?: Partial<DonationCreditCardRequest>) { super(init); (Object as any).assign(this, init); }
}

TypeScript DonationCreditCardRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

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/xml
Content-Type: application/xml
Content-Length: length

<DonationCreditCardRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.Donations">
  <Amount>0</Amount>
  <CurrencyCode>String</CurrencyCode>
  <DonationRecurringInfo>
    <Frequency>String</Frequency>
    <FutureDonationDate>0001-01-01T00:00:00</FutureDonationDate>
    <NumberOfOccurrences>0</NumberOfOccurrences>
  </DonationRecurringInfo>
  <GroupId>String</GroupId>
  <Memo>String</Memo>
  <MetaData xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </MetaData>
  <CampaignId>0</CampaignId>
  <CardReferenceOrCardNumber>String</CardReferenceOrCardNumber>
  <CardType>String</CardType>
  <Cvv>String</Cvv>
  <DonorInfo>
    <Address>String</Address>
    <City>String</City>
    <EmailAddress>String</EmailAddress>
    <FullName>String</FullName>
    <Phone>String</Phone>
    <PostalCode>String</PostalCode>
    <State>String</State>
  </DonorInfo>
  <ExpirationMonth>0</ExpirationMonth>
  <ExpirationYear>0</ExpirationYear>
  <MemberInfo>
    <BhUserId>0</BhUserId>
  </MemberInfo>
</DonationCreditCardRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DonationCreditCardResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.Donations">
  <CardRef>String</CardRef>
  <ErrorCode>0</ErrorCode>
  <ErrorMessage>String</ErrorMessage>
  <IsError>false</IsError>
  <TransactionId>String</TransactionId>
</DonationCreditCardResponse>