| POST | /donations/creditcard |
|---|
namespace BH.CloudAPI.Common4.DTO.Donations
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type DonationCreditCardResponse() =
///<summary>
///Legacy ErrorCode
///</summary>
[<ApiMember(Description="Legacy ErrorCode", ExcludeInSchema=true)>]
[<Ignore>]
member val ErrorCode:Int32 = new Int32() with get,set
member val ErrorMessage:String = null with get,set
member val IsError:Boolean = new Boolean() with get,set
///<summary>
///Donation Transaction ID
///</summary>
[<ApiMember(Description="Donation Transaction ID")>]
member val TransactionId:String = null with get,set
member val CardRef:String = null with get,set
[<AllowNullLiteral>]
type DonationRecurringInfo() =
///<summary>
///How often donation is collected automatically
///</summary>
[<ApiMember(Description="How often donation is collected automatically", IsRequired=true, Name="Frequency")>]
member val Frequency:String = null with get,set
///<summary>
///Number of recurring donation cycles.
///</summary>
[<ApiMember(Description="Number of recurring donation cycles.", IsRequired=true, Name="NumberOfOccurrences")>]
member val NumberOfOccurrences:Int32 = new Int32() with get,set
///<summary>
///Allows the submitter to set a future date for the donation
///</summary>
[<ApiMember(Description="Allows the submitter to set a future date for the donation", Name="FutureDonationDate")>]
member val FutureDonationDate:Nullable<DateTime> = new Nullable<DateTime>() with get,set
[<AllowNullLiteral>]
type JsonObject() =
inherit Dictionary<String, String>()
[<AllowNullLiteral>]
type DonationRequestBase() =
///<summary>
///Client value for Group. String must already be configured in Billhighway system.
///</summary>
[<ApiMember(Description="Client value for Group. String must already be configured in Billhighway system.", IsRequired=true, Name="GroupID")>]
member val GroupId:String = null with get,set
///<summary>
///Amount of the payment. Must be an amount less than $10,000,000.00.
///</summary>
[<ApiMember(Description="Amount of the payment. Must be an amount less than $10,000,000.00.", IsRequired=true, Name="Amount")>]
member val Amount:Decimal = new Decimal() with get,set
///<summary>
///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
///</summary>
[<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")>]
member val CurrencyCode:String = null with get,set
///<summary>
///Notes about the donation. Maximum 70 characters.
///</summary>
[<ApiMember(Description="Notes about the donation. Maximum 70 characters.", Name="Memo")>]
member val Memo:String = null with get,set
[<ApiMember>]
member val DonationRecurringInfo:DonationRecurringInfo = null with get,set
///<summary>
///Custom fields
///</summary>
[<ApiMember(Description="Custom fields", Name="MetaData")>]
member val MetaData:JsonObject = null with get,set
[<AllowNullLiteral>]
type DonationDonorInfo() =
///<summary>
///Name of donor. Maximum 100 characters. Format must be Firstname {space} Lastname.
///</summary>
[<ApiMember(Description="Name of donor. Maximum 100 characters. Format must be Firstname {space} Lastname.", IsRequired=true, Name="FullName")>]
member val FullName:String = null with get,set
///<summary>
///Billing address. Maximum 100 characters.
///</summary>
[<ApiMember(Description="Billing address. Maximum 100 characters.", IsRequired=true, Name="Address")>]
member val Address:String = null with get,set
///<summary>
///Billing city. Maximum 100 characters.
///</summary>
[<ApiMember(Description="Billing city. Maximum 100 characters.", IsRequired=true, Name="City")>]
member val City:String = null with get,set
///<summary>
///Billing state. Two characters, must match valid US state code.
///</summary>
[<ApiMember(Description="Billing state. Two characters, must match valid US state code.", IsRequired=true, Name="State")>]
member val State:String = null with get,set
///<summary>
///Credit Card billing address postal code. Maximum 10 characters.
///</summary>
[<ApiMember(Description="Credit Card billing address postal code. Maximum 10 characters.", IsRequired=true, Name="PostalCode")>]
member val PostalCode:String = null with get,set
///<summary>
///Email address of donor. Maximum 100 characters. If provided, must be valid email format.
///</summary>
[<ApiMember(Description="Email address of donor. Maximum 100 characters. If provided, must be valid email format.", Name="EmailAddress")>]
member val EmailAddress:String = null with get,set
///<summary>
///Preferred phone number. Maximum 12 characters.
///</summary>
[<ApiMember(Description="Preferred phone number. Maximum 12 characters.", Name="Phone")>]
member val Phone:String = null with get,set
[<AllowNullLiteral>]
type DonationMemberInfo() =
[<ApiMember(IsRequired=true)>]
member val BhUserId:Int32 = new Int32() with get,set
[<AllowNullLiteral>]
type DonationCreditCardRequest() =
inherit DonationRequestBase()
///<summary>
///Not required if MemberInfo is present on request
///</summary>
[<ApiMember(Description="Not required if MemberInfo is present on request")>]
member val DonorInfo:DonationDonorInfo = null with get,set
///<summary>
///Not required if DonorInfo is present on request
///</summary>
[<ApiMember(Description="Not required if DonorInfo is present on request")>]
member val MemberInfo:DonationMemberInfo = null with get,set
///<summary>
///Campaign to track donation against and to define fund allocation. Use GET /campaigns to retreive valid list of campaignIDs
///</summary>
[<ApiMember(Description="Campaign to track donation against and to define fund allocation. Use GET /campaigns to retreive valid list of campaignIDs")>]
member val CampaignId:Nullable<Int32> = new Nullable<Int32>() with get,set
///<summary>
///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.
///</summary>
[<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")>]
member val CardReferenceOrCardNumber:String = null with get,set
member val CardType:String = null with get,set
///<summary>
///Credit Card Validation value. If Visa, Master Card or Discover, must be 3 digits. If AmEx, must be 4 digits.
///</summary>
[<ApiMember(Description="Credit Card Validation value. If Visa, Master Card or Discover, must be 3 digits. If AmEx, must be 4 digits.", Name="Cvv")>]
member val Cvv:String = null with get,set
[<ApiMember(IsRequired=true)>]
[<ApiMember(Description="Credit Card expiration month. Valid Values 1-12.", IsRequired=true, Name="ExpirationMonth")>]
member val ExpirationMonth:Int32 = new Int32() with get,set
///<summary>
///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.
///</summary>
[<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")>]
member val ExpirationYear:Int32 = new Int32() with get,set
F# DonationCreditCardRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=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>