| POST | /donations/creditcard |
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BH.CloudAPI.Common4.DTO.Donations
Imports ServiceStack.Text
Namespace Global
Namespace BH.CloudAPI.Common4.DTO.Donations
Public Partial Class DonationCreditCardRequest
Inherits DonationRequestBase
Implements IDonationRequestWithDonorInfo
'''<Summary>
'''Not required if MemberInfo is present on request
'''</Summary>
<ApiMember(Description:="Not required if MemberInfo is present on request")>
Public Overridable Property DonorInfo As DonationDonorInfo
'''<Summary>
'''Not required if DonorInfo is present on request
'''</Summary>
<ApiMember(Description:="Not required if DonorInfo is present on request")>
Public Overridable Property MemberInfo As DonationMemberInfo
'''<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")>
Public Overridable Property CampaignId As Nullable(Of Integer)
'''<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")>
Public Overridable Property CardReferenceOrCardNumber As String
Public Overridable Property CardType As String
'''<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")>
Public Overridable Property Cvv As String
<ApiMember(IsRequired:=true)>
<ApiMember(Description:="Credit Card expiration month. Valid Values 1-12.", IsRequired:=true, Name:="ExpirationMonth")>
Public Overridable Property ExpirationMonth As Integer
'''<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")>
Public Overridable Property ExpirationYear As Integer
End Class
Public Partial Class DonationCreditCardResponse
Implements IHaveErrorField
'''<Summary>
'''Legacy ErrorCode
'''</Summary>
<ApiMember(Description:="Legacy ErrorCode", ExcludeInSchema:=true)>
<Ignore>
Public Overridable Property ErrorCode As Integer
Public Overridable Property ErrorMessage As String
Public Overridable Property IsError As Boolean
'''<Summary>
'''Donation Transaction ID
'''</Summary>
<ApiMember(Description:="Donation Transaction ID")>
Public Overridable Property TransactionId As String
Public Overridable Property CardRef As String
End Class
Public Partial Class 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")>
Public Overridable Property FullName As String
'''<Summary>
'''Billing address. Maximum 100 characters.
'''</Summary>
<ApiMember(Description:="Billing address. Maximum 100 characters.", IsRequired:=true, Name:="Address")>
Public Overridable Property Address As String
'''<Summary>
'''Billing city. Maximum 100 characters.
'''</Summary>
<ApiMember(Description:="Billing city. Maximum 100 characters.", IsRequired:=true, Name:="City")>
Public Overridable Property City As String
'''<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")>
Public Overridable Property State As String
'''<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")>
Public Overridable Property PostalCode As String
'''<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")>
Public Overridable Property EmailAddress As String
'''<Summary>
'''Preferred phone number. Maximum 12 characters.
'''</Summary>
<ApiMember(Description:="Preferred phone number. Maximum 12 characters.", Name:="Phone")>
Public Overridable Property Phone As String
End Class
Public Partial Class DonationMemberInfo
<ApiMember(IsRequired:=true)>
Public Overridable Property BhUserId As Integer
End Class
Public Partial Class DonationRecurringInfo
'''<Summary>
'''How often donation is collected automatically
'''</Summary>
<ApiMember(Description:="How often donation is collected automatically", IsRequired:=true, Name:="Frequency")>
Public Overridable Property Frequency As String
'''<Summary>
'''Number of recurring donation cycles.
'''</Summary>
<ApiMember(Description:="Number of recurring donation cycles.", IsRequired:=true, Name:="NumberOfOccurrences")>
Public Overridable Property NumberOfOccurrences As Integer
'''<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")>
Public Overridable Property FutureDonationDate As Nullable(Of Date)
End Class
Public Partial Class 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")>
Public Overridable Property GroupId As String
'''<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")>
Public Overridable Property Amount As Decimal
'''<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")>
Public Overridable Property CurrencyCode As String
'''<Summary>
'''Notes about the donation. Maximum 70 characters.
'''</Summary>
<ApiMember(Description:="Notes about the donation. Maximum 70 characters.", Name:="Memo")>
Public Overridable Property Memo As String
<ApiMember>
Public Overridable Property DonationRecurringInfo As DonationRecurringInfo
'''<Summary>
'''Custom fields
'''</Summary>
<ApiMember(Description:="Custom fields", Name:="MetaData")>
Public Overridable Property MetaData As JsonObject
End Class
End Namespace
Namespace ServiceStack.Text
Public Partial Class JsonObject
Inherits Dictionary(Of String, String)
End Class
End Namespace
End Namespace
VB.NET 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"}