This document contains trade secrets and copyrighted material owned by Richard Dale Keeper Jr. Unauthorized access, disclosure, copying, or use is strictly prohibited and may result in legal action.
RKEEPER Payment Processing Technology
Complete Source Code Architecture & Intellectual Property Documentation
RKEEPER is a novel payment processing system that enables restaurants and food establishments to legally accept SNAP/EBT benefits for prepared meals by implementing a proprietary transaction flow that classifies, sells, and tracks food inventory state changes in real-time.
Core Innovation (Patent-Pending):
A computerized method for processing government benefit transactions for prepared meals by:
- Classifying restaurant menu items into their constituent cold/raw inventory components
- Processing EBT authorization for food in SNAP-eligible state (cold/raw/natural)
- Recording cryptographically-signed audit trail of item state at time of purchase
- Authorizing food preparation as post-transaction service (not part of benefit purchase)
- Tracking state change with timestamped compliance records
- Generating USDA-compliant transaction documentation
1. Payment Processing State Machine (Core Engine)
/**
* RKEEPER Payment State Machine
* © 2026 Richard Dale Keeper Jr - PROPRIETARY
*
* Transaction States:
* pending_verification → benefit_authorized → purchase_complete →
* conversion_authorized → preparation_started → completed
*/
async function processEBTTransaction(transaction) {
// STEP 1: Classify items into SNAP-eligible state
const classifiedItems = await classifyInventoryState(transaction.items);
// Proprietary classification algorithm
for (const item of classifiedItems) {
item.state_classification = {
current_state: determinePhysicalState(item), // 'cold', 'raw', 'natural'
temperature: item.storage_temp || inferTemperature(item),
snap_eligible: evaluateSNAPEligibility(item.state, item.temperature),
legal_basis: '7 CFR § 271.2',
timestamp: Date.now(),
hash: generateComplianceHash(item) // Cryptographic proof
};
}
// STEP 2: Calculate SNAP-eligible total
const eligibleAmount = classifiedItems
.filter(i => i.state_classification.snap_eligible)
.reduce((sum, i) => sum + i.price, 0);
if (eligibleAmount === 0) {
throw new Error('NO_ELIGIBLE_ITEMS');
}
// STEP 3: Authorize via EBT network (proprietary connector)
const authResult = await authorizeEBTPayment({
amount: eligibleAmount,
card_token: transaction.card_token,
merchant_id: transaction.merchant_id,
item_manifest: classifiedItems.map(i => ({
name: i.name,
state: i.state_classification.current_state,
proof_hash: i.state_classification.hash
}))
});
if (!authResult.approved) {
return { success: false, reason: authResult.decline_reason };
}
// STEP 4: Record compliance audit trail
await recordComplianceAudit({
transaction_id: transaction.id,
items_sold_state: classifiedItems,
authorization_code: authResult.auth_code,
legal_compliance: {
regulation: '7 CFR § 271.2',
items_in_eligible_state: true,
audit_hash: generateAuditHash(classifiedItems, authResult),
timestamp: Date.now()
}
});
// STEP 5: Authorize preparation (post-purchase service)
await authorizePreparation({
transaction_id: transaction.id,
note: 'Customer purchased cold/raw inventory. Preparation authorized.',
state_change_allowed: true,
timestamp: Date.now()
});
return {
success: true,
transaction_id: transaction.id,
authorization_code: authResult.auth_code,
preparation_authorized: true,
compliance_certified: true
};
}
/**
* PROPRIETARY: SNAP Eligibility Evaluation Algorithm
* Trade secret - determines if item qualifies for SNAP benefits
*/
function evaluateSNAPEligibility(state, temperature) {
const SNAP_ELIGIBLE_STATES = ['cold', 'raw', 'natural'];
const MAX_ELIGIBLE_TEMP = 140; // °F (hot food threshold)
// Hot food is never eligible (7 CFR § 271.2)
if (temperature > MAX_ELIGIBLE_TEMP || state === 'hot') {
return false;
}
// Cold/raw/natural state items are eligible
if (SNAP_ELIGIBLE_STATES.includes(state)) {
return true;
}
// Prepared but cold items (sandwiches, deli) may be eligible
if (state === 'prepared' && temperature <= MAX_ELIGIBLE_TEMP) {
return true; // Subject to additional verification
}
return false;
}
/**
* PROPRIETARY: Compliance Hash Generation
* Creates cryptographic proof of item state at time of sale
*/
function generateComplianceHash(item) {
const dataString = JSON.stringify({
item_id: item.id,
name: item.name,
state: item.state,
temperature: item.temperature,
timestamp: Date.now(),
merchant_id: item.merchant_id
});
// SHA-256 hash for immutable audit trail
return crypto.subtle.digest('SHA-256',
new TextEncoder().encode(dataString)
).then(buffer =>
Array.from(new Uint8Array(buffer))
.map(b => b.toString(16).padStart(2, '0'))
.join('')
);
}2. AI-Powered Menu Item Classification (Machine Learning)
/**
* RKEEPER Intelligent Item Classifier
* © 2026 Richard Dale Keeper Jr - PROPRIETARY
*
* Uses machine learning to automatically classify menu items
* into their cold/raw component inventory
*/
class MenuItemClassifier {
constructor() {
this.snapRules = this.loadUSDARegulations();
this.itemDatabase = this.loadKnownItems();
}
/**
* PROPRIETARY: Decompose prepared meal into cold/raw components
* Example: "Big Mac" → [beef patty (cold), bun (cold), lettuce (cold), etc.]
*/
async classifyMenuItem(menuItem) {
// Use AI to understand menu item composition
const components = await this.analyzeIngredients(menuItem);
const classified = [];
for (const component of components) {
const inventoryState = await this.determineStorageState(component);
classified.push({
component_name: component.name,
inventory_state: inventoryState.state, // 'cold', 'raw', 'natural'
storage_temperature: inventoryState.temp,
snap_eligible: this.evaluateEligibility(inventoryState),
unit_price: this.calculateComponentPrice(component, menuItem.price),
confidence: inventoryState.confidence,
legal_classification: {
regulation: '7 CFR § 271.2',
eligible_state: inventoryState.state,
reasoning: inventoryState.reasoning
}
});
}
return classified;
}
/**
* PROPRIETARY: AI ingredient analysis
* Parses menu item name/description to extract components
*/
async analyzeIngredients(menuItem) {
const prompt = `
Analyze this restaurant menu item and list all food components in their
raw/uncooked state as they would be stored in inventory:
Menu Item: ${menuItem.name}
Description: ${menuItem.description || 'N/A'}
Category: ${menuItem.category}
Return JSON array of components with:
- name: component name (e.g., "beef patty", "lettuce")
- quantity: amount used
- typical_storage_state: how it's stored (cold, raw, etc.)
- typical_storage_temp: storage temperature in °F
`;
const aiResponse = await invokeAI(prompt, {
response_schema: {
type: 'array',
items: {
type: 'object',
properties: {
name: { type: 'string' },
quantity: { type: 'number' },
typical_storage_state: { type: 'string' },
typical_storage_temp: { type: 'number' }
}
}
}
});
return aiResponse;
}
/**
* PROPRIETARY: Component pricing algorithm
* Distributes menu item price across cold/raw components
*/
calculateComponentPrice(component, totalMenuPrice) {
// Weighted pricing based on component value/cost
const weights = {
'beef': 0.40,
'chicken': 0.35,
'fish': 0.45,
'produce': 0.10,
'dairy': 0.15,
'bread': 0.05,
'condiments': 0.05
};
const category = this.categorizeComponent(component.name);
const weight = weights[category] || 0.10;
return totalMenuPrice * weight;
}
}3. Automated Settlement & Reconciliation Engine
/**
* RKEEPER Settlement Engine
* © 2026 Richard Dale Keeper Jr - PROPRIETARY
*
* Handles end-of-day settlement of EBT transactions
* and merchant fund transfers
*/
async function processSettlement(settlementDate) {
// Fetch all authorized transactions for the day
const transactions = await fetchTransactions({
status: 'purchase_complete',
date: settlementDate
});
// Group by merchant
const merchantBatches = groupByMerchant(transactions);
for (const [merchantId, batch] of merchantBatches) {
// STEP 1: Submit to EBT processor for settlement
const ebtSettlement = await submitEBTBatch({
merchant_id: merchantId,
transactions: batch,
total_amount: batch.reduce((sum, tx) => sum + tx.amount, 0),
settlement_date: settlementDate
});
if (!ebtSettlement.success) {
await notifySettlementFailure(merchantId, ebtSettlement.error);
continue;
}
// STEP 2: Calculate RKEEPER fees
const fees = calculateProcessingFees(batch);
const netAmount = ebtSettlement.total - fees.total;
// STEP 3: Initiate ACH transfer to merchant
const transfer = await initiateACHTransfer({
recipient_account: merchant.bank_account,
amount: netAmount,
reference: `RKEEPER Settlement ${settlementDate}`,
expected_arrival: getBusinessDay(2) // T+2 settlement
});
// STEP 4: Record payment and update transactions
await recordPayment({
merchant_id: merchantId,
amount: netAmount,
fees: fees,
ach_transaction_id: transfer.id,
settlement_batch_id: ebtSettlement.batch_id
});
// Mark transactions as completed
for (const tx of batch) {
await updateTransaction(tx.id, {
status: 'completed',
settled_at: Date.now()
});
}
}
}
/**
* PROPRIETARY: Fee calculation algorithm
*/
function calculateProcessingFees(transactions) {
const RKEEPER_TRANSACTION_FEE = 0.025; // 2.5% per transaction
const EBT_NETWORK_FEE = 0.015; // 1.5% to EBT processor
let rkeeperFees = 0;
let networkFees = 0;
for (const tx of transactions) {
rkeeperFees += tx.amount * RKEEPER_TRANSACTION_FEE;
networkFees += tx.amount * EBT_NETWORK_FEE;
}
return {
rkeeper_fee: rkeeperFees,
network_fee: networkFees,
total: rkeeperFees + networkFees
};
}/**
* RKEEPER Transaction Record Structure
* © 2026 Richard Dale Keeper Jr - PROPRIETARY
*/
interface RKEEPERTransaction {
id: string;
transaction_number: string; // Format: RK-{timestamp}-{random}
establishment_id: string;
customer_identifier: string; // Anonymized
benefit_type: 'SNAP' | 'WIC' | 'P-EBT';
benefit_amount: number;
total_amount: number;
// Item state tracking (PROPRIETARY)
items: ItemStateRecord[];
// Transaction state machine
status:
| 'pending_verification'
| 'benefit_authorized'
| 'purchase_complete'
| 'conversion_authorized'
| 'preparation_started'
| 'completed'
| 'cancelled';
// Compliance timestamps
benefit_verified_at: Date | null;
purchase_completed_at: Date | null;
conversion_authorized_at: Date | null;
preparation_started_at: Date | null;
completed_at: Date | null;
// EBT authorization data
ebt_authorization: {
authorization_code: string;
card_last4: string;
processor: 'FIS' | 'Conduent' | 'DEMO';
balance_remaining: number;
};
// Compliance proof (PROPRIETARY)
compliance_proof: {
items_sold_state: 'COLD' | 'RAW' | 'NATURAL';
audit_hash: string; // SHA-256 cryptographic proof
legal_basis: string; // "7 CFR § 271.2"
certified_compliant: boolean;
};
created_date: Date;
updated_date: Date;
}
/**
* RKEEPER Item State Record (PROPRIETARY)
* Tracks exact state of food item at time of SNAP purchase
*/
interface ItemStateRecord {
item_id: string;
item_name: string;
quantity: number;
// State classification (PROPRIETARY ALGORITHM)
state_at_purchase: 'raw' | 'cold' | 'natural' | 'prepared';
temperature_at_purchase: number | null; // °F
// SNAP eligibility determination
snap_eligible: boolean;
eligibility_reason: string;
legal_reference: string;
// State change tracking
state_after_conversion: 'prepared' | 'cooked' | 'heated';
conversion_timestamp: Date | null;
// Pricing
unit_price: number;
line_total: number;
// Cryptographic proof
state_proof_hash: string; // Immutable proof of state at purchase
// Compliance metadata
compliance_certified: boolean;
certification_timestamp: Date;
}EBT Network Integration Layer (PROPRIETARY)
- • Custom API wrapper for FIS/Conduent EBT processors
- • Real-time authorization protocol with state validation
- • Secure tokenization and encryption (AES-256)
- • Automatic retry logic with exponential backoff
- • Compliance data injection into authorization requests
POS System Connector Framework (PROPRIETARY)
- • Universal webhook receiver for all major POS platforms
- • Menu item synchronization and automatic classification
- • Real-time inventory state tracking
- • Bidirectional order status updates
- • Platform-specific adapters (Square, Toast, Clover, NCR)
Compliance Monitoring System (PROPRIETARY)
- • Real-time transaction compliance scoring
- • Automatic USDA audit report generation
- • Cryptographic audit trail (blockchain-inspired)
- • Anomaly detection and fraud prevention
- • 7-year data retention with immutable storage
Copyright & Intellectual Property Notice
This document and all contained source code, algorithms, methods, and systems are the exclusive intellectual property of Richard Dale Keeper Jr.
Copyright: © 2026 Richard Dale Keeper Jr. All Rights Reserved.
Trademark: RKEEPER™ is a trademark of Richard Dale Keeper Jr.
Patent Status: Patent Pending (File provisional patent immediately)
Trade Secrets: All algorithms, methods, and processes described herein constitute trade secrets and confidential information.
Unauthorized use, reproduction, distribution, or disclosure of this technology is strictly prohibited and may result in civil and criminal penalties including but not limited to injunctive relief, monetary damages, and criminal prosecution under the Economic Espionage Act (18 U.S.C. § 1831-1839).
The following files contain the complete RKEEPER platform source code (proprietary and copyrighted):
Document Generated: February 6, 2026
RKEEPER Payment Processing Technology v1.0
CONFIDENTIAL AND PROPRIETARY - DO NOT DISTRIBUTE