Skip to main content
Version: Live

Pay Theory Enum Documentation

This document provides an overview of three important enumerations used in the Pay Theory SDK: PAYMENT_TYPE, FEE_MODE, and HealthExpenseType. These enums are crucial for specifying payment methods, fee structures, and health expense categories in various SDK operations.

PaymentType​

The PaymentType enum represents the different payment methods supported by the Pay Theory SDK.

public enum PaymentType: String, CaseIterable, Identifiable {
case card
case ach
case cash

public var id: Self { self }
}

Cases​

CaseDescription
cardRepresents credit or debit card payments.
achRepresents Automated Clearing House (bank transfer) payments.
cashRepresents cash payments (typically used with barcode generation for in-person payments).

Usage​

// Example: Specifying a card payment in a transaction
payTheory.transact(amount: 1000, paymentMethod: .card) { response in
// Handle transaction response
}

FeeMode​

The FeeMode enum defines how transaction fees are handled in the Pay Theory system.

public enum FeeMode: String, Codable {
case merchantFee
case serviceFee
}

Cases​

CaseDescription
merchantFeeThe merchant absorbs the transaction fee. The customer pays only the transaction amount.
serviceFeeThe customer pays the transaction fee in addition to the transaction amount.

Usage​

// Example: Setting up a transaction with a service fee
payTheory.transact(amount: 1000,
paymentMethod: .card,
fee: 50,
feeMode: .serviceFee) { response in
// Handle transaction response
}

HealthExpenseType​

The HealthExpenseType enum categorizes health-related expenses, which can be important for certain types of health savings accounts or flexible spending accounts.

public enum HealthExpenseType: String, Codable {
case healthcare
case perscription
case vision
case clinical
case copay
case dental
case transit
}

Cases​

CaseDescription
medicalRepresents general medical expenses.
perscriptionRepresents prescription medication expenses.
visionRepresents vision-related expenses.
clinicalRepresents clinical expenses.
copayRepresents copayments for medical services.
dentalRepresents dental expenses.
transitRepresents transportation expenses related to medical care.

Usage​

// Example: Processing a medical expense transaction
payTheory.transact(amount: 15000,
paymentMethod: .card,
healthExpenseType: .medical) { response in
// Handle transaction response
}

AttestationEnvironment​

The AttestationEnvironment enum defines the environment to use for app attestation in the Pay Theory SDK.

public enum AttestationEnvironment: String, Codable {
case local
case production
}

Cases​

CaseDescription
localUsed for development and testing in Xcode local device builds.
productionUsed for TestFlight and App Store builds.

Usage​

// Example: Initializing PayTheory with local attestation environment
let payTheory = PayTheory(
apiKey: "partner-sandbox-xxx",
attestationEnvironment: .local,
errorHandler: { error in
// Handle error
}
)