""" Options: Date: 2026-11-08 11:30:44 Version: 5.140 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://devapi.billhighway.com #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: DonationCreditCardRequest.* #ExcludeTypes: #DefaultImports: datetime,decimal,marshmallow.fields:*,servicestack:*,typing:*,dataclasses:dataclass/field,dataclasses_json:dataclass_json/LetterCase/Undefined/config,enum:Enum/IntEnum #DataClass: #DataClassJson: """ import datetime import decimal from marshmallow.fields import * from servicestack import * from typing import * from dataclasses import dataclass, field from dataclasses_json import dataclass_json, LetterCase, Undefined, config from enum import Enum, IntEnum @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DonationDonorInfo: # @ApiMember(Description="Name of donor. Maximum 100 characters. Format must be Firstname {space} Lastname.", IsRequired=true, Name="FullName") full_name: Optional[str] = None """ Name of donor. Maximum 100 characters. Format must be Firstname {space} Lastname. """ # @ApiMember(Description="Billing address. Maximum 100 characters.", IsRequired=true, Name="Address") address: Optional[str] = None """ Billing address. Maximum 100 characters. """ # @ApiMember(Description="Billing city. Maximum 100 characters.", IsRequired=true, Name="City") city: Optional[str] = None """ Billing city. Maximum 100 characters. """ # @ApiMember(Description="Billing state. Two characters, must match valid US state code.", IsRequired=true, Name="State") state: Optional[str] = None """ Billing state. Two characters, must match valid US state code. """ # @ApiMember(Description="Credit Card billing address postal code. Maximum 10 characters.", IsRequired=true, Name="PostalCode") postal_code: Optional[str] = None """ Credit Card billing address postal code. Maximum 10 characters. """ # @ApiMember(Description="Email address of donor. Maximum 100 characters. If provided, must be valid email format.", Name="EmailAddress") email_address: Optional[str] = None """ Email address of donor. Maximum 100 characters. If provided, must be valid email format. """ # @ApiMember(Description="Preferred phone number. Maximum 12 characters.", Name="Phone") phone: Optional[str] = None """ Preferred phone number. Maximum 12 characters. """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DonationMemberInfo: # @ApiMember(IsRequired=true) bh_user_id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DonationRecurringInfo: # @ApiMember(Description="How often donation is collected automatically", IsRequired=true, Name="Frequency") frequency: Optional[str] = None """ How often donation is collected automatically """ # @ApiMember(Description="Number of recurring donation cycles.", IsRequired=true, Name="NumberOfOccurrences") number_of_occurrences: int = 0 """ Number of recurring donation cycles. """ # @ApiMember(Description="Allows the submitter to set a future date for the donation", Name="FutureDonationDate") future_donation_date: Optional[datetime.datetime] = None """ Allows the submitter to set a future date for the donation """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class JsonObject(Dict[str,str]): pass @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DonationRequestBase: # @ApiMember(Description="Client value for Group. String must already be configured in Billhighway system.", IsRequired=true, Name="GroupID") group_id: Optional[str] = None """ Client value for Group. String must already be configured in Billhighway system. """ # @ApiMember(Description="Amount of the payment. Must be an amount less than $10,000,000.00.", IsRequired=true, Name="Amount") amount: Decimal = decimal.Decimal(0) """ Amount of the payment. Must be an amount less than $10,000,000.00. """ # @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") currency_code: Optional[str] = None """ 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="Notes about the donation. Maximum 70 characters.", Name="Memo") memo: Optional[str] = None """ Notes about the donation. Maximum 70 characters. """ # @ApiMember() donation_recurring_info: Optional[DonationRecurringInfo] = None # @ApiMember(Description="Custom fields", Name="MetaData") meta_data: Optional[JsonObject] = None """ Custom fields """ class IDonationRequestWithDonorInfo: donor_info: Optional[DonationDonorInfo] = None member_info: Optional[DonationMemberInfo] = None group_id: Optional[str] = None class IHaveErrorField: is_error: bool = False class IHaveErrorField: is_error: bool = False @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DonationCreditCardResponse(IHaveErrorField): # @ApiMember(Description="Legacy ErrorCode", ExcludeInSchema=true) # @Ignore() error_code: int = 0 """ Legacy ErrorCode """ error_message: Optional[str] = None is_error: bool = False # @ApiMember(Description="Donation Transaction ID") transaction_id: Optional[str] = None """ Donation Transaction ID """ card_ref: Optional[str] = None # @Route("/donations/creditcard", "POST") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DonationCreditCardRequest(DonationRequestBase, IReturn[DonationCreditCardResponse], IDonationRequestWithDonorInfo): # @ApiMember(Description="Not required if MemberInfo is present on request") donor_info: Optional[DonationDonorInfo] = None """ Not required if MemberInfo is present on request """ # @ApiMember(Description="Not required if DonorInfo is present on request") member_info: Optional[DonationMemberInfo] = None """ Not required if DonorInfo is present on request """ # @ApiMember(Description="Campaign to track donation against and to define fund allocation. Use GET /campaigns to retreive valid list of campaignIDs") campaign_id: Optional[int] = None """ Campaign to track donation against and to define fund allocation. Use GET /campaigns to retreive valid list of campaignIDs """ # @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") card_reference_or_card_number: Optional[str] = None """ 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. """ card_type: Optional[str] = None # @ApiMember(Description="Credit Card Validation value. If Visa, Master Card or Discover, must be 3 digits. If AmEx, must be 4 digits.", Name="Cvv") cvv: Optional[str] = None """ Credit Card Validation value. If Visa, Master Card or Discover, must be 3 digits. If AmEx, must be 4 digits. """ # @ApiMember(IsRequired=true) # @ApiMember(Description="Credit Card expiration month. Valid Values 1-12.", IsRequired=true, Name="ExpirationMonth") expiration_month: int = 0 # @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") expiration_year: int = 0 """ 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. """